[K12OSN] Making an exact, bootable copy of a bootable hard drive

ssanders at coin.org ssanders at coin.org
Wed Dec 21 04:56:47 UTC 2005


Most versions of Knoppix won't (easily) see the LVM partitioning, but if
you just want to clone the whole drive, I think dd from any Linux
bootable disk would do it. You could use fdisk to dump the existing
partitions, but I think dd will do away with that anyway. dd doesn't
know or care what formatting/partitioning the destination drive is
starting out as, it will write every sector. You can see the drives'
device from a root terminal window with:

cat /etc/fstab

If you do that while booted to LTSP with LVM, you should see things more
or less like:

/dev/VolGroup00/LogVol00 /           ext3    defaults        1 1
LABEL=/boot             /boot        ext3    defaults        1 2
/dev/devpts             /dev/pts     devpts  gid=5,mode=620  0 0

>From a Knoppix boot, it should look somewhat like:

/dev/hdb1 /mnt/hdb1 ext3 auto, users,exec 0 0
/dev/hdc1 /mnt/hdc1 ext3 auto, users,exec 0 0

The drives need to be unmounted for dd, but it would be wise to mount
each drive briefly and make _very sure_ you know which is which. In
Knoppix, you can use the desktop icons to view (the LVM one may not
display completely). Right-click|unmount then when done looking. When
juggling drives in and out, then booting to Knoppix, it can be easy to
get them mixed up. There's few things less fun than cloning an empty
disk over what you had hoped to back up.

Then, copy it over:

dd if=/dev/sourcedrive of=/dev/destdrive

If you are then planning on placing the new drive in place of the
original, make sure master/slave/IDE things are all as before, and it
should be just like the original.

Hope this helps.




More information about the K12OSN mailing list