snapper not working

Did a new (clean) install of Tumbleweed on one of my systems a couple of days ago.
I’ve just noticed that snapper is not working.
When I boot there is no option in grub to boot from a snapshot . . .
So took a look in yast/snapper it is completely empty of snapshots.
When I try to create a snapshot I get the error . . .

Failed to create new snapshot:
.snapshots is not a btrfs subvolume; caused by 3 sender=:1.62 -> dest=:1.63 serial=28 reply_serial=21 path=; interface=; member= error_name=error.io_error

this is my /etc/fstab


UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /                       btrfs  defaults                      0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /var                    btrfs  subvol=/@/var                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /usr/local              btrfs  subvol=/@/usr/local           0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /tmp                    btrfs  subvol=/@/tmp                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /srv                    btrfs  subvol=/@/srv                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /root                   btrfs  subvol=/@/root                0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /opt                    btrfs  subvol=/@/opt                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /home                   btrfs  subvol=/@/home                0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
UUID=8ea5af04-ab10-4476-9148-ff20e95e88fe  swap                    swap   defaults                      0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /.snapshots             btrfs  subvol=/@/.snapshots          0  0

does anyone know what’s going on here?

Please show


cat /etc/fstab
sudo snapper --list-configs

cat /etc/fstab
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /                       btrfs  defaults                      0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /var                    btrfs  subvol=/@/var                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /usr/local              btrfs  subvol=/@/usr/local           0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /tmp                    btrfs  subvol=/@/tmp                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /srv                    btrfs  subvol=/@/srv                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /root                   btrfs  subvol=/@/root                0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /opt                    btrfs  subvol=/@/opt                 0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /home                   btrfs  subvol=/@/home                0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
UUID=8ea5af04-ab10-4476-9148-ff20e95e88fe  swap                    swap   defaults                      0  0
UUID=476f6a52-2faf-4aa4-913f-c1c35ecf85f2  /.snapshots             btrfs  subvol=/@/.snapshots          0  0

sudo snapper --list-configs
[sudo] password for root: 
Unknown global option '--list-configs'.
Try 'snapper --help' for more information.

tried this instead . . .


sudo snapper list-configs
[sudo] password for root: 

Config | Subvolume
-------+----------
root   | /        

if it is of any help . . . this is my /etc/snapper/configs/root

# subvolume to snapshot
SUBVOLUME="/"


# filesystem type
FSTYPE="btrfs"




# btrfs qgroup for space aware cleanup algorithms
QGROUP="1/0"




# fraction of the filesystems space the snapshots may use
SPACE_LIMIT="0.5"


# fraction of the filesystems space that should be free
FREE_LIMIT="0.2"




# users and groups allowed to work with config
ALLOW_USERS=""
ALLOW_GROUPS=""


# sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots
# directory
SYNC_ACL="no"




# start comparing pre- and post-snapshot in background after creating
# post-snapshot
BACKGROUND_COMPARISON="yes"




# run daily number cleanup
NUMBER_CLEANUP="yes"


# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="2-10"
NUMBER_LIMIT_IMPORTANT="4-10"




# create hourly snapshots
TIMELINE_CREATE="no"


# 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_WEEKLY="0"
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"



