Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ...... ?
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 :'(
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!
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.
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
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
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 ?
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?
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".
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.
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?
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.