Antynea / grub-btrfs

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

Can't recover snapshots from grub #320

Closed Guthauser closed 3 months ago

Guthauser commented 4 months ago

Me and my friend are using Parrot OS 6.0 and aren't able to recover snapshots from grub. The snapshots are visible and I can select them to boot from them. If I do so it seems to recover something, says

Loading Snapshot: 'name of snapshot'

But afterwards evrithing is as it was before "restoring"

We're using Timeshift to create snapshots.

Schievel1 commented 4 months ago

you can't 'restore' snapshots using grub-btrfs. You can only boot into them and look around. Depending on how it's setup you can also alter the snapshots state.

So after rebooting and booting your normal kernel entry without going to the snapshots menu in grub, everything will be back to normal. Snapshots can be restored manually (by moving the files of the snapshot to the directory tree that is normally given as the subvol to the kernel in grub) or by a different program. (e.g. timeshift).

So when you boot into the snapshot, is everything still at the last state not at the snapshot state?

HanM23 commented 4 months ago

you can't 'restore' snapshots using grub-btrfs. You can only boot into them and look around. Depending on how it's setup you can also alter the snapshots state.

So after rebooting and booting your normal kernel entry without going to the snapshots menu in grub, everything will be back to normal. Snapshots can be restored manually (by moving the files of the snapshot to the directory tree that is normally given as the subvol to the kernel in grub) or by a different program. (e.g. timeshift).

So when you boot into the snapshot, is everything still at the last state not at the snapshot state?

Hello @Schievel1, could please tell me a little bit more precisely how to restore properly a snapshot that has been made with Timeshift ? Indeed, i am reading the old github from teejee2008 and there is this issue written by you : https://github.com/teejee2008/timeshift/issues/826

I have exactly the same issue when i restore a snapshot, i mean, in the file /boot/grub/grub.cfg indead of having linux /@/boot/vmlinuz-6.6-x86_64.... etc... in the menuentry, i have something like this : linux /timeshift-btrfs/snapshots/2024-03-04_17-05-45/@/boot/vmlinuz.... etc...

This is indeed annoying as you told it in your old issue:

Until now, the solution i have found as a workaround is the following :

Please, could you tell me the steps how you do it with mv (or something else), what do you copy and where ? Say, my main subvolume is broken after an update and i could boot into a snapshot taken before, what am i supposed to do ?

Thank you alot

Schievel1 commented 4 months ago

Hello @Schievel1, could please tell me a little bit more precisely how to restore properly a snapshot that has been made with Timeshift ? Indeed, i am reading the old github from teejee2008 and there is this issue written by you : https://github.com/teejee2008/timeshift/issues/826

Honestly, I have no idea if that has ever been fixed or not. I don't trust timeshift anymore when recovering snapshots after I had a related issue that was even more severe: When timeshift restores that snapshot it just sets this in your grubs kernel command line: subvol=/timeshift-btrfs/snapshots/yoursnapshot. That's it. If you have activated auto clean up in timeshift, it will delete that snapshot after a some time. While you are booted into this snapshot! This is just a mess, you keep booting a snapshot that is your HEAD so to speak but it keeps having an older date as it's name and whatnot.

What I do is I have the rule that normally I boot @. @ is the 'HEAD' and if something in my system changes, it is the snapshot at @ that changes. If I want to restore a snapshot I move it from its location (in /timeshift-btrfs/etc...) to @ using a live cd. I can look into those snapshots when timeshift is opened. (It then mounts the snapshot directory in /run/timeshift...) I only have to use grub-btrfs when my PC isn't booting anymore.

Another way of doing it is by using btrfs' own commands: https://unix.stackexchange.com/questions/19211/how-to-create-a-snapshot-in-btrfs-and-then-rollback-to-it-after-some-work But I tend to stick to the simplest things possible, with is basically moving files around.