Snapshot cleanup broken on Fedora CoreOS
- Dominant language
- Perl
- Stars
- 2.1k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'm running btrbk on a Fedora CoreOS machine and noticed that snapshot cleanup doesn't work. Snapshots are made on schedule (as configured), but somehow `btrbk` doesn't recognize old snapshots and hence doesn't apply the retention policy.
## Background information
Fedora CoreOS comes with XFS as default filesystem, but I converted it to `Btrfs` during provisioning. The default FS layout installs everything directly into the root subvolume and bind-mounts `/var` from `/sysroot/ostree/deploy/fedora-coreos/var` during boot.
I have created two subvolumes now:
- `/var/home/hartan` (my users home)
- `/var/subvol/@snapshots` (my snapshot location)
My btrbk config looks like this:
```
timestamp_format long
snapshot_preserve_min 96h
snapshot_preserve 96h 21d 16w
#volume /hostfs/
snapshot_dir /hostfs/ostree/deploy/fedora-coreos/var/subvol/@snapshots
subvolume /hostfs/ostree/deploy/fedora-coreos/var/home/hartan
```
I tried both using a `volume` section and using absolute paths, but the result remains the same. `btrbk` is run every 15 minutes from a systemd timer. Using verbose logging I can see that `btrbk` correctly detects there are >2000 subvolumes in the snapshot directory, but it doesn't recognize any of these as valid snapshots of the configured subvolume.
I tried poking around in the code but it's the first time I'm confronted with `perl` and I can't figure out what keys are in a `HASH`-type. Far as I can tell the call to `vinfo_subvol_list` either comes up empty, or it lists exactly 4 subvolumes:
1. `/var/home/hartan` (my homedir)
2. `/var/subvol/@snapshots` (the snapshot directory)
3. `/@beeshome` (for data deduplication with bees)
4. The latest snapshot (the one it just recorded)
I'll happily provide more output and logs, or try debugging the code if someone gives me instructions. Thank you in advance!
## Additional information
- btrbk: 0.32.6
- btrfs-progs: v6.3.2
- Host: Fedora CoreOS 38.20230709.3.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.