Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

zfs too busy for destroy

1,519 views
Skip to first unread message

Philip Brown

unread,
Mar 15, 2012, 3:46:10 PM3/15/12
to
I hit an oddity today:

I could not destroy a zfs filesystem, for no apparent reason.


zfs destroy fs
failed, claiming "Device Busy"

This was odd because:

1. it was not NFS-shared
2. "fuser -c" returned nothing
3. There were no snapshots. Therefore no 'holds',and no clones.
4. It had no children

This is on Solaris MU10

Any suggestions on what could have kept it "busy"?

cindy

unread,
Mar 15, 2012, 6:12:25 PM3/15/12
to
Hi Phil,

No idea. What is Solaris MU10?

You could try to unmount it, force unmount it and then try zfs destroy
-f.
Or, you could truss it to see any more clues.

Thanks,

Cindy

ChrisQ

unread,
Mar 15, 2012, 6:37:08 PM3/15/12
to
If you have any shells or file manager pointing anywhere in the fs,
it will show up as busy if you try to delete it...

Regards,

Chris

Philip Brown

unread,
Mar 15, 2012, 7:22:09 PM3/15/12
to
On Thursday, March 15, 2012 3:37:08 PM UTC-7, ChrisQ wrote:

> >
> >> 1. it was not NFS-shared
> >> 2. "fuser -c" returned nothing
> >> 3. There were no snapshots. Therefore no 'holds',and no clones.
> >> 4. It had no children
>
>
> If you have any shells or file manager pointing anywhere in the fs,
> it will show up as busy if you try to delete it...
>

"fuser -c" is specifically written (by sun) to pick up this sort of thing, and tell you the PID of the offending processes.
As mentioned, it did not show anything.

Is there any known bug where fuser does not work properly on zfs any more?

Ian Collins

unread,
Mar 16, 2012, 3:16:10 AM3/16/12
to
On 03/16/12 12:22 PM, Philip Brown wrote:
> On Thursday, March 15, 2012 3:37:08 PM UTC-7, ChrisQ wrote:
>
>>>
>>>> 1. it was not NFS-shared
>>>> 2. "fuser -c" returned nothing
>>>> 3. There were no snapshots. Therefore no 'holds',and no clones.
>>>> 4. It had no children
>>
>>
>> If you have any shells or file manager pointing anywhere in the fs,
>> it will show up as busy if you try to delete it...
>>
>
> "fuser -c" is specifically written (by sun) to pick up this sort of thing, and tell you the PID of the offending processes.
> As mentioned, it did not show anything.

It could be anywhere in the filesystem.

> Is there any known bug where fuser does not work properly on zfs any more?

Not that I have seen. Which version are you running?

Does zfs unmount -f work on the filesystem?

--
Ian Collins

John D Groenveld

unread,
Mar 16, 2012, 9:51:54 AM3/16/12
to
In article <f35bc2a9-1d42-46f3...@r21g2000yqa.googlegroups.com>,
cindy <cindy.sw...@oracle.com> wrote:
>No idea. What is Solaris MU10?

He's likely referring to Solaris 10 8/11 release.
<URL:http://www.oracle.com/technetwork/server-storage/solaris10/downloads/index.html>

John
groe...@acm.org

Philip Brown

unread,
Mar 16, 2012, 3:45:29 PM3/16/12
to
On Friday, March 16, 2012 12:16:10 AM UTC-7, Ian Collins wrote:
> On 03/16/12 12:22 PM, Philip Brown wrote:
>
> > "fuser -c" is specifically written (by sun) to pick up this sort of thing, and tell you the PID of the offending processes.
> > As mentioned, it did not show anything.
>
> It could be anywhere in the filesystem.


Err.. yes, I know, which is why I used "fuser -c", not just "fuser".
From man fuser:
-c Reports on files that are mount points for file
systems, and any files within that mounted file
system.

The option is specifically designed to tell you which processes are keeping a filesystem "busy" from unmounting.

>
> > Is there any known bug where fuser does not work properly on zfs any more?
>
> Not that I have seen. Which version are you running?
>
> Does zfs unmount -f work on the filesystem?
>

