LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using 'dd' to copy hard drives? (https://www.linuxquestions.org/questions/linux-newbie-8/using-dd-to-copy-hard-drives-530897/)

SlowCoder 02-20-2007 09:20 PM

Using 'dd' to copy hard drives?
 
I'm running FC5. I want to back up my entire hard drive. Can I use dd to do this? Can I do it while the partitions are mounted?

Would something like 'dd if=/dev/hda of=/dev/hdb' work to get this done?

BrianK 02-20-2007 09:29 PM

Quote:

Originally Posted by SlowCoder
I'm running FC5. I want to back up my entire hard drive. Can I use dd to do this? Can I do it while the partitions are mounted?

Would something like 'dd if=/dev/hda of=/dev/hdb' work to get this done?

I've not tried it while the hd's are mounted, but I have a feeling it won't work.... worth a try, I suppose.

You have the syntax correct, but you might want to add a block size argument to speed things up. I typically use the size of the disk buffer, i.e.

dd if=/dev/hda of=/dev/hdb bs=8M

Note that if there are bad sectors on the write-to drive, this may fail.

If you don't need the partition table, you may be better off rsyncing each partition individually... or even cp -pur

SlowCoder 02-20-2007 09:45 PM

I, too, have a feeling running dd on a mounted drive won't work.

My situation is that I've got a FC4 box at work that I need to be able to back up, but not bring the server down in the mean-time.

In the event of failure, I need to get the machine running ASAP. Therefore, a hard drive image is my best option, as far as I can tell.

Of course I'm willing to take suggestions.

syg00 02-20-2007 10:18 PM

Imaging solutions are poison IMHO. The psuedo filesystems (/dev and /proc come to mind) always present problems.
Perhaps you should read this thread before proceeding too far down this track.


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