LinuxQuestions.org
Help answer threads with 0 replies.
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 10-19-2003, 11:18 PM   #1
ewto
Member
 
Registered: Jan 2003
Location: Ohio, USA
Distribution: RH 9.0 / Fedora Core 3
Posts: 58

Rep: Reputation: 15
is it ok to use umount -l ?


I have a bash script I'm using for mounting, erasing, then unmounting a compact flash card.

Every now and then when the umount command gets issued I get an error back saying that it is unable to un mount the device because the device is busy. Issuing the umount -l (lazy) command instead works fine.

Is there any reason I would not want to replace the umount command in the script with umount -l so that I know the card will unmount each time?

Thanks.

ewto
 
Old 10-20-2003, 01:56 AM   #2
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
It would be better to figure out why it's being reported as busy when it is or isn't, and work from there.

What's running when the device is reported busy ?
ps aux

Is there anything browsing its filesystem at the time?

-Shade
 
Old 10-20-2003, 04:11 AM   #3
ewto
Member
 
Registered: Jan 2003
Location: Ohio, USA
Distribution: RH 9.0 / Fedora Core 3
Posts: 58

Original Poster
Rep: Reputation: 15
Thank you.

I don't see anything in ps aux that is obviously accessing the card at the time: here is the output just in case I don't exactly know what I'm looking for:

Code:
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  2.3  0.0  1376   84 ?        S    04:09   0:03 init
root         2  0.0  0.0     0    0 ?        SW   04:09   0:00 [keventd]
root         3  0.0  0.0     0    0 ?        SW   04:09   0:00 [kapmd]
root         4  0.0  0.0     0    0 ?        SWN  04:09   0:00 [ksoftirqd_CPU0]
root         9  0.0  0.0     0    0 ?        SW   04:09   0:00 [bdflush]
root         5  0.0  0.0     0    0 ?        SW   04:09   0:00 [kswapd]
root         6  0.0  0.0     0    0 ?        SW   04:09   0:00 [kscand/DMA]
root         7  0.0  0.0     0    0 ?        SW   04:09   0:00 [kscand/Normal]
root         8  0.0  0.0     0    0 ?        SW   04:09   0:00 [kscand/HighMem]
root        10  0.0  0.0     0    0 ?        SW   04:09   0:00 [kupdated]
root        11  0.0  0.0     0    0 ?        SW   04:09   0:00 [mdrecoveryd]
root        15  0.0  0.0     0    0 ?        SW   04:09   0:00 [kjournald]
root        73  0.0  0.0     0    0 ?        SW   04:09   0:00 [khubd]
root       228  0.0  0.0     0    0 ?        SW   04:09   0:00 [usb-storage-0]
root       229  0.0  0.0     0    0 ?        SW   04:09   0:00 [scsi_eh_0]
root      1606  0.0  0.0     0    0 ?        SW   04:09   0:00 [kjournald]
root      1956  0.1  0.1  1440  152 ?        S    04:10   0:00 syslogd -m 0
root      1960  0.0  0.1  1368  144 ?        S    04:10   0:00 klogd -x
rpc       1978  0.0  0.0  1544   92 ?        S    04:10   0:00 [portmap]
rpcuser   1997  0.0  0.1  1616  232 ?        S    04:10   0:00 [rpc.statd]
root      2065  0.0  0.0  1364   68 ?        S    04:10   0:00 /usr/sbin/apmd -p
root      2102  0.8  0.8  3504 1012 ?        S    04:10   0:01 /usr/sbin/sshd
root      2116  0.0  0.2  2020  320 ?        S    04:10   0:00 xinetd -stayalive
root      2136  0.0  1.5  5936 1996 ?        S    04:10   0:00 [sendmail]
smmsp     2145  0.0  1.3  5728 1664 ?        S    04:10   0:00 [sendmail]
root      2155  0.0  0.0  1412  116 ?        S    04:10   0:00 gpm -t ps/2 -m /d
root      2164  0.0  0.1  1420  136 ?        S    04:10   0:00 crond
root      2175  0.0  1.1  7512 1504 ?        S    04:10   0:00 cupsd
xfs       2232  0.2  2.1  4620 2696 ?        S    04:10   0:00 [xfs]
daemon    2250  0.0  0.0  1408   72 ?        S    04:10   0:00 [atd]
root      2259  0.0  0.0  1348   56 tty1     S    04:10   0:00 /sbin/mingetty tt
root      2260  0.0  0.0  1348   56 tty2     S    04:10   0:00 /sbin/mingetty tt
root      2261  0.0  0.0  1348   56 tty3     S    04:10   0:00 /sbin/mingetty tt
root      2262  0.0  0.0  1348   56 tty4     S    04:10   0:00 /sbin/mingetty tt
root      2263  0.0  0.0  1348   56 tty5     S    04:10   0:00 /sbin/mingetty tt
root      2264  0.0  0.0  1348   56 tty6     S    04:10   0:00 /sbin/mingetty tt
root      2265  0.2  2.0 14112 2592 ?        S    04:10   0:00 [gdm-binary]
root      2308  0.8  2.5 14876 3172 ?        S    04:10   0:00 [gdm-binary]
root      2309  4.4  6.8 19072 8652 ?        S    04:10   0:04 /usr/X11R6/bin/X 
eric    2318  1.7  6.9 18392 8780 ?        S    04:10   0:01 /usr/bin/gnome-se
eric    2360  0.0  0.5  3132  700 ?        S    04:10   0:00 /usr/bin/ssh-agen
eric    2365  1.6  5.3 11152 6784 ?        S    04:10   0:01 /usr/libexec/gcon
eric    2367  0.4  1.4  6216 1868 ?        S    04:10   0:00 /usr/libexec/bono
eric    2369  0.7  4.7 17220 5968 ?        S    04:10   0:00 gnome-settings-da
eric    2374  0.1  0.7  2496  884 ?        S    04:10   0:00 [fam]
eric    2379  0.5  1.0  3580 1276 ?        S    04:10   0:00 xscreensaver -nos
eric    2382  2.3  5.1 12596 6480 ?        S    04:10   0:01 /usr/bin/metacity
eric    2386  2.8  9.0 20480 11408 ?       S    04:10   0:02 gnome-panel --sm-
eric    2388  2.7 10.0 62688 12636 ?       S    04:10   0:02 nautilus --no-def
eric    2390  0.4  4.4 16304 5564 ?        S    04:10   0:00 magicdev --sm-cli
eric    2392  0.5  5.1 16688 6496 ?        S    04:10   0:00 eggcups --sm-clie
eric    2394  0.2  2.9 11656 3732 ?        S    04:10   0:00 pam-panel-icon --
root      2397  0.0  0.1  1404  148 ?        S    04:10   0:00 [pam_timestamp_c]
eric    2404  0.7  5.2 16916 6580 ?        S    04:10   0:00 /usr/libexec/noti
eric    2406  2.8  7.6 20420 9628 ?        S    04:11   0:01 gnome-terminal
eric    2407  0.0  0.2  1852  284 ?        S    04:11   0:00 [gnome-pty-helpe]
eric    2408  0.1  0.2  4308  320 pts/0    S    04:11   0:00 bash
root      2434  0.0  0.2  4088  376 pts/0    S    04:11   0:00 [su]
root      2437  0.1  0.3  4300  456 pts/0    S    04:11   0:00 -bash
root      2477  0.0  0.3  3700  400 pts/0    S    04:11   0:00 tail -f /var/log/
eric    2480  0.4  0.9  4308 1152 pts/1    S    04:11   0:00 bash
eric    2513  0.0  0.5  2644  696 pts/1    R    04:12   0:00 ps aux
Do you see anything jumping out there that I'm not seeing?

