[ltp] Copying Files

James Hawtin linux-thinkpad@linux-thinkpad.org
Mon, 6 Dec 2004 23:48:06 +0000


On Mon, Dec 06, 2004 at 05:20:24PM -0500, James Knott wrote:
> As I mentioed earlier, you can copy partitions, using dd.  However I 
> don't know what it would do with the corruption.  You can copy 
> individual files with dd, but the partition must be mounted, to access 
> files.  You're probably better off with disk recovery utilities.  One 
> cardinal rule, is to use a copy for recovery.  Never try to recover the 
> original disk.

I agree with this completely, Never work with the orginal disk. If you want
to try to recover it yourself

1) Buy a disk as big as your current hard drive.
2) use dd to copy the complete hard disk to the new drive.

EXAMPLE ONLY
# dd if=/dev/hda of=/dev/hdb bs=1m

3) Remove Orginal drive.
4) work with copy.

If you trash the copy you can go back to the orginal and make a "new" copy.

Next your problem. You told us you had corrupted the partition table. This
means, where the "start" and the "end" of partitions are could be corrupt so
the physical disk sectors the partition table points to could be wrong. What
can you do about that? Well.. Sounds like your second partion is ok. So copy
that data off...

You could use disk recoverly tools to search for the start of a partition or
if you can guess the values if you can rember the sizes (This is easier than
you might think). The end of the partition/length is not so important, set
it to the complete rest of the disk! The filesystem knows how much space it
is using... so its fine if your just reading. Also Only mount the disk
partitions read only.

James