Slack 10.2 auto reading flash stick
Hello,
Is it possible to get an USB memory stick to mount when I stick it in the usb slot and unmount it on command? Scientific linux mounted it by me just putting it in but then kept it mounted, even though I told it to unmount. |
As long as you have all the USB modules compiled and your fstab updated, your memory stick will register as a device. Then you can manually mount and umount it without a hitch.
My guess is that if Scientific Linux was "automounting" the memory stick, then it was doing it to a crontab. Every time you umounted it, the cron would see you had the device and mount it again. --vonSt |
Quote:
|
I'm not an expert by any means. My personal experience is that hotplug and udev register the devices in /dev. They never (in Slackware, anyway) referenced my fstab and mounted themselves to a directory. *I* did that. As a user, I've always typed "mount /dvd" and it did! Then I could umount /dvd and get my dvd back.
So, a question back to you, uselpa, why/how does kd5giv's SciLin keep mounting his memory stick to a directory? --vonSt |
Quote:
|
http://wiki.kde.org/tiki-index.php?page=DBUS
That gave me a great intro into kd5giv's original question. Get HAL and DBUS for Slackware and they'll help you automount your hotplugs. But it didn't answer my question. I attempted to google around for what Red Hat (Scientific Linux) uses for its automounter, but gave up because of jetlag. (I shouldn't have gotten online right now...) |
Quote:
The "not-unmounting-when-you-tell-it-to" issue could be a permissions problem. With DBUS & HAL your user must be in the right groups in order to get full functionality. The exact names of the groups vary between distros. Debian uses a "plugdev" group, others use "messagebus" and "haldaemon" groups. Slackware doesn't have HAL. Current versions of HAL require PAM, so it could be a while off yet. There'll be no escaping DBUS though, because KDE4 uses it in place of DCOP. |
There are packages on linuxpackages.net for DBUS. I use KDE for Slackware 10.2. Should DBUS make it possible to use this memory stick? I doubt I will know what to do with fstab. It's always been a confusing subject.
|
USB hotplug mounting howto
Here's my own 1..2..3 on mounting a USB something-or-another (Note: I don't automount. I always mount by hand.):
1. Make sure I've compiled a kernel w/ all the USB modules in it that I have some understanding of. Alternately, the bigger pre-compiled Slackware kernels have ALL the USB modules compiled into them. 2. Start Slackware and get it all warm and happy. USB hardware at this time is unplugged and/or turned off. 3. Now that Slack is up, hotplug the USB hardware by plugging it in and/or turning it on. 4. And now the hard part... "tail /var/log/messages". (You might need to wait a little bit until the hotplug system works it magic.) In this usually root controlled log, a system message will be added saying that hotplug has started and the USB hardware is being assigned a device. 5. Time to decode the message. Look for key words. Here's an example of what I get when I hotplug my USB memory stick: Code:
Aug 30 16:22:36 rain kernel: USB Mass Storage support registered. 6. If you haven't already done this, you need a mount point. Mount points are the directories that will hold your USB hardware. Off of the / directory, I created "/td" because it's a "thumb drive." (mkdir /td) 7. Quick and dirty: mount /dev/sde1 /td and there you have it. (umount /td and there you don't have it!) 8. Slow and slick: add the following line to your /etc/fstab: Code:
/dev/sde1 /td vfat noauto,user,rw,exec 1 0 "noauto,user,rw,exec" from the man and howtos for mount: Don't automatically mount this at bootup, Allow the ordinary "user" to mount this drive, As read-write, Permit the execution of binaries from the drive. "1 0" have to do with "dump"ing. I have no idea what that means, but I know it ought to be "1 0". Quote:
mount /td umount /td 10. Always, always, always remember to umount before you pull your hardware. Man, have I gotten bit by that over and over! It doesn't matter if you're on Microsoft or Linux, umounting writes something or another that closes up those files you wrote to your memory stick. Don't do it, and your last file you wrote just doesn't seem to be the right size... if you can even mount the memory stick ever again!!! --vonSt |
I thought I'd add another variation for completeness...
Your device might not be registered as /dev/sdx. I don't know why, but my external hard drive DVD+-RW is registered as /dev/sr0. Consequently, I have the following line in my /etc/fstab: Code:
/dev/sr0 /dvd iso9660 iocharset=utf8,noauto,user,ro 0 0 NB: You definitely can tell your device will be an "sr" device. Look at /var/log/messages: Code:
Aug 30 17:18:30 rain kernel: usb 2-3: new high speed USB device using ehci_hcd and address 5 --vonSt |
Quote:
st = tapes sr = CDROMs, DVDs |
All times are GMT -5. The time now is 02:27 PM. |