LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-30-2003, 09:02 PM   #1
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Rep: Reputation: 30
accessing usb reader


Thanks to help from finegan and others in this previous thread http://www.linuxquestions.org/questi...threadid=96788
and lots and lots of help from other areas of this forum I have purchased and mounted a usb compact flash card reader. All of this inspite of the fact that I am a newbie.

Here's the little snag of a problem: I can only access my pictures on the compact flash card when logged on as root. I can't get to them when logged on as my regular user. I know instructions for changing this are out there, but I've looked at them and so far they haven't clicked with my poor little brain.

Could somebody give clear instructions on how to permanently change the permissions on my mounted reader? Something so simple as this has escaped my grasp for hours on end.

Thanks so much for the help.
 
Old 10-01-2003, 01:09 AM   #2
carlywarly
Member
 
Registered: Feb 2003
Location: Sunny Southport, again.
Distribution: PCLinuxOS 0.93 and 0.92, Vector sometimes
Posts: 825

Rep: Reputation: 30
Use a program called KwikDisk. You should find it under - Start - Configuration - Hardware - KwikDisk. Start the program. A small icon of 3 cubes - red/green/blue - should appear on the Taskbar. Click it nad choose Start KDiskFree. You should see an entry for your usb drive at the bottom of the window, probably as sda1. Click on the icon and choose Mount. That should do it. Remember to unmount it before you remove the drive.....
 
Old 10-01-2003, 08:04 AM   #3
dems
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat, Mandrake, Gentoo
Posts: 7

Rep: Reputation: 0
Rundi,

Do you have devfs installed? With devfs installed, as a regular user, I just put the card in the reader and an icon appears on my desktop (in gnome, not sure about kde) for the reader called "removable". Devfs mounts the reader /dev/sda1 at /mnt/removable. This may work for you...

Have you tried the chmod command? If your reader is mounted at /mnt/reader, execute the following as root:
chmod 777 /mnt/reader
Then try to mount the reader as a non-root user and see what happens...

Daniel
 
Old 10-01-2003, 10:00 AM   #4
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Original Poster
Rep: Reputation: 30
What I've got

Thanks for the replies.

It doesn't look like I made myself clear enough. I already have mounted my camera as sda1. It will appear on the desktop of my normal user. The problem is that I can't access the photos as a regular user, only when logged in as root. I want to change this, and I need to know how.

Daniel -

I am a newbie, so what do you mean by devfs installed as a regular user? I have devfs installed somewhere, but I don't know what they do, where they are, or under who they are installed. All I can tell you is what I do to get the camera to work under root.

On my regular user desktop in gnome on Mandrake 9.1 I plug in my usb device. It is recongized. Then I log onto a root console and mount it by typing the command you listed, Daniel. I can open the folder "removable" or "camera" (depending on which I've mounted it as) but I can't see the folder inside "removable" or, when I can see it I can't open it because it says I don't have permission/not owner etc etc. However, in the root console I can see the folder, and all the pictures inside the folder (Aaarrgh! Very frustrating)

Everything works hunky-dory when I log onto the GUI as root.

Is my problem caused by the fact that I mount the card reader while logged into console as root, so only root can access the card? That is what it seems like you are saying from your message.
 
Old 10-01-2003, 10:36 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
With the camera unmounted what are the permissions of the directory.

Do you have users and umask=000 options in the fstab entry for sda1?
 
Old 10-01-2003, 10:42 AM   #6
dems
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat, Mandrake, Gentoo
Posts: 7

Rep: Reputation: 0
Rundi,

Sorry for the confusion about devfs. Devfs can only be installed as root. I meant that if I have devfs installed, the icon for the reader just appears on the gnome desktop when I log in to a non-root account and plug in the reader. Does that make sense?

The problem is that the card is mounted as root, and the non-root users don't have permission to read the files. Is there a line in the /etc/fstab file for the camera/reader? If not, there should be. If there is a line, it may need to be changed to allow non-root users to access the reader. See this page http://www.cs.sfu.ca/~ggbaker/personal/cf-linux - particularly the "Final Setup" section.

Hope this helps.

Daniel
 
Old 10-01-2003, 02:20 PM   #7
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Rep: Reputation: 18
Following others' suggestions, take a look at /etc/fstab:

Try this line: (/mnt/memory_card is the mount point, put it wherever you like it)

/dev/sda1 /mnt/memory_card vfat noauto,user,rw 0 0

The option "user" above should allow user to mount the memory card. See if this helps you. It is true that typically only the person that mounts the drive gets to see the contents of it.

It is strange that Mdk 9.1 does not properly set up the permissions for you. I am also using Mdk 9.1, and somehow the contents of my /etc/fstab changes as it wishes (which I hate very much, actually).

Wirawan
 
Old 10-01-2003, 03:33 PM   #8
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Original Poster
Rep: Reputation: 30
Changing things

I am about to change the fstab. But I am curious . . . below is the old line. Could anyone tell me what it is currently doing? It looks pretty crazy.

/dev/sda1 /mnt/removable auto user,iocharset=iso8859-1,kudzu,codepage=850,noauto,umask=0,exec 0 0
 
Old 10-01-2003, 05:35 PM   #9
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Original Poster
Rep: Reputation: 30
I got it working

Thanks to all who replied. I really appreciate it.

Following the instructions supplied by the link given by Daniel I got my card to be readable by my regular user. Yaaah!

This is great, and I am happy, but could Daniel, michaelk, wirawan, or someone else, please explain the varations in the fstab line? I want to learn, and I've no idea what was wrong with the fstab that was initially put in there for the device by Mandrake.

Also was does wirawan's command of:

/dev/sda1 /mnt/memory_card vfat noauto,user,rw 0 0

do different from:

/dev/sda1 /mnt/flash vfat noauto,user 0 0

which is what I found at the link provided by Daniel. The only difference between these two is the rw in the first, but both commands are completely different from the original in Mandrake.

I would like to be educated.
 
Old 10-02-2003, 06:56 AM   #10
dems
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat, Mandrake, Gentoo
Posts: 7

Rep: Reputation: 0
Rundi,

Glad it's working! For help with the fstab file format, run "man fstab" or "man mount". These man pages explain all the thousands of options for mounting filesystems. The "rw" in wirawan's post means read-write, but it might not be required to use your reader...

Enjoy using your card reader...

Daniel
 
Old 10-03-2003, 11:09 AM   #11
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Rep: Reputation: 18
Just curious about post #8: Rundi, was that line the one you had beforehand? (I.e., the one that prevented you from reading the card's content unless you're root?)

The option `user' means that users can mount the device. And only that user can unmount it. (Of course root can bypass everything :-)

Typically only the user that mounts the device will have access to the device. I'm not certain if this is 100% correct. But too bad I don't have the card with me. Let me take a similar example: /mnt/floppy (the diskette drive). The options are similar to your /mnt/removable. When I mounted the diskette:

wirawan $ mount /mnt/floppy

and I check the directory /mnt/floppy with `ls -dl', here's the answer:

drwxr--r-- 2 wirawan wirawan 3584 Dec 31 1969 /mnt/floppy/

So I'm the one that pretty much can access the floppy. Others can't, as the other's permission is only `read', with no `execute' right at all! This may be the source of your problem. If you mount the device as root, then you must be root in order to read from it.

The other options are somewhat bell-and-whistle things. `codepage' and `iocharset' options are for dealing with different character sets (remember, not all systems out there use ASCII). The `exec' option allows you to execute files from the floppy. If you don't like this (or are concerned with security), it's best to change this to `noexec'. For FAT filesystems (msdos, fat, vfat), try adding option `showexec'. This will make your `ls' output not ALL-GREEN. :-) It will only mark *.bat, *.com, and *.exe as green (which is nice).

Option `kudzu' is fairly new. I still don't know what use of it. It has to do with hardware autodetection (is it right?).
 
Old 10-03-2003, 12:43 PM   #12
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Original Poster
Rep: Reputation: 30
fstab

The line in post #8 was from my fstab before I did any changes. In other words, I assume, something in that line was screwing me up.

Instead of the line in post #8 I followed the link Dems gave and (as per the instructions in the section Final Setup) put in the text:

/dev/sda1 /mnt/camera vfat noauto,user 0 0

in the fstab. I could then mount the card reader at /mnt/camera as my regular user. Before I could only mount it as root. When I tried to mount it as user I got the message that only root could do it.

From the circumstantial evidence I would gather that something in my old fstab was keeping my "user" from mounting the camera. Would it have something to do with the "auto" bit, or the "umask"?
 
  


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 jumpdrive/ USB hud-card reader issues o0gnubee0o Linux - Hardware 4 07-03-2005 06:12 PM
Accessing Photosmart 7350 card reader youngtom Linux - Hardware 0 03-01-2005 01:40 AM
USB media reader irish rebel Linux - Hardware 0 08-10-2004 10:01 AM
USB card reader bitpicker Linux - Hardware 2 10-20-2003 07:40 AM
USB CF Reader entwisi Linux - Software 0 01-21-2002 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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