I have backed up my system to an external ximeta Drive Using "DD" and the well-known Linux Live CD distribution, knoppix to boot from. Below are the steps in brief:
- Boot from the live CDROM distribution.
- Switch to root.
- Make sure no partitions are mounted from the source hard drive.
- Mount the external HD.
# mount -t vfat /dev/sda1 /mnt/sda1
- Backup the drive.
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
"DD" is the command to make a bit-by-bit copy of "If =/dev/hda" as
"Input file" to "of =/mnt/sda1/hda.img.gz" as the "output file ".
Everything from the partition will go into an "output file" named
"Hda.img.gz". "Conv = sync, noerror" tells dd that if it can't read
Block due to a read error, then it shoshould at least write something
Its output of the correct length. Even if your hard disk exhibits no
Errors, remember that DD will read every single block, including any
Blocks which the OS avoids using because it has marked them as bad.
"BS = 64 K" is the block size of 64x1024 bytes. Using this large of Block
Size speeds up the copying process. The output of DD is then piped
Through gzip to compress it.
- To restore your system:
# gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda conv=sync,noerror bs=64K
- Store
Extra information about the drive geometry necessary in order
Interpret the Partition Table stored within the image. The most
Important of which is the cylinder size. # fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info
Notes:
One of the disadvantages of the DD method over software specifically
Designed for the job such as ghost or partimage is that DD will store
The entire partition, including blocks not currently used to store
Files, whereas the likes of ghost understand the filesystem and don't
Store these unallocated blocks. The overhead isn't too bad as long
You compress the image and the unallocated blocks have low entropy. In
General this will not be the case because the emtpy blocks contain
Random junk from bygone files. To rectify this, it's best to blank all
Unused blocks before making the image. after doing that,
Unallocated blocks will contain mostly zeros and will therefore
Compress down to almost nothing.
Mount the partition, then create a file of zeros which fills the entire disk, then delete it again.
# dd if=/dev/zero of=/tmp/delete.me bs=8M; rm delete.me
References:
- Backup-hard-disk-partitions
- Linux_loopback
- Imagedrive