LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   hard drive failing, how can I create an image of my drive? (http://www.linuxquestions.org/questions/suse-novell-60/hard-drive-failing-how-can-i-create-an-image-of-my-drive-340723/)

oily_rags 07-06-2005 05:04 PM

hard drive failing, how can I create an image of my drive?
 
My hard drive is dying off and I want to make an image and transfer it to my other hard drive. I looked at norton ghost, but it only supports ext3, I have reiserfs. I also looked at partimage, some linux program that is similar to ghost, but it's in alpha quality and I can't even access there website, it's down. Can anyone recommend to me an easy to use tool for backing up my linux drive? I want to duplicate it as is on my other drive. thanks

juanbobo 07-06-2005 05:06 PM

You can use the "dd" command:

dd if=/dev/hda1 (or whatever your partition is) of=target (the target can be another partition or a file you can use to restore the partition later.

oily_rags 07-06-2005 05:08 PM

wow that was a fast reply, under a minute since I clicked post hehe. Thanks juanbobo

rjlee 07-06-2005 05:10 PM

If you want to copy an image from one partition to another of identical size, you can do this:
Code:

dd if=/dev/hda1 of=/dev/hdb2
where hda1 is the partition to copy from and hdb2 is the partition to copy to. You can also create an image file:
Code:

cat /dev/hda1 | bzip2 > file.img
and the load it back:
Code:

cat file.img | bunzip2 > /dev/hdb1
Don't write to the wrong partition or you won't be able to recover. You should also unmount the partition before you copy it; this usually means using a rescue disk.

You can copy an image onto a partition that's too large, but you will then lose the extra space (unless you resize the reiserfs image). If you copy it to a partition that's too small, you'll probably break something.

There are tools out there to do this more efficiently, but this method is simple, needs no extra tools, and it does work.

oily_rags 07-06-2005 05:14 PM

I'm copying the linux partition to a hard drive that is much larger, will this method still work rjlee?

ithawtewrong 07-06-2005 06:39 PM

If the drive has errors on it I think ddrescue may be a better tool. You may need to download and compile though. I've never actually used it, but I think the command line switches are very similar if not the same.

$.02

rjlee 07-07-2005 02:19 PM

Quote:

Originally posted by oily_rags
I'm copying the linux partition to a hard drive that is much larger, will this method still work rjlee?
I would advise creating a partition of the exact same size (in bytes) on the larger hard drive. You can then partition and format the remaining and use it as a new drive, or resize the ReiserFS partition using various tools e.g. gnuparted.


All times are GMT -5. The time now is 09:51 PM.