I’ve been playing around with this and I’ve found a solution that works for me. This will allow you to take snapshots of /root by itself. It also gives the the option to add /home, as well. I made this tutorial to be compatible with people that might have messed some stuff up.
Erase the configs in the /etc/snapper/configs folder:
rm /etc/snapper/configs/home
rm /etc/snapper/configs/root
rm /etc/snapper/configs/srv
...
Make sure your config template is setup properly:
nano /etc/snapper/config-templates/default
… Should look like this:
# subvolume to snapshot
SUBVOLUME="/"
# filesystem type
FSTYPE="btrfs"
# run daily number cleanup
NUMBER_CLEANUP="yes"
# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="100"
# create hourly snapshots
TIMELINE_CREATE="yes"
# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"
# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_MONTHLY="10"
TIMELINE_LIMIT_YEARLY="10"
# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"
# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"
Copy the default template to /etc/snapper/configs/ and make a new ‘root’ config:
cp /etc/snapper/config-templates/default /etc/snapper/configs/root
Edit snapper Global configuration file:
nano /etc/sysconfig/snapper
… and make sure the file looks like this:
## Path: System/Snapper
## Type: string
## Default: ""
# List of snapper configurations.
SNAPPER_CONFIGS="root"
Create a root config (This may come up with errors depending on if you’ve done this before just continue with the next command if this happens):
snapper -c root create-config /
snapper -c root create -d testroot
Open Yast and select ‘snapper’ which should be at the bottom of the list under miscellaneous
~~~ Adding /home directory if you’d like ~~~
If you want to add /home then:
Edit config:
nano /etc/sysconfig/snapper
… and make sure the file looks like this:
## Path: System/Snapper
## Type: string
## Default: ""
# List of snapper configurations.
SNAPPER_CONFIGS="root home"
Create home (This may come up with errors depending on if you’ve done this before just continue with the next command if this happens):
snapper -c home create-config /home
snapper -c home create -d testhome
Copy the default template to /etc/snapper/configs/ and make a new ‘home’ config:
cp /etc/snapper/config-templates/default /etc/snapper/configs/home
Edit the new ‘home’ config file:
nano /etc/snapper/configs/home
… and make sure to edit the top line to look like:
# subvolume to snapshot
SUBVOLUME="/home"
Edit config to add ‘home’:
nano /etc/sysconfig/snapper
… and make sure the file looks like this (note that ‘home’ was added):
## Path: System/Snapper
## Type: string
## Default: ""
# List of snapper configurations.
SNAPPER_CONFIGS="root home"
Open Yast and select ‘snapper’ which should be at the bottom of the list under miscellaneous
~~~ Some additional stuff ~~~
List snapshots
snapper -c home list
Create a new snapshot (with the name ‘newsnapshot’):
snapper -c home create -d newsnapshot
Delete a snapshot (in this case we’ll delete #3):
snapper -c home delete 3