GRUB not displaying BTRFS Snapshots

I’ve been installing various versions of Manjaro (eg testing, KDE, Gnome flavours) and other distros on my system and I eventually broke GRUB. I fixed it with the top-notch wiki guide here but in the mean time I installed a what turned out to be a naughty problem called grub-customizer which breaks things. Anyway, I fixed my GRUB with chroot with the guide to get Manjaro booting again with various kernel options but try as I might I can’t get snapshots back into the GRUB menu.

I have done the following:

  • set correct drive to boot from in BIOS
  • reinstalled GRUB
  • update-grub
  • done mkinitcpio -P
  • reinstalled GRUB-BTRFS
  • removed deprecated entries from GRUB with efibootmgr
  • checked the config with systemctl edit --full grub-btrfsd
  • and /etc/default/grub-btrfs/config
  • reinstalled timeshift-autosnap
  • reinstalled inotify-tools

I think this error (3rd line from bottom here) might be a clue somehow:

sudo systemctl status grub-btrfsd                                                                                    ✔  12s  
● grub-btrfsd.service - Regenerate grub-btrfs.cfg
     Loaded: loaded (/etc/systemd/system/grub-btrfsd.service; enabled; preset: disabled)
     Active: active (running) since Tue 2024-05-21 14:44:01 NZST; 31min ago
   Main PID: 885 (bash)
      Tasks: 3 (limit: 18285)
     Memory: 15.7M (peak: 30.1M)
        CPU: 2.854s
     CGroup: /system.slice/grub-btrfsd.service
             ├─  885 bash /usr/bin/grub-btrfsd --syslog --timeshift-auto
             ├─  894 bash /usr/bin/grub-btrfsd --syslog --timeshift-auto
             └─20155 inotifywait -q -q -e create -e delete /run/timeshift

May 21 15:03:21 user-asustuf root[19430]: 40grub2: debug: parsing: linux /@/boot/memtest86+/memtest.efi
May 21 15:03:21 user-asustuf root[19430]: 40grub2: debug: parsing: }
May 21 15:03:21 user-asustuf root[19430]: 40grub2: result: /dev/nvme1n1p3:/dev/nvme1n1p3:Memory Tester (memtest86+):/@/boot/memtest86+/memte>
May 21 15:03:21 user-asustuf root[19430]: 40grub2: debug: parsing: fi
May 21 15:03:21 user-asustuf root[19430]: 40grub2: debug: parsing: ### END /etc/grub.d/60_memtest86+-efi ###
May 21 15:03:21 user-asustuf root[19430]: linux-boot-prober: debug: /usr/lib/linux-boot-probes/mounted/40grub2 succeeded
May 21 15:03:21 user-asustuf root[19430]: linux-boot-prober: error: umount error, retrying after 1 sec
May 21 15:03:23 user-asustuf grub-btrfsd[20130]: [!] Error during grub menu creation (grub/ grub-btrfs error)
May 21 15:03:24 user-asustuf grub-btrfsd[20150]: 894: detected timeshift shutdown
May 21 15:03:24 user-asustuf grub-btrfsd[20154]: Watching /run/timeshift for timeshift to start

I note the ‘grub2’ there which could be was it SUSE or Fedora?

sudo grub-mkconfig -o /boot/grub/grub.cfg                                                                                    ✔ 
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-6.9-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.9-x86_64.img
Found initrd fallback image: /boot/initramfs-6.9-x86_64-fallback.img
Found linux image: /boot/vmlinuz-6.8-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.8-x86_64.img
Found initrd fallback image: /boot/initramfs-6.8-x86_64-fallback.img
Found linux image: /boot/vmlinuz-6.6-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.6-x86_64.img
Found initrd fallback image: /boot/initramfs-6.6-x86_64-fallback.img
Found linux image: /boot/vmlinuz-6.1-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.1-x86_64.img
Found initrd fallback image: /boot/initramfs-6.1-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Manjaro Linux on /dev/nvme1n1p3
Adding boot menu entry for UEFI Firmware Settings ...
done

These snapshots do exist? Sounds like an obvious one you just missed in your list.

If they do, why not see what’s changed. You could just mount the drive, and for a quick scan for example:

diff -qr /mnt/timeshift-btrfs/snapshots/BEFORE/@ /mnt/timeshift-btrfs/snapshots/AFTER/@

They do appear to exist in the directory:
/run/timeshift/13006/backup/timeshift-btrfs/snapshots/
where 13006 is a directory generated using the programs PID.

Your command gives:
diff: /mnt/timeshift-btrfs/snapshots/BEFORE/@: No such file or directory diff: /mnt/timeshift-btrfs/snapshots/AFTER/@: No such file or directory

You have to fill in the BEFORE and AFTER with your own snapshots, they look like: 2024-05-20_02-34-08.

BEFORE meant the snapshot you have before you installed this “grub-customizer”, and whatever you have for right after.

That’s only when you load the Timeshift GUI, but if that works for you.

I don’t recall exactly when I installed grub-customizer but I did notice that the snapshot after the update to Manjaro 24 recently (14th of May I think it was) was only 16kb, while all other snapshots were MBs or GBs in size. So I deleted all snapshots since & including that 16kb one and created a new one. They create OK in Timeshift.

The error no longer appeared when I ran

sudo systemctl status grub-btrfsd    

Searching this issue online I did notice there’s a line missing when I run:
sudo grub-mkconfig -o /boot/grub/grub.cfg.

The final line should say at least:
Detecting Snapshots ...
but it does not.

OK, following some other forum I just ran
sudo pacman -R grub-btrfs
sudo pacman -S grub
and then decided to do
sudo pacman -S grub-btrfs
sudo grub-mkconfig -o /boot/grub/grub.cfg
and now I have this:

Found Manjaro Linux on /dev/nvme1n1p3
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
Found snapshot: 2024-05-22 00:13:44 | timeshift-btrfs/snapshots/2024-05-22_00-13-44/@ | ondemand | {timeshift-autosnap} {created before upgrade} |
Found snapshot: 2024-05-21 23:19:20 | timeshift-btrfs/snapshots/2024-05-21_23-19-20/@ | ondemand | N/A                                           |
Found snapshot: 2024-05-14 16:10:44 | timeshift-btrfs/snapshots/2024-05-14_16-10-44/@ | ondemand | Pre-Gnome 46     

so I’m not sure but it might actually work. Just gotta reboot.

EDIT: Yes, it works now! Test loaded a snapshot too! :slight_smile:

I also noticed at some point the system said there was an error on line 14 of my fstab where I had simply added compress=zstd recently. This line 14 mounts my ‘Data’ drive and it had been mounting it so I don’t know if that was causing the problem but I removed that copmress and will take another look at doing that properly later.

@Molski thanks for having a go.

I had no idea what it changed so I figured why not check?

I did end up removing it, but my best guesses was in or missing /etc/grub.d/XX_snapshots-btrfs or the the initcpio hook.

But removing and installing grub-btrfs would have fixed that. Hey you fixed it.

Oh right that makes sense. It seemed an odd one, given I had already tried to reinstall grub-btrfs. What I hadn’t done was remove it first. Perhaps that gave it a chance to remove the settings and put clean shiny default settings back in place.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.