Thanks for your time!
ewto
 
Old 10-20-2003, 04:17 AM   #4
ewto
Member
 
Registered: Jan 2003
Location: Ohio, USA
Distribution: RH 9.0 / Fedora Core 3
Posts: 58

Original Poster
Rep: Reputation: 15
As an aside ... playing with it since my last message ... It seems I can unmount it if I use the unmounting utility from the Gnome desktop (rightclick, disks...)

Then I tried the "disk management utility" installed with Gnome. It also reports that the device is busy.

Does this mean perhaps that it is nautilus that is holding it open for some reason? I'm mounting it from the command line, not using the gui ... but I am running gnome and nautilus at the time.

Ideas?

ewto

Last edited by ewto; 10-20-2003 at 04:21 AM.
 
Old 10-20-2003, 04:08 PM   #5
kc8tbe
Member
 
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
I have been using umount -l on my floppy drive after writing data to a floppy disk for some time without any trouble. Why I need to use umount -l instead of umount after writing data is beyond me, but it works. If you are nervous about the drive not unmounting properly, try mounting it again a few seconds after umount -l. If the drive re-mounts without error, then you should be able to immediately unmount it with a normal umount and remove the disk/compact flash card/what have you. (I think.)

And after all: umount -l is always preferable to umount -f.
 
Old 10-21-2003, 02:57 AM   #6
misophist
Member
 
Registered: Aug 2003
Location: here
Distribution: suse 8.2
Posts: 169

Rep: Reputation: 30
I have the same problem on both flash cards and cdrom. fuser to find the process and then I kill it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to umount / taiwf Linux - General 13 08-05-2005 01:40 AM
umount cd in use provkitir Linux - Newbie 3 01-29-2005 08:09 PM
autofs won't umount. RoaCh Of DisCor Linux - Software 1 12-26-2004 07:58 AM
can't umount cdrom ust Linux - General 6 11-07-2003 02:28 AM
cannot umount... ??? spyghost Linux - Software 9 09-06-2003 10:35 AM

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

All times are GMT -5. The time now is 12:42 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