2
I recently built a system with a btrfs
root partition. The most compelling reason for adopting btrfs
compared to ext4
, in my case, was live copy-on-write snapshots, with near-zero latency. Compared to ext4
, when a full system backup entailed taking down the system, mounting from a live distribution, and building a partclone
image on removable media, the promise of snapshots is that the snapshot can be captured on the backup media while the system is live.
To my astonishment, no tool exists, however, that will capture the entire snapshot to a single file on external media, such that if the system is restored from that file, all applications will have the same view of the filesystem as before the crash (except that the other snapshots or subvolumes are missing).
The documentation suggests mirroring the directory tree using a tool such as rsync, or using btrfs-send
/btrfs-receive
to capture the incremental changes on another system. In the first case, I have always found it nearly impossible to recreate all the metadata in a file tree exactly by mirroring a file tree rather than imaging the file system, and have little optimism that a restore would be very smooth. I always find that some metadata, be it permissions, timestamps, hidden files, or so on, are not properly captured. The problem is compounded when the transfer occurs across file systems of different types. The other suggestion assumes another btrfs
file system is available, which is not always the case.
Are any suggestions available for saving or restoring a volume-level image, similar to a partclone file, but representing only a select subvolume?
The problem here is that identifying what is a subvolume relies on metadata that you by definition don't want to copy (you only want a subvolume), so I don't think such a tool would be easy to write: It would have to modify this metadata, and keep track while doing so. – dirkt – 2019-01-20T06:54:34.320