I configured UrBackup client to use BTRFS snapshots, but it fails to create snapshots on my partially BTRFS based system. The directories being backed up are all on BTRFS filesystems, but /mnt
is Ext4.
I get the following errors:
Creating snapshot of "/home" failed ERROR: not a btrfs filesystem: /mnt/urbackup_snaps
I created a work-around by modifying btrfs_create_filesystem_snapshot
. I added the first two lines in front of the third:
mkdir -p $SNAP_MOUNTPOINT/.urbackup_snaps SNAP_DEST=$SNAP_MOUNTPOINT/.urbackup_snaps/$SNAP_ID btrfs subvolume snapshot -r "$SNAP_MOUNTPOINT" "$SNAP_DEST"
I was too lazy to check out how the passed around arguments were actually being used outside of the script itself, so to be safe I made a snapshot of my own. A quick look seems to show that my files are still there and got backed up, but I haven’t yet done a proper compare to be sure.
Prior to creating this work-around I also tried to use LVM based snapshots, but got different errors.
I’m guessing this one is probably due to having no unallocated space on the PV:
Internal error: Unable to create new logical volume with no extents.
These errors, on a different filesystem, seem to indicate an incompatibility with bcache and/or BTRFS RAID on top of LVM:
Volume group "bcache2" not found Cannot process volume group bcache2 Could not find LVM volume group of volume /dev/bcache2
The stack looks like this, from top to bottom:
btrfs volume bcache superblock logical volume physical volume cryptLUKS MS-DOS partition
bcache2 is not a volume group. It has its own VG, PV and LV. The BTRFS volume is part of an asymmetrical RAID1, bcache2 is part of the same cache set as the other RAID drives, but everything else should be independent.
Note in particular that it only complained about one out of three drives. I deliberately kept the VGs separate to make sure I couldn’t accidentally put supposedly redundant volumes on the same physical disk. However, UrBackup showed no signs of attempting to snapshot all relevant drives. In theory, if the bcache weren’t an issure, it might have snapshotted not even one full copy of the data. Of course, maybe it just gave up after the first one. I would like to know if it’s even coded to try to recognize this possibility.