yes, and it's what I eventually did.
however, given that I've seen Bad Things Happen from using umount -f on NFS mounted filesystems... I'd like to get ideas on what might have been going on, and ways to clean things up, rather than using umount -f.


Ian Collins

unread,
Mar 16, 2012, 4:31:21 PM3/16/12
to
On 03/17/12 08:45 AM, Philip Brown wrote:
> On Friday, March 16, 2012 12:16:10 AM UTC-7, Ian Collins wrote:
>> On 03/16/12 12:22 PM, Philip Brown wrote:
>>
>>> "fuser -c" is specifically written (by sun) to pick up this sort of thing, and tell you the PID of the offending processes.
>>> As mentioned, it did not show anything.
>>
>> It could be anywhere in the filesystem.
>
>
> Err.. yes, I know, which is why I used "fuser -c", not just "fuser".
> From man fuser:
> -c Reports on files that are mount points for file
> systems, and any files within that mounted file
> system.
>
> The option is specifically designed to tell you which processes are keeping a filesystem "busy" from unmounting.
>
Fair enough, but it doesn't help if ZFS is causing the filesystem to be
busy.

>>
>>> Is there any known bug where fuser does not work properly on zfs any more?
>>
>> Not that I have seen. Which version are you running?

Answering this early on would have helped, different OS version behave
in different ways.

>> Does zfs unmount -f work on the filesystem?
>>
>
> yes, and it's what I eventually did.
> however, given that I've seen Bad Things Happen from using umount -f on NFS mounted filesystems... I'd like to get ideas on what might have been going on, and ways to clean things up, rather than using umount -f.

You said the file system wasn't shared.

The most common cause of a filesystem being busy is a
current/stuck/failed send to or from it.

--
Ian Collins

Philip Brown

unread,
Mar 16, 2012, 4:55:34 PM3/16/12
to
On Friday, March 16, 2012 1:31:21 PM UTC-7, Ian Collins wrote:
> ...
> Fair enough, but it doesn't help if ZFS is causing the filesystem to be
> busy.

yus, but I dont know how to check on that, hence my asking. :)

> >> Not that I have seen. Which version are you running?
>
> Answering this early on would have helped, different OS version behave
> in different ways.

but I did answer it, early on. Solaris 10 MU10.


> The most common cause of a filesystem being busy is a
> current/stuck/failed send to or from it.


aha.. so how does one check on this?
I dont think there was an *actual* send or recv process. I suspect that the system may have had bogus send/recv locks in it somehow.
Woudl be nice to know how one can check, "does filesystem X have send/receive locks on it?"

Ian Collins

unread,
Mar 16, 2012, 5:14:22 PM3/16/12
to
On 03/17/12 09:55 AM, Philip Brown wrote:
> On Friday, March 16, 2012 1:31:21 PM UTC-7, Ian Collins wrote:
>> ...
>> Fair enough, but it doesn't help if ZFS is causing the filesystem to be
>> busy.
>
> yus, but I dont know how to check on that, hence my asking. :)
>
>>>> Not that I have seen. Which version are you running?
>>
>> Answering this early on would have helped, different OS version behave
>> in different ways.
>
> but I did answer it, early on. Solaris 10 MU10.

The key 10 was missing!

>> The most common cause of a filesystem being busy is a
>> current/stuck/failed send to or from it.
>
>
> aha.. so how does one check on this?

When I encounter a stuck filesystem or snapshot, I normally look for a
process doing a send or receive.

> I dont think there was an *actual* send or recv process. I suspect that the system may have had bogus send/recv locks in it somehow.
> Woudl be nice to know how one can check, "does filesystem X have send/receive locks on it?"

Best ask on the zfs list, there might be a way with zdb.

--
Ian Collins

cindy swearingen

