Skip to content

automounted zsys system snapshots prevent deletion #247

@aieri

Description

@aieri

Describe the bug
After upgrading to Lunar, I noticed the garbage collector being unable to clean up old states due to the dataset is busy error.

Somehow new states snapshots get automatically mounted under /root/.zfs/snapshot, so the garbage collector cannot do its job until I manually umount them. I don't believe this was the case in Kinetic.

Quick workaround:

$ awk '/autozsys/ {print "sudo umount "$1}' /proc/mounts
$ # if happy, pipe the above to sh
$ zsysctl service gc -v

To Reproduce

root@laptop:~# zsysctl state save -s
ZSys is adding automatic system snapshot to GRUB menu
Successfully saved as "autozsys_felpum"
root@laptop:~# zsysctl state remove -s felpum
ERROR couldn't remove system state felpum: Couldn't remove state rpool/ROOT/ubuntu_y3atsu@autozsys_felpum: Couldn't destroy rpool/ROOT/ubuntu_y3atsu@autozsys_felpum: couldn't destroy "rpool/ROOT/ubuntu_y3atsu@autozsys_felpum" and its children: cannot destroy dataset "rpool/ROOT/ubuntu_y3atsu@autozsys_felpum": dataset is busy 
root@laptop:~# mount | grep felpum
rpool/ROOT/ubuntu_y3atsu@autozsys_felpum on /root/.zfs/snapshot/autozsys_felpum type zfs (ro,relatime,xattr,posixacl)
root@laptop:~# umount rpool/ROOT/ubuntu_y3atsu@autozsys_felpum
root@laptop:~# zsysctl state remove -s felpum
ZSys is adding automatic system snapshot to GRUB menu

Installed versions:

  • OS: 23.04 (Lunar Lobster)
  • Zsysd running version:
zsysctl	0.5.9
zsysd	0.5.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions