[PLUG] Knoppix command line disk ghosting
Chris Genly
chgenly at verizon.net
Wed Jan 12 02:27:23 UTC 2005
I reinstall windows 98 on my sons system every 9 months or so. He uses
it to play games, listen to music, instant message, edit documents and
browse the web. It takes about a day of elapsed time to get the system
back up to speed: installing win98, and all the necessary drivers,
setting up the printer, anti-virus program, open office, mozilla, yahoo
messenger, etc. So I was motivated to looking in to getting an image of
his disk.
I was tickled pink when I found a way to do it without any special
tools. I just needed a Knoppix disk. Here's how I did it.
# Boot knoppix, su to root.
# Mount the windows partition, hda1. hda1 is the only partition.
mkdir /mnt/local
mount /dev/hda1 /mnt/local
cd /mnt/local
# Fill all unused blocks with zeros to allow them to
# be compressed when imaging.
for i in 1 2 3 4 5; do cat /dev/zero >zero$i; done
# Free up the space.
rm zero?
cd /
umount /mnt/local
# Image the whole disk by copying it to another machine after
# compressing it.
gzip - </dev/hda | ssh chgenly at 10.0.0.10 'cat >r2d2_image.gz'
I could even run 'sshdstart' and then do the whole backup thing
remotely. Just too cool. The image fit on to one CD. Very convenient.
Restoring it is easier.
# Boot knoppix, su to root.
ssh chgenly at 10.0.0.10 'cat r2d2_image.gz' | gunzip - >/dev/hda
Surprisingly it takes about three times longer to reload the image with
gunzip, than to create the image with gzip. I have tested the restore
by zeroing the whole hard drive first. It worked great. You get the
boot block, partition table and win98. Everything.
I had such great success I thought I'd image my wifes system. I use
the same procedure, but it fails to create a tidy image. She is using
2Gb on a 10Gb drive. But when I try the backup procedure described
above, the image file gets up to about 4.6Gb before I abort the imaging.
I found this very strange. So I tried doing a disk defrag, and then
doing the whole imaging procedure including zeroing unused blocks.
Still a no go. Anyone have any idea what might be going wrong?
Chris
More information about the PLUG
mailing list