SpiralLinux / SpiralLinux-project

SpiralLinux project
https://spirallinux.github.io/
142 stars 5 forks source link

Snapper cant setup default * snapshot #453

Closed chriztheanvill closed 1 month ago

chriztheanvill commented 1 month ago

Hi Just installed Spiral, love it, but testing snapper, cant setup a default snapshot *

For example, in fedora:

snapper ls -a                                                                                                              
Config: home, subvolume: /home
 # | Type   | Pre # | Date                            | User | Cleanup | Description | Userdata
---+--------+-------+---------------------------------+------+---------+-------------+---------
0  | single |       |                                 | root |         | current     |         
1  | single |       | Wed 24 Jul 2024 04:32:23 AM CST | root |         | StartHome   |         

Config: root, subvolume: /
 # | Type   | Pre # | Date                            | User | Cleanup | Description          | Userdata
---+--------+-------+---------------------------------+------+---------+----------------------+---------
0  | single |       |                                 | root |         | current              |         
1* | single |       | Wed 24 Jul 2024 04:31:37 AM CST | root |         | first root subvolume |         
2  | single |       | Wed 24 Jul 2024 06:27:18 AM CST | root |         | Done                 |         
3  | pre    |       | Wed 24 Jul 2024 02:12:31 PM CST | root | number  | /usr/bin/dnf upgrade |         
4  | post   |     3 | Wed 24 Jul 2024 02:12:40 PM CST | root | number  | /usr/bin/dnf upgrade | 

The snapshot 1 for root, is default and current, and in Spiral, only shows + instead of *

Is there a way to fix it ? Really love the distro.

geckolinux commented 1 month ago

Hi there, glad you like SpiralLinux, thanks for saying so.

Sorry I don't quite understand what you're trying to accomplish. The system will always use the current snapshot 0 , and the only time you would change it is if you need to rollback the system, which can be accomplished with these instructions: https://github.com/SpiralLinux/SpiralLinux-project/wiki#working-with-btrfs-snapshots-and-rollbacks

chriztheanvill commented 1 month ago

Thanks I read it, but after making a rollback 35, 0 will still be the current snapshot ?

Sorry I am starting with btrfs + snapper. I tried with openSUSE TW and fedora, and both can setup a default current snapshot (*), normally is 1:

 # | Type   | Pre # | Date                            | User | Cleanup | Description          | Userdata
---+--------+-------+---------------------------------+------+---------+----------------------+---------
0  | single |       |                                 | root |         | current              |         
1* | single |       | Wed 24 Jul 2024 09:11:53 PM CST | root |         | first root subvolume |         |         

And if you do a rollback to 35, 35 is the new default current:


 # | Type   | Pre # | Date                            | User | Cleanup | Description          | Userdata
---+--------+-------+---------------------------------+------+---------+----------------------+---------
0  | single |       |                                 | root |         | current              |         
...
35* | single |       | Wed 24 Jul 2024 09:11:53 PM CST | root |         | first root subvolume |         |         
...
geckolinux commented 1 month ago

SpiralLinux uses the snapper-rollback script from https://github.com/jrabinow/snapper-rollback , which does not work the same as the snapper rollback command, and it requires a different subvolume layout. You can read about the differences and find more links to read about it here: https://github.com/jrabinow/snapper-rollback/issues/16