Device is busy

Place to discuss Fedora and/or Red Hat
Post Reply
X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Device is busy

Post by X11 » Sun May 22, 2005 11:29 pm

[x11@kintaro ~]$ sudo umount /exeleven/pub
umount: /exeleven/pub: device is busy
umount: /exeleven/pub: device is busy

How do I find out whats using it?

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Mon May 23, 2005 5:40 am

/sbin/lsof | grep exeleven

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon May 23, 2005 7:54 am

Or a faster way:

Code: Select all

fuser -m /exeleven/pub
If you wanted to kill all processes using that file system you could add a "-k" to the command line (run as root).

caveman
programmer
programmer
Posts: 130
Joined: Sun Feb 09, 2003 1:08 pm
Location: Midrand Gauteng, South Africa

Post by caveman » Mon May 23, 2005 6:01 pm

This is something I've been meaning to write about as well..

So now - when I get a device busy - I use "umount -fl /mnt/somemount"
That tries to "force" unmount - and if that fails do a "lazy" unmount..
<quote>
Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore.
(Requires kernel 2.4.11 or later.)
</quote>

Sometime my system hangs during a shutdown - waiting, waiting on a umount when a device is busy.

I've grepped the files in rc.d - made backups and changed all calls to
"umount -f" with "umount -f -l" and the others
"umount -a...." with "umount -a -l..." etc.

so-far it seems to do what I expect without any problems.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon May 23, 2005 6:05 pm

And to make the fuser list a little nicer:

fuser -muv /exeleven/pub

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 » Tue May 24, 2005 1:03 am

[x11@kintaro ~]$ fuser -m /exeleven/pub
/exeleven/pub: Input/output error
[x11@kintaro ~]$ fuser -mk /exeleven/pub
/exeleven/pub: Input/output error

It was mounted via samba to my Windows 2003 box, which crashed like a Windows 2003 box does. I might just have to reboot my poor laptop.

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 » Tue May 24, 2005 1:04 am

umount -fl worked.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Tue May 24, 2005 2:03 am

I used to have problems with drives mounted on my Samba fileserver.
Changing the filesystem type from smbfs to cifs mysteriously solved many of them.

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 » Tue May 24, 2005 8:16 pm

I thought cifs was automatically used if the server supported it. Silly me.

Post Reply