unread,
Mar 16, 2012, 6:21:08 PM3/16/12
to
We had a previous problem in earlier Solaris 10 releases (not your's)
where doing a zfs send with incrementals
left a temporary clone around that then caused a "dataset busy or
dataset exists" when trying to destroy the
file system. The zdb command to find those clones is like this:

# zdb -d <poolname> | grep %

Your message was device busy. If you have a reproducible problem then
please let me know
what that scenario is.

Thanks,

Cindy

Philip Brown

unread,
Mar 19, 2012, 7:29:46 PM3/19/12
to
On Friday, March 16, 2012 3:21:08 PM UTC-7, cindy swearingen wrote:
> On Mar 16, 2:55 pm, Philip Brown

> > Woudl be nice to know how one can check, "does filesystem X have send/receive locks on it?"
>
> We had a previous problem in earlier Solaris 10 releases (not your's)
> where doing a zfs send with incrementals
> left a temporary clone around that then caused a "dataset busy or
> dataset exists" when trying to destroy the
> file system. The zdb command to find those clones is like this:
>
> # zdb -d
> | grep %
>
> Your message was device busy. If you have a reproducible problem then
> please let me know
> what that scenario is.
>

Thanks, that sounds somewhat useful.
Do you have any zdb magic to detect ongoing send/receive, though?
That would be more useful for us.

Ian Collins

unread,
Mar 20, 2012, 5:00:41 AM3/20/12
to
On 03/16/12 08:46 AM, Philip Brown wrote:
> I hit an oddity today:
>
> I could not destroy a zfs filesystem, for no apparent reason.
>
>
> zfs destroy fs
> failed, claiming "Device Busy"
>
> This was odd because:
>
> 1. it was not NFS-shared
> 2. "fuser -c" returned nothing

Odd, I had the same thing on an update 8 box but the second time (after
a short delay) I ran fuser, it showed the process...

--
Ian Collins

Michael

unread,
Mar 20, 2012, 4:27:51 PM3/20/12
to
Hi,

On 03/15/12 11:12 PM, cindy wrote:
> On Mar 15, 1:46 pm, Philip Brown<p...@bolthole.com> wrote:
>> I hit an oddity today:
>>
>> I could not destroy a zfs filesystem, for no apparent reason.
>>
>> zfs destroy fs
>> failed, claiming "Device Busy"
>>
>> This was odd because:
>>
>> 1. it was not NFS-shared
>> 2. "fuser -c" returned nothing
>> 3. There were no snapshots. Therefore no 'holds',and no clones.
>> 4. It had no children
>>
>> This is on Solaris MU10
>>
>> Any suggestions on what could have kept it "busy"?
>
> Hi Phil,
>
> No idea. What is Solaris MU10?
Most likely S10 maintenance update 10

/michael

David Combs

unread,
May 5, 2012, 4:19:04 PM5/5/12
to
In article <9shope...@mid.individual.net>,
Ian Collins <ian-...@hotmail.com> wrote:
>
>Best ask on the zfs list, there might be a way with zdb.
>
>--
>Ian Collins

WHAT zfs list? No such newsgroup, at least not here
on panix.com (hot shit place for shell users, lots of
newsgroups, and articles stick around for quite a while).

At not least via nntplist.

Thanks much!!!!

David

John D Groenveld

unread,
May 5, 2012, 4:50:08 PM5/5/12
to
In article <jo41vo$679$2...@reader1.panix.com>,
David Combs <dkc...@panix.com> wrote:
>WHAT zfs list? No such newsgroup, at least not here

<URL:http://mail.opensolaris.org/mailman/listinfo/zfs-discuss>

If you require NNTP access, try Gmane's interface:
<URL:http://dir.gmane.org/gmane.os.solaris.opensolaris.zfs>

John
groe...@acm.org

Kees Nuyt

unread,
May 5, 2012, 4:53:44 PM5/5/12
to
zfs-discuss mailing list

You'll have to subscribe first at:
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Best regards,
--
( Kees Nuyt
)
c[_]

Chris Ridd

unread,
May 5, 2012, 5:33:29 PM5/5/12
to
Ian probably means the zfs-discuss list at opensolaris.org.

--
Chris

David Combs

unread,
May 13, 2012, 10:55:03 PM5/13/12
to
In article <a0lkl9...@mid.individual.net>,
Thanks to all who replied!

David

pete...@googlemail.com

unread,
Oct 11, 2012, 7:06:45 AM10/11/12
to
The simplest way is to use lsof
If the mount point is /data do this
lsof | grep /data

Pete
0 new messages