I have linux installed on this laptop. It has 320G HD. I want to experiment something and for that i will have to format my hard disk. I have got a spare 500G USB External Drive. Can someone suggest me a backup method with which i could take a complete backup of current state of the system and later restore it without any issues?
I myself have two options in mind:
- dd
- clonezilla
Here is my fstab
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda7 ext3 19G 12G 6.0G 67% /
/dev/sda6 ext2 2.3G 261M 2.0G 12% /tmp
/dev/sda2 ext2 89M 45M 40M 54% /boot
/dev/sda5 reiserfs 4.9G 614M 4.3G 13% /var
/dev/sda8 ext4 264G 133G 132G 51% /home
Why is
dd
or similar not an option?If it is because it will take too much space to store the pure image, then you can pass the image through gzip with something like
pv /dev/sda | gzip -c > /path/to/destination/image.gz
(assuming sda is the drive you want to image for later restoration). Obviously this need to be run while everything on that drive is mounted readonly or completely unmounted (i.e. the copy is done from a live-CD, a USB based live distro, or a Linux install on another drive if you multi-boot).To maximise the compression you get, zero the free-space on each filesystem first with
pv /dev/zero > /mountpoint/zero.file; rm /mountpoint/zero.file
.[
pv
mentioned above is pipe viewer, available in most standard repositories I assume (it is present in recent Debian repos, certainly) - you can replace it withcat
or standard redirection if you wish, but the progress display thatpv
gives is useful for potentially long operations like this]I would recommend Clonezilla. I've used it quite a few times and had good results. However, a backup is only as good as it's ability to be restored, so you'll need to test the restore. Clonezilla can be a little daunting to a first time user, so either read the manuals really well and trust that your restore will work, or try it on a test system if you can.