LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 11-29-2008, 09:52 PM   #1
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 109Reputation: 109
auto mounting usb flash drive


OK I'm a bit lost on this one. I made sure that I'm in the standard groups (including 'plugdev') and that the newly plugged in device is owned by the group plugdev but simply typing "mount /dev/sda1 /media/flash0" does not work (even tried group owning /media/flash0 to plugdev)

so do I really need to install a package or make udev rules/scripts to add lines to /etc/fstab in order to mount the device as a regular user?

I didn't try with KDE tools (I use blackbox and xterm)

If I didn't own an iPod I probably would add a ton of lines in fstab all dealing with /dev/sd?? derivatives... but that would be messy. BUT I like what I did with my ipod by having udev rules to sym link /dev/ipod to /dev/sd?2 (whatever it happens to be) then fstab contains a line in it for /dev/ipod to /media/ipod

I was playing with writing a script already to automatically create sym links in /dev named after the partition labels and then creating directories in /media and mounting it (didn't finish yet)

I guess in addition to that script (run by udev when the device is plugged in/ejected) I will have to make it add lines into the fstab??

That just seems messy. It doesn't seem like I should have to add lines in the fstab (regardless of custom names... I realize for custom names I would probably have to do it.)

###
So Is this right or is there an easier way that slackware already supports?

I plan on creating a script flashhandler.sh
###
plug in device
udev handels some stuff
udev rules run /lib/udev/flashhandler.sh $device start
flashhandler does some safty checks, creates sym links, (adds fstab lines???), mounts the drive
user 'ejects' the device
udev rules run /lib/udev/flashhandler.sh $device stop
flashhandler cleans everything up

###
 
Old 11-29-2008, 11:00 PM   #2
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,259

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
With the stock Slackware 12.1 the USB drive should be recognized automatically. Before you manually mount:

Are rc.hald, rc.udev, and rc.messagebus all executable?

From the command line, before and after you insert a USB drive, as root run the lsusb and lsscsi commands. If the three mentioned services are running, you should see the drive added.

If the problem you are experiencing is KDE only, then in the Control Center, in KDE Components, Service Manager, ensure both KDED Media Manager and Media Notifier Daemon are enabled.
 
Old 11-29-2008, 11:04 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.0
Posts: 2,231

Rep: Reputation: 573Reputation: 573Reputation: 573Reputation: 573Reputation: 573Reputation: 573
If you want to mount devices as a regular user, aside from using sudo, you can install pmount, which should do the trick (I've also heard of ivman, which does more automated stuff I think). I am pretty sure that blackbox doesn't have automounting tools that utilize HAL, so you will definitely have to install pmount if you want to use HAL to mount devices as a regular user.

Of course, sudo is an option if you just need access to the `mount` command.
 
Old 11-29-2008, 11:53 PM   #4
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Original Poster
Rep: Reputation: 109Reputation: 109
Thought so.... I did see reference to pmount somewhere on my searches but I was looking for a non install option... I especially don't want to use pmount if it is 'set uid' to root.

I'll probably finish up my script to see how well it works I think the only problem I'll have is inserting lines into and deleting lines from /etc/fstab

I haven't had much practice with that.
 
Old 11-30-2008, 11:37 PM   #5
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Original Poster
Rep: Reputation: 109Reputation: 109
Lightbulb Solution

In case anybody else is interested and to promote the use of the LQ blogs... Here is the solution the was I was thinking about it. Enjoy.

http://www.linuxquestions.org/blog/l...r-script-1357/

Last edited by lumak; 11-30-2008 at 11:39 PM.
 
  


Reply

Tags
automount, flash, usb


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-Mounting USB Flash Drive plehman Linux - Newbie 12 01-05-2009 09:41 AM
fedora 7: autofs is not mounting USB flash drive or DVD ROM drive Hewson Linux - General 3 05-12-2008 08:58 AM
SuSE 9.3 USB Flash Drive Auto Mount Stopped Working nuro305 Linux - Hardware 11 04-15-2007 05:21 AM
how come usb flash drive doesn't get auto mounted? darkhatter Fedora 5 02-26-2006 08:04 PM
auto-mounting USB drive slzckboy Linux - General 4 01-12-2006 03:56 PM


All times are GMT -5. The time now is 02:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration