So, I felt like an idiot because following the instructions above I rebooted and found NO snapshots available. It turns out you need to run grub-mkconfig -o /boot/grub/grub.cfg to actually added the snapshots to the grub boot menu.
I got this output:
...
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
Found snapshot: 2022-06-13 17:04:36 | @/.snapshots/220/snapshot | single | boot |
Found snapshot: 2022-06-13 17:00:29 | @/.snapshots/219/snapshot | single | timeline |
Found snapshot: 2022-06-13 16:00:29 | @/.snapshots/218/snapshot | single | timeline |
...
Iāve noticed now that there is a service in the package:
$ sudo systemctl enable grub-btrfs.path
Created symlink /etc/systemd/system/\x2esnapshots.mount.wants/grub-btrfs.path ā /usr/lib/systemd/system/grub-btrfs.path.
Unit /usr/lib/systemd/system/grub-btrfs.path is added as a dependency to a non-existent unit \x2esnapshots.mount.
$ sudo systemctl start grub-btrfs.path
Failed to start grub-btrfs.path: Unit \x2esnapshots.mount not found.
Any idea what this ā\x2esnapshots.mountā itās complaining about is?
Iām not sure why it canāt find my /.snapshots:
$ sudo btrfs sub list /
ID 257 gen 175140 top level 5 path @home
ID 258 gen 175118 top level 5 path @cache
ID 259 gen 175140 top level 5 path @log
ID 260 gen 155924 top level 402 path var/lib/portables
ID 261 gen 155924 top level 402 path var/lib/machines
ID 350 gen 175135 top level 402 path .snapshots
ID 354 gen 156417 top level 350 path .snapshots/3/snapshot
ID 356 gen 155924 top level 5 path @swap
ID 390 gen 158970 top level 350 path .snapshots/37/snapshot
ID 402 gen 175140 top level 5 path @
ID 423 gen 161366 top level 350 path .snapshots/68/snapshot
ID 455 gen 163697 top level 350 path .snapshots/100/snapshot
...
Try to check sudo systemctl list-units -t mount to show the list of mount
UNIT LOAD ACTIVE SUB DESCRIPTION
-.mount loaded active mounted Root Mount
\x2esnapshots.mount loaded active mounted /.snapshots
boot-efi.mount loaded active mounted /boot/efi
...
The default path file is too specific. I recommend using a modified version. I have posted the modified version a few times. If you canāt find it let me know.
@dalto btrfs assistant > snapper settings >snapshot retention
those hourly,daily etc settings, i was always under the impression that those were about how many snapshots the cleanup service would leave behind, but it seems its all about automatic creation of snapshots, since they cant be edited without enabling timeline snapshots? i find that confusing. can you clarify? how does the cleanup service know what i want it to do if those settings arent for that?
In snapper, snapshots have different types that can be cleaned up, timeline - which are taken hourly and then cleaned up according to the retention settings and ānumberā which are the snapshots taken as part of things like snap-pac and friends.
If you arenāt taking timeline snapshots, there is no reason to have a cleanup schedule for them.
After mounting successfully, I see the systemd unit:
# mount | grep snapshot
/dev/sda2 on /.snapshots type btrfs (rw,noatime,compress=zstd:3,space_cache=v2,subvolid=350,subvol=/@/.snapshots)
# systemctl list-units -t mount | grep snapshot
\x2esnapshots.mount loaded active mounted /.snapshots
This made it possible to start the service:
# systemctl status grub-btrfs.path
ā grub-btrfs.path - Monitors for new snapshots
Loaded: loaded (/usr/lib/systemd/system/grub-btrfs.path; enabled; vendor preset: disabled)
Active: active (waiting) since Mon 2022-06-13 19:03:32 BST; 3min 27s ago
Until: Mon 2022-06-13 19:03:32 BST; 3min 27s ago
Triggers: ā grub-btrfs.service
Jun 13 19:03:32 ironyman systemd[1]: Started Monitors for new snapshots.
What I do not understand, is why I see snapshots regardless of whether I mount the subvolume or not. Basically, even before adding the above to fstab, I could list snapshots from command-line, as per my post above.
So now I am confused about BTRFS subvolumes: do they not need to be mounted in order to be visible?
You donāt actually edit the file. You put your changes in /etc/systemd/system either by putting an entire copy of the file or by using drop-ins via the systemctl edit command. That will override the one provided by the package.
I have an improved version of the path unit I can find if you want it.
Hi Zesko, by adding the overlayfs,grub-btrfs-overlayfs does it mean that all the snapshots loaded from the GRUB menu, it will be read and write and I wonāt have to restore again using the BTRFS Assistant app?
The reason I ask is that letās say the update breaks the the GRUB menu completely and I want to restore using to last snapshot. What is the best way to do this?
When I had Timeshift, I can log into TTY and type timeshift -restore command and restore into the previous snapshot directly.
Is there an ability to do this with snapper snapshots?
Hi Dalto, agreed and understood that booting off GRUB is always read-only.
what would be the command line for me to restore? Are you saying that BTRFS Assistant has commands to do this or for now its only possible to restore using the GUI App?
btw, I did test restoring and everything works using the app. no issue to report.
>> btrfs-assistant --help
Usage: btrfs-assistant-bin [options]
An application for managing Btrfs and Snapper
Options:
-h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.
-v, --version Displays version information.
-l, --list List snapshots
-r, --restore <subvolume,UUID> Restore the given subvolume/UUID