LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-26-2006, 03:20 AM   #1
kd5giv
LQ Newbie
 
Registered: Mar 2004
Distribution: Slackware Lastest
Posts: 18

Rep: Reputation: 0
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.
 
Old 08-26-2006, 07:47 AM   #2
vonst
Member
 
Registered: May 2004
Location: Wash DC Metro Area
Distribution: Slackware 11
Posts: 108

Rep: Reputation: 15
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
 
Old 08-26-2006, 09:47 AM   #3
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Quote:
Originally Posted by vonst
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.
I have never heart of somebody using cron to automount. Automounting is done either by udev, or hotplug, or autofs, or (you name it). But never by cron.
 
Old 08-26-2006, 04:05 PM   #4
vonst
Member
 
Registered: May 2004
Location: Wash DC Metro Area
Distribution: Slackware 11
Posts: 108

Rep: Reputation: 15
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
 
Old 08-26-2006, 04:48 PM   #5
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware
Posts: 1,348

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
So, a question back to you, uselpa, why/how does kd5giv's SciLin keep mounting his memory stick to a directory?
A quick peek at the website indicates HAL and DBUS.
 
Old 08-26-2006, 08:57 PM   #6
vonst
Member
 
Registered: May 2004
Location: Wash DC Metro Area
Distribution: Slackware 11
Posts: 108

Rep: Reputation: 15
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...)
 
Old 08-26-2006, 09:14 PM   #7
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by vonst
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.
It uses HAL, DBUS & Gnome-volume-manager.

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.
 
Old 08-27-2006, 03:54 AM   #8
kd5giv
LQ Newbie
 
Registered: Mar 2004
Distribution: Slackware Lastest
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
Old 08-30-2006, 04:17 PM   #9
vonst
Member
 
Registered: May 2004
Location: Wash DC Metro Area
Distribution: Slackware 11
Posts: 108

Rep: Reputation: 15
Lightbulb 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.
Aug 30 16:22:41 rain kernel:   Vendor:           Model: USB Flash Memory  Rev: 1.04
Aug 30 16:22:41 rain kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
Aug 30 16:22:42 rain kernel: SCSI device sde: 2004992 512-byte hdwr sectors (1027 MB)
Aug 30 16:22:42 rain kernel: sde: Write Protect is off
Aug 30 16:22:42 rain kernel: SCSI device sde: 2004992 512-byte hdwr sectors (1027 MB)
Aug 30 16:22:42 rain kernel: sde: Write Protect is off
Aug 30 16:22:42 rain kernel:  sde: sde1
Aug 30 16:22:42 rain kernel: sd 4:0:0:0: Attached scsi removable disk sde
Aug 30 16:22:42 rain kernel: sd 4:0:0:0: Attached scsi generic sg4 type 0
Key words "SCSI device sde" and "sde: sde1". Why are they key words? Because I know that my memory devices look something like "/dev/hda" or "/dev/sda". It specifically tells me in the log that I have a SCSI device, so I know it'll have to look like "/dev/sda" or maybe "/dev/sda1" or in this case sde1 means "/dev/sde1".

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
Decode: "vfat" is the disk partitioning scheme.
"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:
Inserted very damning note: Since Slackware is adding your devices sequentially, if you have a couple devices that use the SCSI device scheme, your memory stick may mount as /dev/sde (which happens to be the 5th memory device after my 4 hard drives). Or it may be /dev/sdf, if, say, I hotplugged a digital camera into Linux and the camera got /dev/sde first! The digital camera could be mounted, then with mount /td. I mean, it's a device and fstab knows /dev/sde1 goes with /td. But then your memory stick, sitting at /dev/sdf1 is out of luck. Maybe automounters are smart enough to discriminate. I dunno.
9. If you have chosen the "Slow and slick" method, you will then be able to mount your drive as a user, which is awfully nice if you typically run Slack as a user.

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
 
Old 08-30-2006, 04:38 PM   #10
vonst
Member
 
Registered: May 2004
Location: Wash DC Metro Area
Distribution: Slackware 11
Posts: 108

Rep: Reputation: 15
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
And unfortunately, I don't know why it's like this. It likes my DVD drive to be called sr0. The iso0660 is the standard partitioning scheme of CDROMs and DVDs, and utf8 is the characterset of Western English. But the rest of it, I included because other howtos told me to. (Sad but true.)

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
Aug 30 17:18:30 rain kernel: usb 2-3: configuration #1 chosen from 1 choice
Aug 30 17:18:30 rain kernel: scsi5 : SCSI emulation for USB Mass Storage devices
Aug 30 17:18:39 rain kernel:   Vendor: PLEXTOR   Model: DVDR   PX-716A    Rev: 1.04
Aug 30 17:18:39 rain kernel:   Type:   CD-ROM                             ANSI SCSI revision: 00
Aug 30 17:18:39 rain kernel: sr 5:0:0:0: Attached scsi generic sg5 type 5
Where as the other device said it was "sde 4:0:0:0", this one says "sr 5:0:0:0". (I still have the memory stick mounted...)

--vonSt
 
Old 08-30-2006, 04:57 PM   #11
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 -current
Posts: 268
Blog Entries: 1

Rep: Reputation: 79
Quote:
Originally Posted by vonst
And unfortunately, I don't know why it's like this. It likes my DVD drive to be called sr0.
sd = disks
st = tapes
sr = CDROMs, DVDs
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb flash memory stick HeyAZ Fedora 2 08-21-2006 09:34 PM
usb stick gets auto-mounted pranavchoudhary Linux - Newbie 12 02-25-2006 05:31 PM
flash memory stick rilians Linux - Hardware 3 08-26-2004 11:11 PM
How do you auto mount a USB memory stick ? KiwiPingu Linux - Newbie 1 07-29-2004 05:44 PM
How do I mount a USB flash memory stick? brian Linux - Newbie 3 02-07-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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