Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2014 09:24:10 -0500
From:      dweimer <dweimer@dweimer.net>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   ZFS can't destroy snapshot, dataset busy
Message-ID:  <5fe3d5f142b1646768b3528206e6dd36@dweimer.net>

next in thread | raw e-mail | index | archive | help
I have a server running on ZFS, with multiple jails.  I use bacula to 
back it up, and have written a python script that finds all my ZFS 
datasets (except those I have listed to ignore) and creates snapshots, 
then mounts those snapshots to a temporary file structure, using mount 
-t nullfs /zfs-mountpoint/.zfs/snapshot/snapshotname /mnt/backup/...  I 
then backup the data from the snapshots, and kick off a second script 
that dismounts the nullfs mounted snapshots and destroys them.  I have 
the same script running on multiple servers without jails and everything 
works great.

However on this server that is running 4 jails, (base OS is FreeBSD 
10-RELEASE-p1, as of last night) the root file system in the jails is 
frequently holding the snapshots as busy so they fail to destroy, which 
then breaks the backups for that jail until resolved.

The only resolution I have found do an unmount -f 
/zfs-mountpoint/.zfs/snapshot/snapshotname and then I am able to destroy 
the snapshot.  The nullfs mounts are gone, but I haven't been able to 
find what process is holding onto the snapshot file system.

Before I edit my script to add this step in prior to destroying the 
snapshots, does anybody have any ideas on how to find out whats keeping 
these file systems busy?

I have already tried restarting the jail using jail -r and jail -c it 
doesn't help, its something in the base Operating System

-- 
Thanks,
    Dean E. Weimer
    http://www.dweimer.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5fe3d5f142b1646768b3528206e6dd36>