2

I've set up a new Linux workstation and would like to create a backup image in order to save time in case something breaks. This is the situation:

  • Workstation: 512 GB SSD, 12 GB used, ext4 file system, may contain bad blocks
  • Backup drive: 64 GB USB flash drive

The backup image should be bootable for added flexibility and, importantly, all programs, configurations, network settings (proxies, VPNs) etc. have to be preserved.

As I understand, a sparse, file-based image is necessary, since the backup drive (and possibly also the replacement drive) is smaller than the source drive.

What backup/cloning tool understands file systems and creates sparse, bootable images?

AFAIK, dd just copies bit by bit and ddrescue can only sparsify blocks of zeros into metadata, but not unused space filled with random data. Some disk cleanup tools offer to fill unused space with zeros, but this usually takes many hours and I'm not sure if this is good practice for collapsing data (especially on an SSD).

I need a reliable, free, and easy solution as I don't have much expertise on file systems, partition structures, boot sectors etc.

2

1 Answer 1

1

The easiest way is to partition the backup drive, create the file system(s), and copy the files over using cp -a or rsync. Then install a bootloader on the drive.

2
  • How does the backup drive have to be partitioned, does it suffice to allocate the amount of space equivalent to the sparsified data? And installing the bootloader means simply copying over the first 446 Bytes to the new drive?
    – david
    Commented Jul 14, 2020 at 0:59
  • If the source drive has multiple partitions (I think there are 4 in total, something like system + swap + LVM + LUKS...it's just a standard LMDE4 installation), do I have to recreate all of them on the destination drive (albeit with less allocated space)? What if I just create a single ext4 partition and throw everything into it - will this cause problems when launching/running the backup?
    – david
    Commented Jul 14, 2020 at 1:16

Not the answer you're looking for? Browse other questions tagged .