LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How to copy ext2fs from failed hard drive to good drive? (http://www.linuxquestions.org/questions/linux-hardware-18/how-to-copy-ext2fs-from-failed-hard-drive-to-good-drive-224551/)

DogWalker 08-30-2004 08:27 PM

How to copy ext2fs from failed hard drive to good drive?
 
I have a Maxtor DiamondPlus 9 80GB hard drive that has failed. The partion table is corrupt and cannot be written. I can read the drive, however, and have successfully transferred all MS-Windows partitions to a new drive. Using R-Linux, I can recover individual files it finds and can, probably, capture the entire ext2fs partition to a MS-Windows partition on the new drive. What I would like to do is copy the ext2fs partition on the failed drive to an ext2fs partition on the new drive. What tool can I use to make the copy? When copied successfully, I hope to boot the copied partition and use fsck to fix the damaged inodes. Thanks for any help.

littleking 08-30-2004 09:37 PM

just install the drive in your system, mount the drive then copy the files

maroonbaboon 08-30-2004 10:52 PM

Not sure I completely understand the situation. You can 'capture/restore' partitions in linux using the 'dd' command (e.g. dd -if=/dev/hda1 -of=somebigfile). There are options for setting block size and block count which are probably signficant in this case. There is even a command to resize a restored partition to fill the new partition (Sorry - I don't have this on the PC I'm using -- resizextfs or something???).

If you have already captured the partition with a low-level copy to <somebigfile> you may be able to mount it directly using the loopback device (if this is enabled in your kernel) with something like

mount -o loop <somebigfile> /mnt

But maybe you will want to make a copy before doing fsck or whatever. Sorry if I misunderstood the problem.


All times are GMT -5. The time now is 05:35 AM.