LinuxQuestions.org
Visit Jeremy's Blog.
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 05-21-2004, 02:42 AM   #1
aspargo
LQ Newbie
 
Registered: May 2004
Distribution: redhat
Posts: 9

Rep: Reputation: 0
usb pendrive - can't umount (device busy).


I have successfully mounted my usb pendrive (logged into redhat 8 as root) with:

mount /dev/sda1 /mnt/usbHD

everything seems fine, but when I try to umount with:

umount /mnt/usbHD

I get:

/mnt/usbHD: device busy (This is not exact, I'm at work now and the problem is at home)

I assume that because the pen drive is still flashing, I need to stop it before I can umount it??

Does anybody know how to do this?

My solution at present is to reboot, during the shut down I get:

unmounting file systems .......................................................................[OK]

When I login again its not mounted, so the system can umount it okay.

If I remove the drive without rebooting the system umounts my cdrom, I'm sure this will make perfect sense to somebody, I'd be grateful for some enlightenment.

If somebody knows how to make the pendrive appear in the list of mountable devices in:

main menu -> system tools -> disk management

in GNOME I'd be even more grateful. Also how to set up permissions for non-root users to mount it??

Thanks,

Adam

p.s. If I don't sort it out, anybody want to buy a 128MB pendrive ...... ?
 
Old 05-21-2004, 10:34 AM   #2
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Hi

let's try to get you to keep the pendrive...

To be able to mount it as non-root user: become root, and edit /etc/fstab
add this line
/dev/sda1 /mnt/usbHD auto defaults,user,noauto 0 0

Now every user can just do 'mount /mnt/usbHD' and it should turn up in gnome.

But, regarding the umount problem, do you mean that the drive doesn't stop flashing even though you're not writing/reading anything to/from it??? That would be very strange indeed :'(
 
Old 05-21-2004, 12:31 PM   #3
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
Obvious thing to check:

Are you sure you aren't sitting on the mount point in a shell somewhere? Especially, check for where you've su'ed from a user in a shell that was sitting on the mount point. Even if the shell you su'ed to is now looking at a different directory, the original shell is still there and preventing you from umounting, even though you can't see it!
 
Old 05-21-2004, 04:46 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
vasudevadas is correct -- if you've got an open process (such as a terminal session) still accessing the device you won't be able to unmount it. What I'll guess is happening is that after you mounted it, you ran: cd /mnt/usbHD
and then did a directory listing or copied files to/from it or whatever, and then while you were still in /mnt/usbHD you tried to do the unmount. You need to get out of that directory -- just cd somewhere else. BTW the light will continue to flash the entire time the device is connected. It's not like the hard drive activity light, where it only lights up when it's doing something. -- J.W.
 
Old 05-21-2004, 08:47 PM   #5
jspenguin
Member
 
Registered: Feb 2003
Location: Wichita, KS
Distribution: Heavily modified Redhat
Posts: 194

Rep: Reputation: 30
Try this (if you have the lsof utility):

lsof | grep /mnt/usbHD

This will tell you what processes are using it and how (cwd, open file, etc.)
 
Old 05-21-2004, 09:06 PM   #6
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Rep: Reputation: 32
How did you know that the device was called sda1?
 
Old 05-22-2004, 11:42 AM   #7
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
I guess, concerning the sb{a|b|c}, they're in the same order as in /proc/scsi/scsi (careful, scsi cd drives are also in there, and they go to /dev/srX or /dev/scdX)
Concerning the partition number, it depends... I have a USB stick that is /dev/sdX1 and my digital camera, on the other hand, is /dev/sdX4... Trial and error here I'm afraid
 
Old 05-23-2004, 12:26 PM   #8
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
UPDATE: Also by looking at the kernel logs (type dmesg, or else look into /var/log/messages)

e.g. for my USB flash drive thingy:
Code:
hub.c: new USB device 00:1f.2-2.2.1, assigned address 6
scsi2 : SCSI emulation for USB Mass Storage devices
  Vendor: Generic   Model: USB Flash Disk    Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0
SCSI device sdb: 512000 512-byte hdwr sectors (262 MB)
sdb: Write Protect is off
 sdb: sdb1 sdb2 sdb3 sdb4
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 6
Watch the 3rd line from the bottom: sdb
 
Old 05-24-2004, 02:58 AM   #9
aspargo
LQ Newbie
 
Registered: May 2004
Distribution: redhat
Posts: 9

Original Poster
Rep: Reputation: 0
Cheers,
I edited fstab and got the pendrive icon coming up in GNOME.
BUT after I umount it successfully (definitely - you can't cd to it anymore), I unplug it and /mnt/cdrom disappears. Weird eh? I'm guessing when I unplug it something says "lost a device better kill the last one on the list".

I'll try the Isof | grep when I get home.

Yeah, you've guessed it, the next job is to configure a modem so I can get online at home.
Anybody recommend a cheap modem that definitely works with redhat ?

Thanks fro your help,

Adam.
 
Old 05-24-2004, 03:46 AM   #10
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Glad to hear it works! Still this cdrom thing is very wierd... Maybe the device or the mountpoint for your cdrom drive erroneously appear in two different places in the /etc/fstab?
 
Old 05-24-2004, 10:24 AM   #11
aspargo
LQ Newbie
 
Registered: May 2004
Distribution: redhat
Posts: 9

Original Poster
Rep: Reputation: 0
sorry Glenn69, I didn't see your post before.

It's sda because the system uses scsi emulation to see the usb drive:

sd => scsi device
a= > first one

sda1 is then the first partition. There can be many similar devices that get used, you just have to try a few till it works. If you're lucky it shows up in /etc/fstab or /etc/mtab. There are alot of threads on here about it if you search for "usb pendrive".
 
Old 06-05-2004, 01:19 PM   #12
smujica
LQ Newbie
 
Registered: Jun 2004
Distribution: Fedora
Posts: 1

Rep: Reputation: 0
fam prevents you from unmounting

You are probably running "fam", the file alteration monitor, a service started by xinetd that sends notifications of changes to the file system to aplications (for example nautilus), just read the man page "man fam". When you mount /dev/sda1 on /mnt/usbHD, fam will keep that folder open and therefore you will not be able to unmount it.

cheers, Sergio Mujica

Last edited by smujica; 06-05-2004 at 01:21 PM.
 
Old 06-07-2004, 07:50 PM   #13
TomF
Member
 
Registered: Sep 2003
Location: California
Distribution: RH9, Fedora: FC1, FC3, Suse9.3
Posts: 54

Rep: Reputation: 15
Stopping fam

I just had this problem, found this thread, and used lsof to find that my problem was indeed caused by fam holding /mnt/cdrom.

Killing the fam process didn't help, so I went to Main/System Settings/Server Settings/Server in FC1, and tried to stop sgi_fam. Stop was greyed out, so I stopped xinetd, unchecked sgi_fam, and started xinetd.

At this point the umount worked.

Does anyone know a better way to get umount working in this situation?
 
Old 06-20-2004, 01:14 PM   #14
jamesfei
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
I have this problem too,I try to use the lsof to check the thread which hold the device.
It is the kdeinit hold serveral pdf file,but I didn't open it,why?
How can I deal with this,I wandered if I kill the kdeinit it will crash my system.
anybody have some suguestion?
 
Old 06-30-2004, 02:58 AM   #15
aspargo
LQ Newbie
 
Registered: May 2004
Distribution: redhat
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,
Sorry for delay in response, threw pendrive across room in anger the other week and only recently found it ...

Last night I started again. I added

/dev/sda1 /mnt/usba vfat noauto, user, rw 0 0

to /etc/fstab.

mount /mnt/usba

killed fam

umount /mnt/usba

- no problem.

Rebooted with the pendrive still attached. Thought I'd done this before but maybe not.
This time when I logged in I can mount & umount without killing fam and the cdrom mount point no longer gets killed when I remove the pendrive.
Not sure what combination of the above is critical but it worked for me.

Adam.
 
  


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
umount :device busy Pedroski Linux - Hardware 14 12-29-2004 03:37 PM
umount - device is busy - with what??? Moebius Linux - Software 16 12-08-2004 10:32 AM
fam and umount says device is busy Brian1 Fedora 2 10-05-2004 07:33 PM
umount /var device busy winchester169 Linux - Networking 1 06-25-2004 07:53 PM
umount: /mnt/a5: device is busy PTBmilo Linux - General 2 01-31-2003 10:48 PM

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

All times are GMT -5. The time now is 05:28 PM.

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