Eh, did you do anything ( ‘zypper dup’, 'zypper install … ’ ) to generate a snapshot? What does


cat /etc/osrelease

give?

Latest released TW snapshot is 20200407, do you already have that?

EDIT: is /.snapshots empty as well ?

cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20200407"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20200407"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20200407"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
LOGO="distributor-logo"



so . . . it seems to be somehow connected to a change I made in bios (but I have no idea how).

I had been receiving a message on boot related to vmx being disabled.
You can see in this thread
https://forums.opensuse.org/showthread.php/539823-vmx-disabled-by-bios

So what I have noticed now, and can repeat every single time.
If I go back into bios and turn off virtualisation
then boot
my snapshots are back.
If I then reboot again the snapshots are gone.

Go back into bios and turn virtualisation on again
boot
snapshots are back
reboot and they are gone again.
The only way I can get them back is to toggle the virtualisation setting in bios and even then it will only stick for one boot.

This has me baffled.
As it is a new clean install I might just start again without messing with the bios

There’s a bug where some file systems are being unmounted inappropriately. And this can happen to “btrfs” subvolumes.

This is probably what is happening in your system. Maybe look for threads on this unmounting.

Maybe try this thread:

https://forums.opensuse.org/showthread.php/539125-TW-after-update-to-20200211-My-user-hard-drive-partitions-do-not-get-mounted-at-boot-any-longer

yes indeed, this is exactly my problem.
I’ve done a new install of tumbleweed but issue is still present.

I’m completely lost in that thread as to exactly what the fix is . . . .???

This seems like the easiest . . .

# systemctl disable --now btrfsmaintenance-refresh.service

but what are the ramifications?

and this seems to be the recommended

Short answer: Use all the default units; apply the fix: Annoyances Due to Early Start of btrfsmaintenance-refresh.path · Issue #78 · kdave/btrfsmaintenance · GitHub

but I’m gonna need more of a step by step on how to achieve that.

Try this: https://forums.opensuse.org/showthread.php/539503-boot-efi-is-not-mounted?p=2930487#post2930487

journalctl -b -u btrfs* 
-- Logs begin at Fri 2020-04-10 18:01:11 NZST, end at Fri 2020-04-10 20:09:25 NZST. --
Apr 10 20:07:42 localhost systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
Apr 10 20:07:42 localhost systemd[1]: Starting Update cron periods from /etc/sysconfig/btrfsmaintena>
Apr 10 20:07:42 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh script btrfs-scrub.sh for u>
Apr 10 20:07:42 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh script btrfs-defrag.sh for >
Apr 10 20:07:42 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh script btrfs-balance.sh for>
Apr 10 20:07:42 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh script btrfs-trim.sh for un>
Apr 10 20:07:42 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh timer btrfs-scrub for month>
Apr 10 20:07:46 localhost systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
Apr 10 20:07:46 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh timer btrfs-defrag for none
Apr 10 20:07:47 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh timer btrfs-balance for wee>
Apr 10 20:07:48 localhost systemd[1]: Started Balance block groups on a btrfs filesystem.
Apr 10 20:07:48 localhost btrfsmaintenance-refresh-cron.sh[551]: Refresh timer btrfs-trim for none
Apr 10 20:07:49 localhost systemd[1]: btrfsmaintenance-refresh.service: Succeeded.
Apr 10 20:07:49 localhost systemd[1]: Started Update cron periods from /etc/sysconfig/btrfsmaintenan>
lines 1-15/15 (END)

systemctl cat btrfsmaintenance-refresh.path
# /usr/lib/systemd/system/btrfsmaintenance-refresh.path
[Unit]
Description=Watch /etc/sysconfig/btrfsmaintenance


[Path]
PathChanged=/etc/sysconfig/btrfsmaintenance


[Install]
WantedBy=multi-user.target



/etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf
bash: /etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf: No such file or directory


systemctl list-unit-files btrfs*
UNIT FILE                        STATE   
btrfsmaintenance-refresh.path    enabled 
btrfs-balance.service            static  
btrfs-defrag.service             static  
btrfs-scrub.service              static  
btrfs-trim.service               static  
btrfsmaintenance-refresh.service enabled 
btrfs-balance.timer              enabled 
btrfs-defrag.timer               disabled
btrfs-scrub.timer                enabled 
btrfs-trim.timer                 disabled


10 unit files listed.



You need to create this file on you machine:

erlangen:~ # cat /etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf
[Unit]
After=local-fs.target

erlangen:~ # 

Disable btrfsmaintenance-refresh.service and reboot. Check the logs:

erlangen:~ # systemctl list-unit-files btrfs*
UNIT FILE                        STATE   
btrfsmaintenance-refresh.path    enabled 
btrfs-balance.service            static  
btrfs-defrag.service             static  
btrfs-scrub.service              static  
btrfs-trim.service               static  
btrfsmaintenance-refresh.service disabled
btrfs-balance.timer              enabled 
btrfs-defrag.timer               enabled 
btrfs-scrub.timer                enabled 
btrfs-trim.timer                 disabled

10 unit files listed.
erlangen:~ # erlangen:~ # journalctl -b -u btrfs*
-- Logs begin at Sun 2020-03-29 16:41:11 CEST, end at Fri 2020-04-10 10:27:13 CEST. --
Apr 09 07:43:50 erlangen systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
Apr 09 07:43:59 erlangen systemd[1]: Started Balance block groups on a btrfs filesystem.
Apr 09 07:43:59 erlangen systemd[1]: Started Defragment file data and/or directory metadata.
Apr 09 07:43:59 erlangen systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
Apr 10 06:00:04 erlangen systemd[1]: Started Defragment file data on a mounted filesystem.
Apr 10 06:00:06 erlangen systemd[1]: btrfs-defrag.service: Succeeded.
erlangen:~ # 

how do I do that?
Copying your code I get

linux:/home/farcus # cat /etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf
cat: /etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf: No such file or directory

ok . . . so I just created the folder/file using dolphin in superuser mode

stopped btrfsmaintenance-refresh.service using

systemctl disable --now btrfsmaintenance-refresh.service

rebooted
logs now . . .

systemctl list-unit-files btrfs*
UNIT FILE                        STATE   
btrfsmaintenance-refresh.path    disabled
btrfs-balance.service            static  
btrfs-defrag.service             static  
btrfs-scrub.service              static  
btrfs-trim.service               static  
btrfsmaintenance-refresh.service disabled
btrfs-balance.timer              enabled 
btrfs-defrag.timer               disabled
btrfs-scrub.timer                enabled 
btrfs-trim.timer                 disabled


10 unit files listed.



journalctl -b -u btrfs*
-- Logs begin at Fri 2020-04-10 18:01:11 NZST, end at Fri 2020-04-10 21:11:26 NZST. --
Apr 10 21:09:51 localhost systemd[1]: Started Balance block groups on a btrfs filesystem.
Apr 10 21:09:51 localhost systemd[1]: Started Scrub btrfs filesystem, verify block checksums.



is this looking correct?

You may want to enable btrfsmaintenance-refresh.path and btrfs-scrub.timer. Reboot and check the logs to verify everything works as intended.

ok . . . I think things are looking correct now

systemctl list-unit-files btrfs*
UNIT FILE                        STATE   
btrfsmaintenance-refresh.path    enabled 
btrfs-balance.service            static  
btrfs-defrag.service             static  
btrfs-scrub.service              static  
btrfs-trim.service               static  
btrfsmaintenance-refresh.service disabled
btrfs-balance.timer              enabled 
btrfs-defrag.timer               enabled 
btrfs-scrub.timer                enabled 
btrfs-trim.timer                 disabled


10 unit files listed.



journalctl -b -u btrfs*
-- Logs begin at Fri 2020-04-10 18:01:11 NZST, end at Fri 2020-04-10 21:34:20 NZST. --
Apr 10 21:32:38 localhost systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
Apr 10 21:32:43 localhost systemd[1]: Started Balance block groups on a btrfs filesystem.
Apr 10 21:32:43 localhost systemd[1]: Started Defragment file data and/or directory metadata.
Apr 10 21:32:43 localhost systemd[1]: Started Scrub btrfs filesystem, verify block checksums.



so snapper remains fully automated with this fix?
I don’t need to do anything manually?

Presumably, once the bug is fixed I can just delete the override.conf and re-enable btrfsmaintenance-refresh.service?

Btrfs maintenance now works as described: btrfsmaintenance/README.md at master · kdave/btrfsmaintenance · GitHub

  • Depending on your file system you may want to adjust parameters as needed using Yast > Sysconfig Editor.
  • When fixed in package btrfsmaintenance you need to do nothing. You may delete override.conf. Don’t reenable btrfsmaintenance-refresh.service.