Skip to content

Unable to destroy zfs snapshot - dataset is busy #17239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yusing opened this issue Apr 14, 2025 · 4 comments
Open

Unable to destroy zfs snapshot - dataset is busy #17239

yusing opened this issue Apr 14, 2025 · 4 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@yusing
Copy link

yusing commented Apr 14, 2025

System information

Type Version/Name
Distribution Name Proxmox
Distribution Version 8.4.1
Kernel Version 6.8.12-9-pve
Architecture x86_64
OpenZFS Version zfs-2.2.7-pve2, zfs-kmod-2.2.7-pve2

Describe the problem you're observing

cannot destroy snapshot <snapshot>: dataset is busy

Describe how to reproduce the problem

zfs destroy -vrf rpool/data/subvol-119-disk-0

Include any warning/errors/backtraces from the system logs

root@pve:~# zfs destroy rpool/data/subvol-119-disk-0@restic-20250406-030001
cannot destroy snapshot rpool/data/subvol-119-disk-0@restic-20250406-030001: dataset is busy

root@pve:~# zfs destroy -vrf rpool/data/subvol-119-disk-0
will destroy rpool/data/subvol-119-disk-0@restic-20250406-030001
will destroy rpool/data/subvol-119-disk-0@restic-20250409-030001
will destroy rpool/data/subvol-119-disk-0
cannot destroy snapshot rpool/data/subvol-119-disk-0@restic-20250406-030001: dataset is busy
cannot destroy snapshot rpool/data/subvol-119-disk-0@restic-20250409-030001: dataset is busy

root@pve:~# grep subvol-119-disk-0 /proc/*/mounts
# no output

root@pve:~# zfs list -t snapshot -o name,refer,mountpoint,used,creation rpool/data/subvol-119-disk-0
NAME                                                 REFER  MOUNTPOINT   USED  CREATION
rpool/data/subvol-119-disk-0@restic-20250406-030001   122G  -           2.03G  Sun Apr  6  3:00 2025
rpool/data/subvol-119-disk-0@restic-20250409-030001   123G  -           1.32G  Wed Apr  9  3:00 2025

root@pve:~# zfs list -r -o name,mountpoint,origin rpool/data/subvol-119-disk-0
NAME                          MOUNTPOINT  ORIGIN
rpool/data/subvol-119-disk-0  none

root@pve:~# zfs get all rpool/data/subvol-119-disk-0
NAME                          PROPERTY              VALUE                     SOURCE
rpool/data/subvol-119-disk-0  type                  filesystem                -
rpool/data/subvol-119-disk-0  creation              Sat Mar 16 10:49 2024     -
rpool/data/subvol-119-disk-0  used                  143G                      -
rpool/data/subvol-119-disk-0  available             414G                      -
rpool/data/subvol-119-disk-0  referenced            108G                      -
rpool/data/subvol-119-disk-0  compressratio         1.35x                     -
rpool/data/subvol-119-disk-0  mounted               no                        -
rpool/data/subvol-119-disk-0  quota                 none                      default
rpool/data/subvol-119-disk-0  reservation           none                      default
rpool/data/subvol-119-disk-0  recordsize            8K                        inherited from rpool
rpool/data/subvol-119-disk-0  mountpoint            none                      local
rpool/data/subvol-119-disk-0  sharenfs              off                       default
rpool/data/subvol-119-disk-0  checksum              on                        default
rpool/data/subvol-119-disk-0  compression           zstd                      inherited from rpool
rpool/data/subvol-119-disk-0  atime                 on                        inherited from rpool
rpool/data/subvol-119-disk-0  devices               on                        default
rpool/data/subvol-119-disk-0  exec                  on                        default
rpool/data/subvol-119-disk-0  setuid                on                        default
rpool/data/subvol-119-disk-0  readonly              off                       default
rpool/data/subvol-119-disk-0  zoned                 off                       default
rpool/data/subvol-119-disk-0  snapdir               hidden                    default
rpool/data/subvol-119-disk-0  aclmode               discard                   default
rpool/data/subvol-119-disk-0  aclinherit            restricted                default
rpool/data/subvol-119-disk-0  createtxg             168995                    -
rpool/data/subvol-119-disk-0  canmount              off                       local
rpool/data/subvol-119-disk-0  xattr                 sa                        local
rpool/data/subvol-119-disk-0  copies                1                         default
rpool/data/subvol-119-disk-0  version               5                         -
rpool/data/subvol-119-disk-0  utf8only              off                       -
rpool/data/subvol-119-disk-0  normalization         none                      -
rpool/data/subvol-119-disk-0  casesensitivity       sensitive                 -
rpool/data/subvol-119-disk-0  vscan                 off                       default
rpool/data/subvol-119-disk-0  nbmand                off                       default
rpool/data/subvol-119-disk-0  sharesmb              off                       default
rpool/data/subvol-119-disk-0  refquota              550G                      local
rpool/data/subvol-119-disk-0  refreservation        none                      default
rpool/data/subvol-119-disk-0  guid                  10459222805264121475      -
rpool/data/subvol-119-disk-0  primarycache          all                       default
rpool/data/subvol-119-disk-0  secondarycache        all                       default
rpool/data/subvol-119-disk-0  usedbysnapshots       35.1G                     -
rpool/data/subvol-119-disk-0  usedbydataset         108G                      -
rpool/data/subvol-119-disk-0  usedbychildren        0B                        -
rpool/data/subvol-119-disk-0  usedbyrefreservation  0B                        -
rpool/data/subvol-119-disk-0  logbias               throughput                inherited from rpool
rpool/data/subvol-119-disk-0  objsetid              150727                    -
rpool/data/subvol-119-disk-0  dedup                 off                       inherited from rpool
rpool/data/subvol-119-disk-0  mlslabel              none                      default
rpool/data/subvol-119-disk-0  sync                  disabled                  inherited from rpool/data
rpool/data/subvol-119-disk-0  dnodesize             legacy                    default
rpool/data/subvol-119-disk-0  refcompressratio      1.33x                     -
rpool/data/subvol-119-disk-0  written               18.4G                     -
rpool/data/subvol-119-disk-0  logicalused           168G                      -
rpool/data/subvol-119-disk-0  logicalreferenced     136G                      -
rpool/data/subvol-119-disk-0  volmode               default                   default
rpool/data/subvol-119-disk-0  filesystem_limit      none                      default
rpool/data/subvol-119-disk-0  snapshot_limit        none                      default
rpool/data/subvol-119-disk-0  filesystem_count      none                      default
rpool/data/subvol-119-disk-0  snapshot_count        none                      default
rpool/data/subvol-119-disk-0  snapdev               hidden                    default
rpool/data/subvol-119-disk-0  acltype               posix                     local
rpool/data/subvol-119-disk-0  context               none                      default
rpool/data/subvol-119-disk-0  fscontext             none                      default
rpool/data/subvol-119-disk-0  defcontext            none                      default
rpool/data/subvol-119-disk-0  rootcontext           none                      default
rpool/data/subvol-119-disk-0  relatime              on                        inherited from rpool
rpool/data/subvol-119-disk-0  redundant_metadata    all                       default
rpool/data/subvol-119-disk-0  overlay               on                        default
rpool/data/subvol-119-disk-0  encryption            off                       default
rpool/data/subvol-119-disk-0  keylocation           none                      default
rpool/data/subvol-119-disk-0  keyformat             none                      default
rpool/data/subvol-119-disk-0  pbkdf2iters           0                         default
rpool/data/subvol-119-disk-0  special_small_blocks  0                         default
rpool/data/subvol-119-disk-0  snapshots_changed     Mon Apr 14 11:35:27 2025  -
rpool/data/subvol-119-disk-0  prefetch              all                       default
@yusing yusing added the Type: Defect Incorrect behavior (e.g. crash, hang) label Apr 14, 2025
@filip-paczynski
Copy link

perhaps there is a bookmark holding these snapshots:

cannot destroy snapshot rpool/data/subvol-119-disk-0@restic-20250406-030001: dataset is busy
cannot destroy snapshot rpool/data/subvol-119-disk-0@restic-20250409-030001: dataset is busy

@amotin
Copy link
Member

amotin commented Apr 14, 2025

@filip-paczynski Bookmarks exist explicitly to allow snapshot deletion.

@yusing But something is indeed holding it. Have you looked towards zfs holds ... ?

@yusing
Copy link
Author

yusing commented Apr 14, 2025

Yes, forgot to list it. If have looked into zfs hold on both snapshots and found out nothing was holding them.

Btw, I fixed it with a reboot.

@filip-paczynski
Copy link

@filip-paczynski Bookmarks exist explicitly to allow snapshot deletion.

@yusing But something is indeed holding it. Have you looked towards zfs holds ... ?

Yes, you're right, I was thinking about holds - run into something similar with zrepl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

3 participants