LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-05-2005, 10:48 AM   #1
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
Help adding USB card reader to /etc/fstab


I have a multi slot USB card reader. (internal)
the reader has 4 slots, each on different lun's
they use scsi emulation to mount each slot.

the problem however is this...

the card reader does not detect any cards that were not inserted dureing boot-up.

Attempting to mount a card inserted after boot-up gieves an error that there is no such partiton /dev/sdd1.

the solution is to use "hdparm -z /dev/sdd" to case the kernel to re-scan the partiton table.

after this, the card can be mounted sucessfully.

I am trying to setup my computer so that this process is done automatically.

Im getting close, but have not managed to think of a *perfect sollution*

my current solution....

I changed the file-sytem entery in fstab to read *card*.
e.g. /dev/sdd1 /mnt/sd card noauto,user,sync 0 0

then i wrote a script called /sbin/mount.card

this script is a mount helper script, and if automatically called by mount when mouting an fstab enters with filesystem = "card"

this heler script uses sudo to run hdparm -z /dev/device.
and then uses sudo again to mount the device.

This allows all users to mount the card as normal...

the problem.....

when mounting the disk with sudo in this fassion, mount logs the card as mounted with the following options..

/dev/sdd1 on /mnt/sd type vfat (rw,noexec,nosuid,nodev,sync)

The mount is of file-system vfat, and owned by root.

which means, that the normal user cannot un-mount the device.

ALSO, as the file-system is nolonger registered as "card" (there is no such filesystem) i cannot use an un-mount helper to unmount the card with SUDO.

WHAT is the solution here !?

i just need normal users to be able to mount and un-mount the memory card with normal mount tools suck as KDE.
(kde mounts removal media by calling "mount" with the mount point as the one and only parameter (uses fstab for other settings))

HELP !
 
Old 10-05-2005, 02:49 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I think all you need is the umask option for the fstab line. umask allows anyone to access it. Example:
Code:
/dev/sdd1               /mnt/sdd1               auto    umask=000,users,noauto,owner,rw,sync,dirsync   0 0
Brian1
 
Old 10-05-2005, 03:35 PM   #3
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
Thanks for that, it was just a type error... i used "user" option intead of "users"

THANKS !
 
Old 10-05-2005, 04:51 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Been there and done similiar mistakes myself. Glad to here you have it working.

Brian1
 
  


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
USB jumpdrive/ USB hud-card reader issues o0gnubee0o Linux - Hardware 4 07-03-2005 06:12 PM
USB card reader doctorwebbox Linux - Hardware 1 03-04-2005 11:09 PM
USB multi-card reader; only one card can be mounted in Slack 10. KidsWriter71 Linux - Hardware 6 09-11-2004 07:24 PM
Recognizing USB card reader when card is inserted hqo201 Fedora 0 08-02-2004 05:08 PM
USB card reader LittleFox Linux - Hardware 4 03-17-2004 06:03 PM

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

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