Create an image of a partition using OpenSource tools
Introduction
This process will copy an entire partition to a file. It will not copy an entire disk to a file. The advantage is that you can change the size of the disk and it only copies the data, not the empty bits on the disk.
Prepare
- Download SystemRescueCd and burn it to a CD.
- Have a ssh server available on your network.
- If networking is not an option, consider connecting the disk to a system that can do the backup.
- On Windows machines, be sure to run JKDefrag.
- Especially for Windows, it seems to work best if the system shutdown was graceful. Do not try this from a hibernated system or immediately after a crash unless it’s the last resort.
- BE CAREFUL! Probably best not to use these tools for systems with critical data. In such cases, just buy something more advanced.
Make the image:
- Boot the source system with SystemRescueCd.
- Enable the network. (
ifconfig eth0 x.y.z.1
) - Create a /mnt directory for the destination. (
mkdir /mnt/ssh
) - Mount ssh. I used
sshfs login@ssh.server.org:/path/to/dir /mnt/ssh
- Identify the partitions
fsarchiver probe
- Use fsarchiver. I used
fsarchiver savefs -s 680 /mnt/ssh/test.fsa /dev/sda1
for CD. I used a-s 4470
for DVD’s. Note the .fsa extension. Note: process may max out for a long time but only write 243 bytes to the output file, but it will work eventually. - See also http://www.fsarchiver.org/QuickStart
Restore the image:
- Boot the target system with SystemRescueCd.
- Enable the network.
ifconfig eth0 x.y.z.1
- Create a /mnt directory for the source. Maybe
mkdir /mnt/ssh
. - Run
startx
to get into a UI. Then usegparted
to edit partitions. - Mount ssh
I used
sshfs login@ssh.server.org:/path/to/dir /mnt/ssh
- Identify the partitions
fsarchiver probe
. - Use fsarchiver
I used
fsarchiver restfs /mnt/ssh/disk.fsa id=0,dest=/dev/sda1,mkfs=reiserfs
Note: this will automatically span files. - See also http://www.fsarchiver.org/QuickStart