grub-btrfs icon indicating copy to clipboard operation
grub-btrfs copied to clipboard

default Arch install - snapper creates btrfs subvolume /.snapshots, not a separate mountpoint

Open TheLinuxNinja opened this issue 3 years ago • 1 comments

I know that snapper users will undo what snapper does and do things a different way with an alternate subvolume layout, but this is in regards to the default install of snapper.

To reproduce: Install Arch using BTRFS. My particular layout looks like this:

ID 256 gen 78 top level 5 path @
ID 258 gen 70 top level 5 path @home
ID 259 gen 70 top level 5 path @root
ID 260 gen 16 top level 5 path @srv
ID 261 gen 55 top level 5 path @cache
ID 262 gen 78 top level 5 path @log
ID 263 gen 74 top level 5 path @tmp
ID 264 gen 13 top level 5 path @libvirt
ID 266 gen 17 top level 256 path var/lib/portables
ID 267 gen 18 top level 256 path var/lib/machines

My subvolume '@' subvolumeid 256 is mounted to /

Then run snapper to create a root config: snapper create-config /

You get an additional subvolume layout like this:

ID 269 gen 74 top level 256 path .snapshots
ID 273 gen 44 top level 269 path .snapshots/1/snapshot

Since the subvolume is '.snapshots' and is a subvolume of the '@' subvolume where '/' lives, there is no mountpoint to monitor. So, the command: systemctl start grub-btrfs.path

Results in: A dependency job for grub-btrfs.path failed. See 'journalctl -xe' for details.

Adding a separate entry to /etc/fstab isn't going to work, either. I know how to work around this by renaming the subvolume and mounting it in /etc/fstab, but this should probably be addressed.

TheLinuxNinja avatar Oct 28 '21 20:10 TheLinuxNinja

To be fair, I don't like the way snapper keeps the snapshots mounted, and I don't like the default layout. I'd rather they not be mounted in the filesystem tree at all, but at least they are read-only.

To workaround this issue:

Mount the subvolid 5 to /mnt mv the /mnt/@/.snapshots to /mnt/@.snapshots so subvolid 5 becomes the parent and the subvolume is renamed to @.snapshots mkdir /.snapshots add the /etc/fstab entry to mount it at /.snapshots mount -a finally umount /mnt

This seems to be a good workaround.

TheLinuxNinja avatar Oct 28 '21 21:10 TheLinuxNinja

hey,

this thing is rather stale, but just wanted to tell you I updated the daemon with the latest PR. No need for systemd to watch mountpoints. Just watches the directory where snapper stores its snapshots for new things to appear.

Schievel1 avatar Oct 21 '22 07:10 Schievel1