View previous topic :: View next topic |
Author |
Message |
Luc484 Veteran
Joined: 26 Mar 2005 Posts: 1035 Location: Italy
|
Posted: Wed Jan 03, 2007 1:52 am Post subject: [Solved] Cannot unmount: device is busy |
|
|
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:
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 |
|
|
Row n00b
Joined: 25 Dec 2006 Posts: 51
|
Posted: Wed Jan 03, 2007 2:36 am Post subject: Duh |
|
|
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 |
|
|
Luc484 Veteran
Joined: 26 Mar 2005 Posts: 1035 Location: Italy
|
Posted: Wed Jan 03, 2007 2:40 am Post subject: Re: Duh |
|
|
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 |
|
|
SZwarts l33t
Joined: 13 Oct 2003 Posts: 629 Location: Sydney, NSW, Australia
|
Posted: Wed Jan 03, 2007 4:32 am Post subject: |
|
|
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 |
|
|
vadik56 n00b
Joined: 14 Feb 2006 Posts: 70
|
Posted: Wed Jan 03, 2007 5:00 am Post subject: |
|
|
You can unmount with -l "lazy" option that way you can at least remove your dvd:
|
|
Back to top |
|
|
Aysen Apprentice
Joined: 18 May 2005 Posts: 187 Location: Poland
|
Posted: Wed Jan 03, 2007 10:50 pm Post subject: |
|
|
vadik56 wrote: | You can unmount with -l "lazy" option that way you can at least remove your dvd:
| True.
It also helps me when sometimes my USB stick gets "stuck" the way Luc484 described. |
|
Back to top |
|
|
Luc484 Veteran
Joined: 26 Mar 2005 Posts: 1035 Location: Italy
|
Posted: Thu Feb 01, 2007 6:30 pm Post subject: |
|
|
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 |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Thu Feb 22, 2007 11:17 pm Post subject: |
|
|
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 |
|
|
Luc484 Veteran
Joined: 26 Mar 2005 Posts: 1035 Location: Italy
|
Posted: Fri Feb 23, 2007 7:16 am Post subject: |
|
|
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 |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Fri Feb 23, 2007 7:54 pm Post subject: |
|
|
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 |
|
|
loony Apprentice
Joined: 25 Feb 2004 Posts: 199
|
Posted: Mon Feb 26, 2007 7:58 am Post subject: Re: Duh |
|
|
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 |
|
|
x22 Apprentice
Joined: 24 Apr 2006 Posts: 208
|
Posted: Mon Feb 26, 2007 8:35 am Post subject: Re: Duh |
|
|
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 |
|
|
|