SystemRescueCd
SystemRescueCd (SRCd), available at www.sysresccd.org, is a bootable CD with the tools required to diagnose, back up, and restore a system. I've also put SRCd on a 256-MB bootable USB stick.
You can use the fb1280 kernel on any system with a decent display and, because most PCs have enough memory for the entire 100-MB CD image, you can also specify cdcache to speed things up. SRCd starts off with a garish character-mode display, but on the other hand, it's not particularly fussy about the underlying hardware, which is precisely what you want in a rescue program. With SRCd booted, net-setup eth0 configures nearly any NIC for either DHCP or a specific IP address. Run ifconfig to verify that it's set up the way you want, ping another box to be sure you have the network cable plugged in, then run /etc/init.d/nfs start to enable remote mounting.
You probably already have a PC set up with an NFS- or SMB-shared hard drive, and if not, you should. Listing One shows what you need to mount an NFS drive at /mnt/temp1 in the SRCd filesystem. Actually setting up the server is straightforward and well documented, at least after you understand UNIX-style file permissions.
run_qtparted # create the partitions on the drive net-setup eth0 # define IP address and suchlike /etc/init.d/nfs start # also fires up portmapper, lockd, etc mount 192.168.1.2:/bulkdata /mnt/temp1 # mount the NFS share from the server cd /mnt/bulkdata/Backups/Dim4550 # directory for these partition images partimage restore /dev/hda1 WinXP-hda1.000 # restore the first partition
Creating partitions on a drive is straightforward: run_qtparted starts a graphical partitioning program. I prepared an NTFS partition for Windows XP, a swap partition, an ext2 partition for Debian, and an ext3 partition for SuSE that filled the rest of the drive because I planned to have our daughter reinstall SuSE from scratch.
The partimage program saves and restores partition image files with optional compression to reduce the file size. It can use files on a different hard drive or partition, run in client-server mode with another partimage on the machine with the image files, or restore directly from an image file on CD or DVD. Using an NFS share works nicely with my setup.
If you want to restore a partition's original contents into a larger partition, create the new partition at its original size, restore the image file, then resize the partition with QTPartEd. Yes, it works with NTFS.
Filling a partition's unused space with binary zeros dramatically reduces the space required for a compressed image file. Mount the partition (mount /dev/hda1 /mnt/part), create the file (cp /dev/zero /mnt/part/dummy), delete it (rm /mnt/part/dummy), then proceed with the partimage backup.
Obviously, this level of detailed control doesn't scale well to large installations, but overall it's no more effort for me than commercial software. The benefit comes from knowing how things work, which pays off when the support-line phone rings.