What is the proper way to create a bootable image of my system?
I use both CloneZilla and Back In Time to do system and data back-ups respectively.
The advantage of CloneZilla over built-in tools like dd
is that it uses its own partclone
which creates very small images (it recognizes sparse files, can use a number of compression utilities, ...) and falls back to ddrescue
which allows reading of damaged hard drives! (Nice to have that very last back-up before the HDD finally gives up completely.)
You should however have (at a minimum) a separate /
and /home
if you want to easily differentiate between your OS and user config files.
Nothing is as flexible, robust and fast as CloneZilla to do full off-line image/disk back-ups (and I'm always reading back-up manuals if someone mentions its favourite back-up tool to see whether they've got something better then I have)
If you put CloneZilla onto a 512 MByte bootable partition of an external USB HDD, you can just boot it on any machine and restore any backup you've made to the partition taking the rest of that same HDD.
Warning: if you restore the same system back-up to multiple machines all these machines will be clones of one another with the same host name, time zone, IP (if static), ... so all these need to be personalised after "restore"...
Alternatively, I have a bootable USB SLC stick that has a full install of Linux (in my case lubuntu) without any proprietary drivers and a leading FAT partition, no swap partition but a swap file inside the /
partition that I can boot on any machine (so far) and that I use to disinfect Windows machines (or just work on someone else's machine without touching their data if they're paranoid).
Yes there is a way. The machine doesn't even always need to be the same, since Linux creates the /dev
, /proc
and /sys
filesystems on the fly as the kernel boots which gives you a lot of freedom to make some pretty drastic hardware changes.
Let's say your OS is installed on disk /dev/sda
. You can make an ISO of /dev/sda
and all of its partitions, whatever they may be, with the following command:
dd if=/dev/sda of=/path/to/image.iso
The downside to this is that the image will be the full size of the disk you specified as if
(input file), even if that disk is not full.
If you'd like to clone the disk directly from /dev/sda
, simply insert another disk and use something like:
dd if=/dev/sda of=/dev/sdb