In the default layout, when you restore @, you need to move snapshots from old to the new @.
# mv /mnt/@old/.snapshots /mnt/@/.
So yes, it’s inside @.
But not in my case, it’s a separated subvolume.
In the default layout, when you restore @, you need to move snapshots from old to the new @.
# mv /mnt/@old/.snapshots /mnt/@/.
So yes, it’s inside @.
But not in my case, it’s a separated subvolume.
Honestly i don’t know what I have to do because i’m not understanding what is different unless i see both and what do i have to change and why?
Every time I think I understood BTRFS, I’m proved to be wrong and that there is a lot to learn…
So, I’ll just follow the community suggestions for now, unfortunately I don’t know how you installed your setup this time, but based on the subvolume list you posted above, it seems that you are using snapper-rollback.
I thought i had it the same as you did it. But if you changed your set up I don’t know. I do have snapper roll back installed. Ive never used it so I really have little knowledge of how it works. Installing it was as far as i got.
[ricklinux@eos-kde ~]$ sudo btrfs subvolume list /
[sudo] password for ricklinux:
ID 256 gen 163 top level 5 path @2021-10-22T01:24
you used at least once as per above
Oct 22
To restore, just type sudo snapper-rollback 32
That would restore to snapshot number 32
I probably tried it once to make sure it worked. But really unless you sue this stuff more often then it becomes something i have go over again. I don’t even see a 32?
32 was an example, you can choose any snapshots you have there.
You can try now, just create a folder in / (sudo mkdir /test_folder)
then restore the last snapshot you have and reboot…
Any updates you did will also be gone and you will need to update again.
Why do you need to do this?
Its easier to spot if it worked or not, just check if the folder will be there after the restore/reboot
Edit: I’ll eat something, be back in one hour
Okay… now it’s coming back. But i have already installed this new package. But have no idea what i need to do to make sure it’s set up properly. It’s installed.
I thought @dalto would walk me through it.
Edit: Maybe he’s busy. I’ll just put it off for now.
@anon49550872
It isn’t working anyway so i must not have done something right when i reinstalled it or somethings changed.
[ricklinux@eos-kde ~]$ sudo snapper-rollback 424
[sudo] password for ricklinux:
Are you SURE you want to rollback? Type 'CONFIRM' to continue: CONFIRM
mount: /btrfsroot: can't find in /etc/fstab.
Traceback (most recent call last):
File "/usr/bin/snapper-rollback", line 170, in <module>
main()
File "/usr/bin/snapper-rollback", line 156, in main
mount_subvol_id5(mountpoint, source=dev, dry_run=args.dry_run)
File "/usr/bin/snapper-rollback", line 86, in mount_subvol_id5
raise OSError("unable to mount {}".format(target))
OSError: unable to mount /btrfsroot
[ricklinux@eos-kde ~]$
Edit /etc/snapper-rollback.conf and put this in the end:
dev = /dev/sda2
Important note here, in the example above /dev/sda2 is /
You can check if /dev/sda2 is the correct by:
mount | grep btrfs
$ mount | grep btrfs
/dev/sda2 on / type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,autodefrag,subvolid=256,subvol=/@)
/dev/sda2 on /.snapshots type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,autodefrag,subvolid=260,subvol=/@snapshots)
/dev/sda2 on /home type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,autodefrag,subvolid=257,subvol=/@home)
/dev/sda2 on /var/cache type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,autodefrag,subvolid=258,subvol=/@cache)
/dev/sda2 on /var/log type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,autodefrag,subvolid=259,subvol=/@log)
Edit: Once you restore the system just after changing the file /etc/snapper-rollback.conf, it will return to the default state, so it will erase the changes you did dev = /dev/sda2
I’m not sure why it’s not working?
Show me the contents of: /etc/snapper-rollback.conf
Note the last line
$ cat /etc/snapper-rollback.conf
# Rollback to snapper snapshot
#
# Requires a flat subvolume layout like specified here:
# https://wiki.archlinux.org/index.php/Snapper#Suggested_filesystem_layout
#
# Run with snapshot number as an argument like "snapper-rollback 642"
# This can be run either from your installed system or from a live arch ISO if
# you adjust the variables accordingly
[root]
# Name of your root subvolume
subvol_main = @
# Name of your snapper snapshot subvolume
subvol_snapshots = @snapshots
# If you haven't already mounted it there yourself, your btrfs partition with
# subvolid=5 will automatically be mounted to this mountpoint
mountpoint = /btrfsroot
# if btrfs subvol id 5 isn't mounted, then mount this device to `mountpoint`
# directory. This setting is optional, but if unset, you'll have to mount the
# partition manually!
dev = /dev/sda2
I just tried it on my computer that has nvidia card in it and it worked but i recently reinstalled this one so i must have missed something. Like i say i struggle just to understand this Btrfs setup. There are so many different ways of doing things.
I think i found it.
[ricklinux@eos-kde ~]$ cat /etc/snapper-rollback.conf
# Rollback to snapper snapshot
#
# Requires a flat subvolume layout like specified here:
# https://wiki.archlinux.org/index.php/Snapper#Suggested_filesystem_layout
#
# Run with snapshot number as an argument like "snapper-rollback 642"
# This can be run either from your installed system or from a live arch ISO if
# you adjust the variables accordingly
[root]
# Name of your root subvolume
subvol_main = @
# Name of your snapper snapshot subvolume
subvol_snapshots = @snapshots
# If you haven't already mounted it there yourself, your btrfs partition with
# subvolid=5 will automatically be mounted to this mountpoint
mountpoint = /btrfsroot
# if btrfs subvol id 5 isn't mounted, then mount this device to `mountpoint`
# directory. This setting is optional, but if unset, you'll have to mount the
# partition manually!
#dev = /dev/sda42
[ricklinux@eos-kde ~]$
Snapper-rollback will only work if you change the default layout as mentioned above.
But by doing this, according to Dalto, you won’t be able to use his new app that seems to be pretty cool.
This file, you just need to add the correct /dev/sda# drive to the end of it, just I showed in mine.
Mine here is /dev/sda2, yours may be different, so be careful to check before what is the correct one, also as showed above, by typing mount | grep btrfs
Okay i forgot to add the drive. But anyway I’m not sure what you mean change the default layout. My understanding is that we add the items in Clamares so it creates the fstab entries. Then you remove the subvolumes and recreate them for whatever reason?
Edit: Appreciate the help by the way!
Honestly i like this setup as it is easy to use to roll back. I just thought i would help @dalto test his gui tool because i do have this setup already but i can’t do it without help, instructions and understanding what i’m doing and why so i understand how it works.