Antynea / grub-btrfs

Include btrfs snapshots at boot options. (Grub menu)
GNU General Public License v3.0
775 stars 77 forks source link

Help: No snapshot found, but there's snapshots #350

Closed Kayxue closed 2 weeks ago

Kayxue commented 2 months ago

CleanShot 2024-09-06 at 23 25 13@2x But I have already checked /.snapshots folder: CleanShot 2024-09-06 at 23 24 47@2x How to solve the problem? I have already tried my best to found any related issue or discussion, but I think I found no issue and no Discussions can help me to solve this systemctl edit --full grub-btrfsd: CleanShot 2024-09-06 at 23 34 29@2x

System: Arch Linux ARM DE: Hyprland Now all snapshots in /.snapshots are generated by snapper.

atchley-sha commented 2 months ago

I'm having a similar issue. #100 is the only thing I could find that's relevant, but that seems like it was resolved and is somewhat out-of-date now (from what I can tell there was a more long-term fix for #100 that got incorporated later). The snapshots appear in /.snapshots/ but grub-btrfs doesn't detect them. All my snapshots are generated by snapper as well.

System: EndeavourOS DE: KDEPlasma

atchley-sha commented 2 months ago

I wonder if it has anything to do with the ${prefix}/grub-btrfs.cfg file's existence (or lack thereof). As far as I can tell, prefix gets set to /usr, and at least on my system there's no grub-btrfs.cfg file in /usr (or I think anywhere else). But maybe prefix gets set to something different somewhere else and I missed it, or maybe grub-btrfs.cfg isn't important, or maybe there's something else entirely. I'm not especially knowledgeable about this type of thing, so I could be way off. I wouldn't know how to fix any of this though, even if it was the case.

bkmo commented 1 month ago

Most problems are fixed by installing grub-btrfs-git from the AUR.

atchley-sha commented 1 month ago

Most problems are fixed by installing grub-btrfs-git from the AUR.

I just tried this, and it didn't work either, same exact issue

Schievel1 commented 1 month ago

If you run btrfs subvolume list -sa / does it list the snapshots?

atchley-sha commented 1 month ago

If you run btrfs subvolume list -sa / does it list the snapshots?

Yep, it shows a lot of snapshots, here are the first few for reference:

ID 837 gen 385451 cgen 335946 top level 5 otime 2024-06-05 07:57:10 path <FS_TREE>/timeshift-btrfs/snapshots/2024-06-05_07-57-10/@
ID 839 gen 414992 cgen 336061 top level 5 otime 2024-06-12 21:38:30 path <FS_TREE>/@
ID 872 gen 385623 cgen 385623 top level 871 otime 2024-09-07 12:53:46 path <FS_TREE>/@/.snapshots/1/snapshot
ID 875 gen 385636 cgen 385636 top level 871 otime 2024-09-07 13:00:00 path <FS_TREE>/@/.snapshots/4/snapshot
ID 918 gen 387045 cgen 387045 top level 871 otime 2024-09-09 00:00:00 path <FS_TREE>/@/.snapshots/47/snapshot
ID 1176 gen 395024 cgen 395024 top level 871 otime 2024-09-16 13:00:00 path <FS_TREE>/@/.snapshots/305/snapshot
ID 1472 gen 403865 cgen 403865 top level 871 otime 2024-09-23 08:00:00 path <FS_TREE>/@/.snapshots/601/snapshot
ID 1611 gen 407531 cgen 407530 top level 871 otime 2024-09-30 10:00:00 path <FS_TREE>/@/.snapshots/740/snapshot
atchley-sha commented 1 month ago

I was playing around with some things (not all related to this) and borked my computer to where it's having trouble booting at all. I've tried a couple fixes and have an interesting update. grub-btrfs now detects (I think the most recent) 5 or so snapshots (out of ~100 or so), and I'm able to boot to these. I'm still not able to boot normally, but I don't think that's related to grub-btrfs. I'll keep trying to fix my boot issue, but maybe something happened to where grub-btrfs works now? I'm not exactly sure, but I'll give an update in a few days.

atchley-sha commented 1 month ago

Well, I didn't have much luck trying to fix my boot issue, so I ended up reinstalling the OS. Now this package works though! I know that's not an especially helpful solution, but it worked in my case.

Schievel1 commented 1 month ago

If you run the command I suggested above now, is the output formatted differently?

I still have the feeling this is related to different versions of btrfs-progs with different output formats. The output from the command above is parsed by grub-btrfs to get a list of snapshots. It then mangles this list into a grub submenu.

atchley-sha commented 1 month ago

If you run the command I suggested above now, is the output formatted differently?

I still have the feeling this is related to different versions of btrfs-progs with different output formats. The output from the command above is parsed by grub-btrfs to get a list of snapshots. It then mangles this list into a grub submenu.

It looks basically the same, though the "top level 5" snapshots (the two that end in just @) aren't in the list now (again just the first few; there are about 40 but they all follow this pattern):

ID 263 gen 144 cgen 143 top level 262 otime 2024-10-21 11:20:32 path <FS_TREE>/@/.snapshots/1/snapshot
ID 264 gen 145 cgen 144 top level 262 otime 2024-10-21 11:20:45 path <FS_TREE>/@/.snapshots/2/snapshot
ID 265 gen 149 cgen 148 top level 262 otime 2024-10-21 11:23:22 path <FS_TREE>/@/.snapshots/3/snapshot
ID 266 gen 150 cgen 149 top level 262 otime 2024-10-21 11:23:28 path <FS_TREE>/@/.snapshots/4/snapshot
ID 267 gen 158 cgen 157 top level 262 otime 2024-10-21 11:28:31 path <FS_TREE>/@/.snapshots/5/snapshot
ID 268 gen 159 cgen 158 top level 262 otime 2024-10-21 11:28:31 path <FS_TREE>/@/.snapshots/6/snapshot