LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2008, 08:31 AM   #1
whinyan
LQ Newbie
 
Registered: Aug 2008
Posts: 6

Rep: Reputation: 0
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!
 
Old 08-07-2008, 01:22 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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!

Last edited by tredegar; 08-07-2008 at 01:53 PM. Reason: As above
 
Old 08-07-2008, 02:02 PM   #3
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
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
 
Old 08-08-2008, 12:07 AM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
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
 
Old 08-08-2008, 02:39 AM   #5
whinyan
LQ Newbie
 
Registered: Aug 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Nope, I tried the fuser -k option already. It did not help.

Thanks for the suggestion.
 
Old 08-08-2008, 03:15 AM   #6
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
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).
 
Old 08-08-2008, 03:23 PM   #7
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
Quote:
Originally Posted by ErV View Post
you aren't within mounted directory,
this is the case most of the time.

Last edited by hasanatizaz; 08-09-2008 at 01:06 AM.
 
Old 08-08-2008, 03:39 PM   #8
whinyan
LQ Newbie
 
Registered: Aug 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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?
 
Old 08-08-2008, 04:16 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
Old 08-09-2008, 03:54 PM   #10
whinyan
LQ Newbie
 
Registered: Aug 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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?
 
Old 08-10-2008, 11:54 AM   #11
smoked kipper
Member
 
Registered: May 2008
Location: UK
Distribution: Slackware,Slamd64
Posts: 81

Rep: Reputation: 15
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.

Last edited by smoked kipper; 08-10-2008 at 11:56 AM.
 
Old 08-10-2008, 11:58 AM   #12
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
Old 08-10-2008, 03:23 PM   #13
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by whinyan View Post
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).
 
Old 08-10-2008, 07:41 PM   #14
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,142
Blog Entries: 6

Rep: Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829Reputation: 1829
My 2 cents

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

http://linuxcommand.org/man_pages/umount8.html
 
Old 08-13-2008, 04:12 AM   #15
whinyan
LQ Newbie
 
Registered: Aug 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xine "Audio output unavailable. Device is busy." shellshock Linux - Software 3 05-13-2006 12:19 PM
HELP "device is busy" how to stop that error Lleb_KCir Linux - Software 8 07-08-2005 09:32 PM
gnomemeeting crashed, now i got "video0: Device or resource busy" B sirpelidor Linux - Hardware 0 01-10-2005 03:02 AM
samba - smbmount freezing my terminals -> "Device is busy" Yntarius Linux - Networking 4 05-21-2004 07:19 AM
Swapon error: "device busy" during RAID install of 9.2 Seekadvice Mandriva 0 02-19-2004 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration