LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   umount "device is busy" error (https://www.linuxquestions.org/questions/linux-general-1/umount-device-is-busy-error-661159/)

whinyan 08-07-2008 08:31 AM

umount "device is busy" error
 
Hi,

On a small self made Linux for a PC104 board (i586) I have the following issue:

Unmounting the /usr/home directory (/dev/hda2) gives the error "device is busy". All other partitions unmount without problems.

This is what I tried so far:

* Killed all user processes. Only a few system processes are still running.
* Verified with mount that only / (/dev/hda1) and /usr/home (/dev/hda2) are mounted
* Verified with fuser that no process is using /usr/home
* Verified with lsof that nobody is using /usr/home
* Removed all the sub directories from /usr/home

The home dir of root resides on the root partition (/root on /dev/hda1)

What could still be causing the unmount "busy" error?

Background information:

System is based on busybox and uses kernel 2.4.23 patched with the RT patches. The file system is minix.

Please help!!! Any suggestion is highly appreciated!

tredegar 08-07-2008 01:22 PM

You are running some weird installation. I moved to a 2.6 kernel some years ago, and a "minix" filesystem? Why choose that? Perhaps you have your reasons.

Does
Code:

lsof /usr/home
help?

[Edit:] Perhaps not, I just re-read your post, you have checked this, and there should be no output. Otherwise I am lost for an answer. Sorry.[/Edit]

But welcome to LQ!

Micro420 08-07-2008 02:02 PM

I remember reading on IBM's website that there was some command that would essentially force a umount on any busy device. Too bad I can't remember it

Micro420 08-08-2008 12:07 AM

Found the command. Here's an example:
Code:

fuser -k /dev/sda2
Then you should be able to use the umount command. Does this work? let us know

whinyan 08-08-2008 02:39 AM

Nope, I tried the fuser -k option already. It did not help.

Thanks for the suggestion.

ErV 08-08-2008 03:15 AM

Are you completely sure that you are root, X is off (runlevel 3 or 1), you aren't within mounted directory, and no other process has current directory on mounted volume ?

You might also try "umount -l" ("lazy" umount).

hasanatizaz 08-08-2008 03:23 PM

Quote:

Originally Posted by ErV (Post 3240659)
you aren't within mounted directory,

this is the case most of the time.

whinyan 08-08-2008 03:39 PM

Thanks for the suggestions.

I am root and I am sure that I am not in the mounted directory. I am not using runlevels either, since busbox doesn't support them.

Wouldn't lsof and fuser tell me if there were still processes holding the directory? I have almost no process running anymore on the system. Are there other things that can hold on to the directory (pipes?), and if so, how do I check this?

tredegar 08-08-2008 04:16 PM

Quote:

Are there other things that can hold on to the directory (pipes?), and if so, how do I check this?
I'd like to help, but you are waaaaaay out of date. The 2.4 kernel was abandoned years ago. Linux has moved on, very fast. This is called "progress".

It's a bit like you coming to a MicroSoft forum and asking about DOS 3.11 or windows 3.0 (1984?). Things have moved on and generally improved. We abandoned the previous linux kernel releases for very good reasons: many things were broken and needed to be redesigned from the ground up. This has happened, and continues to happen, much faster than MS is "improving" things (just take a look at "vista" :( ).

Bite the bullet and upgrade, or give us reasons why you cannot / will not.

It costs you nothing.

Good luck.

whinyan 08-09-2008 03:54 PM

Thanks for the suggestion to upgrade to kernel 2.6, but unfortunately this does not solve the issue either. Our Linux is running in a commercial (embedded) product and upgrading to kernel 2.6 would involve a lot of testing. Besides that, I evaluated kernel 2.6 before and it actually performed worse than kernel 2.4 in our application. Kernel 2.4 is still used a lot in embedded systems.

Did any of you had similar unmounting issues before? Are there utilities that tell more than fuser and lsof? Maybe some other tests I can perform?

smoked kipper 08-10-2008 11:54 AM

Quote:

I'd like to help, but you are waaaaaay out of date. The 2.4 kernel was abandoned years ago.
Eh? June 2008 was years ago? You got a time machine or what?

Quote:

The latest 2.4 version of the Linux kernel is: 2.4.36.6 2008-06-06 16:27 U
http://www.kernel.org/


Have you tried the -m option to fuser? This shows processes that are using the specified mounted filesystem.

Code:

fuser -m /usr/home
fuser -k won't (I think) kill processes that aren't accessing that specific file/directory, anything in a subdirectory won't be affected and I just tried 'fuser -k /dev/sda1' (usb flash drive) and it did nothing, though I had a shell open on the mount point (/cf). However, 'fuser -m /cf' does show the pid of the shell.

tredegar 08-10-2008 11:58 AM

Quote:

The latest 2.4 version of the Linux kernel is: 2.4.36.6 2008-06-06 16:27 U
I stand corrected - thanks ;)
Meawhile, I'll be interested to read the solution to this problem.

ErV 08-10-2008 03:23 PM

Quote:

Originally Posted by whinyan (Post 3241287)
Wouldn't lsof and fuser tell me if there were still processes holding the directory?

This:
Code:

lsof -n|grep /your/mounted/directory
should tell you what is holding up your device. (This includes current working directories of process).

teckk 08-10-2008 07:41 PM

My 2 cents

You can't force umount it as root?
#umount -f /usr/home

http://linuxcommand.org/man_pages/umount8.html

whinyan 08-13-2008 04:12 AM

Another update:

The issue somehow seems to be related to mgetty, even though "lsof -m" doesn't report it. (I have mgetty running on ttyS1.) When I remove the mgetty entry from inittab and reboot the system, I can unmount and remount the /usr/home directory without problems. After starting mgetty manually again, the directory cannot be unmounted anmymore.

Any mgetty expert out there who knows how to fix this?


All times are GMT -5. The time now is 12:26 AM.