Linux tools: linuxclone

linuxclone makes a bootable clone of your running Linux system onto a second (USB) disk.

Of course, you can make clones or backups with a lot of tools like rsync, dd, clonezilla, etc, but they will not be bootable without modifications or you cannot do differential backups.

With linuxclone you can copy your system onto a small USB flash drive, to carry it with you everywhere.
And you can very easily update it with the same command: only the differences will be then transfered, which is normally done in under a minute.

→ with linuxclone you have a "living" backup of your Linux system!

To use any new disk, you first have to partition and format it.
You can perform this task also with linuxclone.
If you omit the swap partition, then linuxclone will add a FAT partition for file exchange with Windows systems.
You can optionally specify the target filesystem type and size.

You can further clone your USB disk to another PC/notebook:
just boot with that USB disk and run linuxclone again, now with the internal disk as the target.

linuxclone copies by default only the files from the / and /boot filesystem, other filesystems (like /home) has to be named explicitly with option -a

usage: linuxclone [-n] [-u] [-v] [-x LIST] [-a LIST] [-b [DEV]] TARGET-PARTITION
usage: linuxclone [-n] -D [FS-TYPE:][/-SIZE][:SWAP-SIZE] TARGET-DISK
usage: linuxclone [-n] -G [FS-TYPE:][/-SIZE][:SWAP-SIZE] TARGET-DISK
usage: linuxclone -l
usage: linuxclone -H
options: -H  show more help and examples
         -l  list all disks and partitions
         -n  no write action, dry run
         -u  update only older files, do not delete files
         -v  verbose mode
         -b  install bootloader on DEV
         -x  colon separated list of excluded files or directories
         -a  colon separated list of additional files or directories
         -D  make new DOS partition table with MBR (*)
         -G  make new GUID partition table for UEFI (*)
(*) format with FS-TYPE, /-SIZE and SWAP-SIZE are in GB

Extra: save Super Grub2 Disk ISO image to /boot/grub/ and linuxclone -b will copy it into the first FAT partition of your target disk.

Hint: when you use btrfs as target filesystem, then your USB flash drive will be mounted with compression option which gives you double speed and space!

Cloning a Linux system with 6 GB typically is done in 5 minutes.
Updating this clone typically is done in 1-2 minutes.

Author: Ulli Horlacher