Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Cannot unmount: device is busy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Luc484
Veteran
Veteran


Joined: 26 Mar 2005
Posts: 1035
Location: Italy

PostPosted: Wed Jan 03, 2007 1:52 am    Post subject: [Solved] Cannot unmount: device is busy Reply with quote

Hi all. It's been some days since I started to have this problem. When I try to unmount a partition (dvd) I get:

Code:
pluca luca # umount /dev/hdc
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy


I know it's quite usual, and it means some process is still using the device, right? So, as usual, I try to find the process with:

Code:
fuser -u /dev/hdc


but, strangely I get no process. I used to have some process using the resource, but not this time. I get nothing. But umount still says the device is in use. I've never had this problem before. Any idea?
Thanks for any help, it's not too good to restart each time I unmount the volume.


Last edited by Luc484 on Thu Feb 01, 2007 6:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
Row
n00b
n00b


Joined: 25 Dec 2006
Posts: 51

PostPosted: Wed Jan 03, 2007 2:36 am    Post subject: Duh Reply with quote

This problem is so typical... It usually occurs when:

a) A process is accesing the device, solution: just close the app
b) A process is working even offline with the device (i.e., you have the device content or content of a folder of the device shown on your filemanager): just move to another folder or close the filemanager
c) A process was working with the app, got closed but freed incorrectly its file descriptors, so there is no process anywhere but kernel still keeps a file descriptor pointing to the device. Solution: just pray. In fact, I don't know any way to fix this but rebooting.

Bye!
_________________
<<Gentoo GNU/Linux, AMD64 X2 4200+, Nvidia GForce 6600GT, Beryl, Emerald, KDE>>
Back to top
View user's profile Send private message
Luc484
Veteran
Veteran


Joined: 26 Mar 2005
Posts: 1035
Location: Italy

PostPosted: Wed Jan 03, 2007 2:40 am    Post subject: Re: Duh Reply with quote

Row wrote:
c) A process was working with the app, got closed but freed incorrectly its file descriptors, so there is no process anywhere but kernel still keeps a file descriptor pointing to the device. Solution: just pray. In fact, I don't know any way to fix this but rebooting.


I'm surely in this case. Strange that I haven't seen this for years and now I see it so often.
Thanks for your answer.
Back to top
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Wed Jan 03, 2007 4:32 am    Post subject: Reply with quote

You can also use the command eject if you have that installed. You can call eject with as a parameter the mount point or the device, it will unmount stuff itself for you, if that can be 'easily' done.
_________________
only when it is dark enough, can you see the stars
Back to top
View user's profile Send private message
vadik56
n00b
n00b


Joined: 14 Feb 2006
Posts: 70

PostPosted: Wed Jan 03, 2007 5:00 am    Post subject: Reply with quote

You can unmount with -l "lazy" option that way you can at least remove your dvd:
Code:
umount -l /dev/dvd
Back to top
View user's profile Send private message
Aysen
Apprentice
Apprentice


Joined: 18 May 2005
Posts: 187
Location: Poland

PostPosted: Wed Jan 03, 2007 10:50 pm    Post subject: Reply with quote

vadik56 wrote:
You can unmount with -l "lazy" option that way you can at least remove your dvd:
Code:
umount -l /dev/dvd
True.
It also helps me when sometimes my USB stick gets "stuck" the way Luc484 described.
Back to top
View user's profile Send private message
Luc484
Veteran
Veteran


Joined: 26 Mar 2005
Posts: 1035
Location: Italy

PostPosted: Thu Feb 01, 2007 6:30 pm    Post subject: Reply with quote

I discovered the problem was mainly caused by NFS. Even if I unmount the device from the system connecting through NFS, the device is used since it is exported. I have to stop NFS to unmount the device locally. It seems not comfortable like this to me, but I read it is normal.
Thanks for your suggestions.
Back to top
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Thu Feb 22, 2007 11:17 pm    Post subject: Reply with quote

the only option is to reboot ? i was working on an install and could not umount /mnt/gentoo/dev

logger ~ # umount /mnt/gentoo/dev
umount: /mnt/gentoo/dev: device is busy
umount: /mnt/gentoo/dev: device is busy
logger ~ # lsof | grep 'mnt/gentoo/dev'
udevd 11601 root 0u CHR 1,3 983 /mnt/gentoo/dev/null
udevd 11601 root 1u CHR 1,3 983 /mnt/gentoo/dev/null
udevd 11601 root 2u CHR 1,3 983 /mnt/gentoo/dev/null
logger ~ #

rebooting is a windows solution. is there a bug to be filed ?

i have another box like this too where i need it un mounted but can not reboot.

anyone have a solution to this ?

matt
Back to top
View user's profile Send private message
Luc484
Veteran
Veteran


Joined: 26 Mar 2005
Posts: 1035
Location: Italy

PostPosted: Fri Feb 23, 2007 7:16 am    Post subject: Reply with quote

mattmatteh wrote:
the only option is to reboot ? i was working on an install and could not umount /mnt/gentoo/dev

logger ~ # umount /mnt/gentoo/dev
umount: /mnt/gentoo/dev: device is busy
umount: /mnt/gentoo/dev: device is busy
logger ~ # lsof | grep 'mnt/gentoo/dev'
udevd 11601 root 0u CHR 1,3 983 /mnt/gentoo/dev/null
udevd 11601 root 1u CHR 1,3 983 /mnt/gentoo/dev/null
udevd 11601 root 2u CHR 1,3 983 /mnt/gentoo/dev/null
logger ~ #

rebooting is a windows solution. is there a bug to be filed ?

i have another box like this too where i need it un mounted but can not reboot.

anyone have a solution to this ?

matt


I don't know whether this is the same problem I had or not. Anyway, in my case it is not necessary to reboot the system. It is only necessary to restart NFS on the client machine. That's it.
I googled a little bit and found out this is a common behaviour and it seems it is not considered a bug. I don't know if this is your case or not.
Back to top
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Fri Feb 23, 2007 7:54 pm    Post subject: Reply with quote

i didnt have any nfs mounts. i was thinking this might be a the problem, but thats only a guess.
Row wrote:
c) A process was working with the app, got closed but freed incorrectly its file descriptors, so there is no process anywhere but kernel still keeps a file descriptor pointing to the device. Solution: just pray. In fact, I don't know any way to fix this but rebooting.


matt
Back to top
View user's profile Send private message
loony
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 199

PostPosted: Mon Feb 26, 2007 7:58 am    Post subject: Re: Duh Reply with quote

Row wrote:

c) A process was working with the app, got closed but freed incorrectly its file descriptors, so there is no process anywhere but kernel still keeps a file descriptor pointing to the device. Solution: just pray. In fact, I don't know any way to fix this but rebooting.


Thank you so much, I almost got crazy about this :) fuser, lsof, ps etc and I couldn't get any info which process sits on that path. Also, the umount -l command helped me out with this.

loony
_________________
Please vote for this issue of OpenOffice.org (18004): http://qa.openoffice.org/issues/show_bug.cgi?id=18004
Back to top
View user's profile Send private message
x22
Apprentice
Apprentice


Joined: 24 Apr 2006
Posts: 208

PostPosted: Mon Feb 26, 2007 8:35 am    Post subject: Re: Duh Reply with quote

Row wrote:

c) A process was working with the app, got closed but freed incorrectly its file descriptors, so there is no process anywhere but kernel still keeps a file descriptor pointing to the device. Solution: just pray. In fact, I don't know any way to fix this but rebooting.


Kernel will always close files open by a process before completely destroying it.

But kernel may have files open for its own purposes (swap, loopback devices, mounting filesystems, NFS, ...) and this use is invisible for lsof and fuser.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum