[ltp] Cloning a hard disk?

Robert Kleemann linux-thinkpad@linux-thinkpad.org
Fri, 19 Aug 2005 11:30:42 -0700


This doesn't solve the original poster's problem but since people are 
chiming in about various copy methods I figure I might as well mention 
the one I use most often.

It seems like whenever I install linux I make some partition too big or 
forget some necessary partition or whatever.  The result is I want to 
back up the install that I already have and then repartition the drive. 
(I've had bad luck with partition resizing tools)  Freshly created 
partitions are mostly empty so it is often faster to back up the 
individual files instead of the entire parition.  It also requires less 
space on the backup system.

So to save a partition, boot your favorite rescue disk (knoppix, 
tomsrbt, damn small linux, gentoo, whatever)

# mkdir slash
# mount /dev/hda5 slash
# cd slash
# tar czpf - | ssh mybackupcomputer.domain.com -C "cat > slash.tgz"

Repartition your disk any way you want.

# mkdir slash
# mount /dev/hda6 slash
# cd slash
# ssh mybackupcomputer.domain.com -C "cat slash.tgz" | tar xzpf -

Robert.