Update GRUB with snapshots on BTRFS

Hi - I am using Tumbleweed and BTRFS. I am manually creating snapshots with sudo btrfs subvolume snapshot.......(ie. not with snapper) but would like them to appear in the GRUB menu. When I create them manually this way, they dont appear in GRUB on reboot.

I tried installing grub-btrfs (GitHub - Antynea/grub-btrfs: Include btrfs snapshots at boot options. (Grub menu)) - but this didnt work.

I am using the default .snapshots folder to store them.

Any suggestions appreciated.

Thanks, Ali

Use snapper. Any reason you do not do it?

I am writing some custom scripts and wanted to use btrfs commands directly.

You need to manage configs, e.g:

erlangen:~ # cat /.snapshots/4417/grub-snapshot.cfg 

  if [ -f "/.snapshots/4417/snapshot/boot/grub2/grub.cfg" ]; then
    snapshot_found=true
    saved_subvol=$btrfs_subvol
    menuentry  " openSUSE Tumbleweed  (6.14.5-1,2025-05-12T09:00,pre,zypp(zypper))" "/.snapshots/4417/snapshot" "/@/.snapshots/4417/snapshot" {
        btrfs_subvol="$3"
        extra_cmdline="rootflags=subvol=$3"
        export extra_cmdline
        snapshot_num=4417
        export snapshot_num
        configfile "$2/boot/grub2/grub.cfg"
        btrfs_subvol=$saved_subvol
      }
  fi

erlangen:~ # 
1 Like

Thanks @karlmistelberger - I’ll have a go with this over the next few days

When I regenerate the GRUB menu entries with:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

I get:

grub-mkconfig_lib couldn't be found

Find out what script prints this error. You are apparently using some third party software and we have no idea what it does.

hi @accroyus

What you’re attempting is challenging but feasible, provided you set things up properly.

Currently, your OS offers two distinct methods for creating snapshots:

sudo snapper create --description

btrfs subvolume snapshot

Snapper creates snapshots with a standardized structure that the system expects.
btrfs subvolume snapshot, on the other hand, generates “bare” snapshots—no metadata or structure for automatic integration.
GRUB will not recognize these snapshots because they don’t follow the required structure.

It is technically possible to achieve this manually, but you’ll likely need to consult the btrfs manual to understand the necessary configurations.

After investigating it all, it does look challenging than I originally thought. I think I’ll use snapper for creating the snapshots as mentioned. Thanks for all your help though.

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