This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
data_recovery [2018/08/22 16:48] peek [Data Recovery] |
data_recovery [2018/08/22 17:22] (current) peek |
||
|---|---|---|---|
| Line 26: | Line 26: | ||
| ====== Data Recovery ====== | ====== Data Recovery ====== | ||
| - | If the hardware is suspect, then the first thing to do is get a byte-for-byte copy of the drive' | + | If the hardware is suspect, then the first thing to do is get a byte-for-byte copy of the drive' |
| - | < | + | < |
| + | apt-get install gddrescue | ||
| + | ddrescue -A -f / | ||
| + | </ | ||
| This copy will remain unchanged while we work. Make a copy of this file, and only alter the copy. This way, if anything goes awry then we can go back to square one without having to rely on possibly faulty hardware again. | This copy will remain unchanged while we work. Make a copy of this file, and only alter the copy. This way, if anything goes awry then we can go back to square one without having to rely on possibly faulty hardware again. | ||
| Line 36: | Line 39: | ||
| Use testdisk to search for and repair disk partitions. | Use testdisk to search for and repair disk partitions. | ||
| - | < | + | < |
| + | apt-get install testdisk | ||
| + | testdisk work.img | ||
| + | </ | ||
| Using testdisk involves using the arrow, escape, and enter keys. | Using testdisk involves using the arrow, escape, and enter keys. | ||
| Line 89: | Line 95: | ||
| - Find the offset from the beginning of the disk image file to the partition that you want to work with:\\ \\ '' | - Find the offset from the beginning of the disk image file to the partition that you want to work with:\\ \\ '' | ||
| - Attach the partition to a loopback device:\\ < | - Attach the partition to a loopback device:\\ < | ||
| - | - Attempt to fix the partition: | + | - Attempt to fix the partition: |
| - | - lkjsdf | + | - Mount the fixed partition read-only: |
| + | - Copy files into '' | ||
| + | - Optional: Get a list of files for which tar failed:\\ < | ||
| + | - Optional: Find a list of files of size 0 bytes:\\ < | ||
| + | - Unmount the filesystem: | ||
| + | - Detach the loopback file:\\ < | ||
| + | Final contents of '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * fsck.log -- A log of all the changes that fsck made while fixing the filesystem. | ||
| + | * tar.log -- A log of all the files copied from the disk image into '' | ||
| + | * zero-size.log -- A log of all the files in '' | ||