Verify Source System
- the source system needs to be operational and stable,
check that the /etc/fstab file continues to match in principle:
/dev/hda2 / ext2 errors=remount-ro 0 1 /dev/hda3 none swap sw 0 0 proc /proc proc defaults 0 0 /dev/fd0 /floppy auto user,noauto 0 0 /dev/cdrom /cdrom iso9660 ro,user,noauto 0 0 /dev/hda1 /win vfat ro,user,noauto 0 0
create an alternate /etc/fstab.new file on the source system with the following contents:
/dev/hda1 / ext3 errors=remount-ro 0 1 /dev/hda2 none swap sw 0 0 proc /proc proc defaults 0 0 /dev/fd0 /floppy auto user,noauto 0 0 /dev/cdrom /cdrom iso9660 ro,user,noauto 0 0
(the changes are in the numbering of the disk block devices in the first and second line, the removal of the /win mount point, and the change to ext3 for the root filesystem)
Test Destination System
run memtest from the Knoppix 5.1.1 CD for a few hours to make sure there are no memory or CPU problems, to do this boot from the CD, and at the prompt type memtest and press enter, learn to interpret the output, reboot when ready,
- boot Knoppix 5.1.1 from CD and make sure you can use the mouse, play audio, read from a USB disk, and the normal things you need to do, except internet,
Backup Source System
- bring the source system down to minimum runlevel:
# telinit 1
(this will stop almost everything that isn't needed to do the backup) - make a backup to USB disk:
# mount /dev/sda1 /mnt # tar --create --one-file-system --file /mnt/backup.tar / # umount /mnt
(as noted in discussion, this tar command does not properly handle sparse files but none are expected)
Prepare Destination System
You must erase the existing partitions and create new ones. You must create one that is large enough to cover the size of the source system you are backing up. You must create one for swap. See below:
- boot Knoppix 5.1.1,
- turn off any swap space:
# swapoff -a
- make sure you are doing this on the destination system, not the source system,
- run qparted and erase the partitions and create two new ones, the first is the size of the disk less about 256Mb, and the second is 256Mb,
- or run parted and delete the partitions, then create two new ones, we can provide more detail here,
Restore Backup
It is assumed that /dev/hda1 is the partition into which the backup is restored, and /dev/hda2 is the swap partition.
- prepare the swap space and use it:
# mkswap /dev/hda2 # swapon /dev/hda2
- make a filesystem on the first partition and mount it:
# mke2fs -j /dev/hda1 # mkdir /dst # mount /dev/hda1 /dst
(note that the -j means an ext3 journalled filesystem is created) - restore the backup:
# mkdir /src # mount /dev/sda1 /src # cd /dst # tar --extract --file /src/backup.tar
(as noted in discussion, on Linux the default is --same-permissions, but if this were another operating system you'd need to add that flag) - fix bootloader:
# chroot /dst # mount -t proc proc proc # lilo # umount /proc # exit
- fix /etc/fstab swap partition pointer:
# cd /dst/etc && mv fstab fstab.old && mv fstab.new fstab
- shutdown
# umount /src # umount /dst # reboot
- remove CD and see if it will boot from disk.
Alternate Method
# apt-get install mondo # mondoarchive
Answer lots of questions. Select hard disk as destination.
On the Knoppix booted target system, use mondorestore.