[lug] Duplicating the Boot partition on a second drive

D. Stimits stimits at idcomm.com
Sat Mar 24 02:04:44 MST 2001

"J. Wayde Allen" wrote:
> I'm currently trying to decide how I'm going to partition two hard drives
> on a server I'm building, and would like to create two bootable
> partitions.  My thought is that I can create a bootable root partition on
> the first drive (/dev/sda1) and a similar bootable partition on the second
> drive (/dev/sdb2).  I would then like to make /dev/sdb2 a copy of
> /dev/sda1.  The idea being that if drive 1 fails I "should" be able to
> boot the system off of drive 2.
> What is the best way to copy /dev/sda1 to /dev/sdb1?  Can I just do a cp
> or should I use something like dd or cpio?

You'll find that sometimes filenames are generated with spaces in them
(it's legal, but you have to quote it to use cp on it), especially in
home directories for quite a few network apps. Don't even bother with cp
unless you first turn it into a tar archive. I haven't tried the dd
approach, but if your drives don't have any bad sectors on them, I'd try
that for kicks. Hmm, just had an idea. You might attempt to use tar to
create a tar archive, but instead of going to a file, pipe it to the tar
extraction which would point at the other partition. tar in, tar out,
pipe in between. Make sure tar switches preserve permissions.

D. Stimits, stimits at idcomm.com

> - Wayde
>   (wallen at lug.boulder.co.us)

More information about the LUG mailing list