I have /var/log as a btrfs filesystem in a separate partition from root. I'm using snapshots for update and will later rollback.
# mount /dev/sda2 on / type btrfs (rw,relatime,ssd,subvol=@) /dev/sda1 on /boot type ext2 (rw,relatime) /dev/sda2 on /home type btrfs (rw,relatime,ssd,subvol=@home) /dev/sda3 on /var/log type btrfs (rw,relatime,ssd) # fstab # / was on /dev/sda2 during installation LABEL=root / btrfs relatime,ssd,subvol=@ 0 1 # /boot was on /dev/sda1 during installation LABEL=boot /boot ext2 relatime 0 2 # /home was on /dev/sda2 during installation LABEL=root /home btrfs relatime,ssd,subvol=@home 0 2 # /var/log was on /dev/sda3 during installation LABEL=log /var/log btrfs relatime,ssd 0 2
Everything works fine for my root partition, the problem is with my log partition. Any snapshots I create in /var/log are visible in the /var/log directory and I can't figure out how to rollback the /var/log snapshot. I like the way the root partition hides the subvols and I'd like to do the same for log partition.
Here's my root and log partitions with some snapshots
[~]$ sudo btrfs subvolume list / ID 257 gen 3165 top level 5 path @ ID 258 gen 3142 top level 5 path @home ID 262 gen 2086 top level 5 path fr-root ID 263 gen 2086 top level 5 path fr-home [~]$ sudo btrfs subvolume list /var/log ID 257 gen 519 top level 5 path fr-log
Since there is no '@log' to create the fr-log snapshot i had to:
sudo mount -L log /mnt/up sudo btrfs subvolume snapshot /var/log /mnt/up/fr-log
Instead of creating from the mount like I did for root:
sudo mount -L root /mnt/up sudo btrfs subvolume snapshot /mnt/up/@ /mnt/up/fr-root
I tried the steps here Creating btrfs subvolume like @ or @home but my edits to fstab would cause the box to fail on boot.