Metainformationen zur Seite
  •  

Dies ist eine alte Version des Dokuments!


Artikel Info

Artikel Info

Artikel Info
BeschreibungVorgehen Datenrettung
Stand
Fertig
Version14.1113
Kategorien

Anleitung

,

Linux

,

Service

Name:
Datenrettung Linux
Beschreibung:
Tools und Vorgehensweise (Linux)
Bereich:
Anleitungen
Kategorien:
Forensik und Datenrettung, software
Version:
2014-11-13

Datenrettung unter Linux

Vorgehensweise

1. Datenträger überprüfen (Stufe 1)

Tool: GSmartControl

Sollte hier ein Fehler festgestellt werden sollte unbedingt erst ein Image erstellt werden. Danach kann die Platte mit badblocks überprüft werden.

2. Image erstellen

Tool: ddrescue (cli)

  • Stufe 1:
    sudo ddrescue -n -d -v /dev/sda /home/user/backup_full.img /home/user/mapfile
  • Stufe 2:
    sudo ddrescue /dev/sda /home/user/backup_full.img /home/user/mapfile

GNU ddrescue Manual

Ubuntu GNU ddrescue Manual

3. Daten wiederherstellen

Nun kann mit weiteren Tools versucht werden vom Abbild vorhandene Daten wieder herzustellen.

testdisk
Wiederherstellung einer verlorenen und der Reparatur einer korrupten Partition
sudo testdisk /home/user/backup_full.img
Schritt für Schritt Wiederherstellung (CGSecurity)
photorec
stell gelöschte Dateien oder verlorene Daten von einem formatierten oder defekten Dateisystem wieder her
sudo photorec /home/user/backup_full.img
PhotoRec Schritt für Schritt (CGSecurity)
Nach dem Gebrauch von PhotoRec (CGSecurity)
scalpel
stell gelöschte Dateien oder verlorene Daten von einem formatierten oder defekten Dateisystem wieder her. Wie photorec.
Erst die Datei /etc/scalpel/scalpel.conf bearbeiten bzw eine erstellen
sudo scalpel [-c scalpel.con] [-i file] /dev/sda1 -o outputDir 
Recover Deleted Files With Scalpel

4. Datenträger überprüfen (Stufe 2)

Den Datenträger auf defekte Blöcke überprüfen

sudo badblocks -vs /dev/sdb [> ~/bad-blocks]

Mit dem Parameter -w gehen alle auf dem Datenträger vorhandenen Daten unwiederbringlich verloren!

sudo badblocks -vws /dev/sdb [> ~/bad-blocks]

Wurde ein Abbild des Datenträgers erstellt?

Alternativ kann auch der Parameter -n (non destructive read/write test) verwendet werden:

sudo badblocks -vns /dev/sdb [> ~/bad-blocks]

Paramter

-b block-size
Specify the size of blocks in bytes. The default is 1024.
-i input_file
Read a list of already existing known bad blocks.
Badblocks will skip testing these blocks since they are known to be bad. If input_file is specified as „-“, the list will be read from the standard input. Blocks listed in this list will be omitted from the list of new bad blocks produced on the standard output or in the output file. The -b option of dumpe2fs(8) can be used to retrieve the list of blocks currently marked bad on an existing filesystem, in a format suitable for use with this option.
-n
Use non-destructive read-write mode.
By default only a non-destructive read-only test is done. This option must not be combined with the -w option, as they are mutually exclusive.
-o output_file
Write the list of bad blocks to the specified file.
Without this option, badblocks displays the list on its standard output.
-s
Show the progress of the scan by writing out rough percentage completion of the current badblocks pass over the disk.
Note that badblocks may do multiple test passes over the disk, in particular if the -p or -w option is requested by the user.
-v
Verbose mode.
-w
Use write-mode test.
With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents.
This option may not be combined with the -n option, as they are mutually exclusive.
-p n
Anzahl der Druchläufe

Nach dem Test sollten die defekten Sektoren auch als solche markiert werden:

sudo fsck -l ~/bad-blocks /dev/sdb

5. Abbilder einhängen (mount)

Image einer Partition einbinden

sudo mount -o loop /home/user/backup_full.img /mnt/hdd_image

Partition aus einem Image der gesamten Platte einbinden

offset der Partition ermitteln
sudo fdisk -l /home/user/backup_full.img
Der hierdurch ermittelte Anfangswert der Partition muss nun mit der Sektorgröße multipliziert werden
Partition einbinden
sudo mount -o loop,offset=<wert> /home/user/backup_full.img /mnt/hdd_image

Dateisysteme einbinden

Diskussion

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen: