ZFS Can't destroy zfs dataset "dataset is busy"

I am trying to destroy ZFS dataset but I end up with
Code:
dataset is busy

Code:
root@backupbsd:/usr/home/anders # zfs list -o name -r zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases | grep recv- | xargs -n 1 zfs destroy -rfv
will destroy zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root
cannot destroy 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root': dataset is busy
will destroy zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root
cannot destroy 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root': dataset is busy
will destroy zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root
cannot destroy 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root': dataset is busy

And also does anyone know why the dataset get named "recv-somenr" ? All the datasets are replicated from another server for backup.
 
Those should be temporary datasets that are created during the receive process, that get renamed to the correct snapshot once the receive is complete, and should never be visible. Unless a receive process was interrupted ... in which case, the system should be clearing them automatically in the background. You may want to disable the sending process for a day or two to allow the receiving pool time to clear out all these temp snapshots. And then figure out why your sending process is getting interrupted all the time, and fix that.
 
I disconnected the server to stop the sending but I still can't delete the datasets. Is there a lock on the partly sent datasets? I see some of them are old, and I have 769 of them total.
 
here is the mount points
Code:
root@backupbsd:/usr/home/anders # zfs list -o name -r zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases | grep recv- | xargs -n 1 zfs get mountpoint
NAME  PROPERTY  VALUE  SOURCE
zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases  mountpoint  /zfsbackup/bsdserver/oceanpool/iocage/releases  local
NAME  PROPERTY  VALUE  SOURCE
zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE  mountpoint  /zfsbackup/bsdserver/oceanpool/iocage/releases/10.2-RELEASE  inherited from zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases
NAME  PROPERTY  VALUE  SOURCE
zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root  mountpoint  /zfsbackup/bsdserver/oceanpool/iocage/releases/10.2-RELEASE/root  inherited from zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases

also tried unmounting it
Code:
root@backupbsd:/usr/home/anders # zfs list -o name -r zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases | grep recv- | xargs -n 1 zfs unmount
cannot unmount 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases': not currently mounted
cannot unmount 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE': not currently mounted
cannot unmount 'zroot/zfsbackup/bsdserver/oceanpool/recv-48595-2/releases/10.2-RELEASE/root': not currently mounted
 
What's the output of zfs holds for each of those snapshots? If there are any holds, can you zfs release them?
 
Back
Top