Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 10-16-2005, 08:16 PM   #1
LQ Newbie
Registered: Oct 2005
Posts: 3

Rep: Reputation: 0
Unhappy Non-root write access to a USB drive (ext2) ??

Hi all,
I've googled around for some hours and I can't find a straight answer to this question...maybe there isnt' one!
I want to use my USB external drive as backup storage, so I need write permission as non-root. The filesystem is ext2, and my fstab file states the typical line:
/dev/sda1 /media/usbdisk auto pamconsole,exec,noauto,fscontext=system_u: object_r:removable_t,managed 0 0
I have read permissions to the drive as non-root, but can't write. Any ideas will be much remuch appreciated.
(Fedora Core 3)
Old 10-16-2005, 09:15 PM   #2
Senior Member
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,437

Rep: Reputation: 95
Try to add this option: users
Old 10-17-2005, 12:58 PM   #3
LQ Newbie
Registered: Oct 2005
Posts: 3

Original Poster
Rep: Reputation: 0
I did but it did not work . The line now reads as
/dev/sda1 /media/usbdisk auto pamconsole,users,exec,noauto,fscontext=system_u bject_r:removable_t,managed 0 0
When I issued mount /media/usbdisk I looked into /etc/mtab file and got the line
/dev/sda1 /media/usbdisk ext3 rw,nosuid,nodev,fscontext=system_ubject_r:removable_t,user=jmborr 0 0
so according to /etc/mtab, I (jmborr) has write access (rw). However, when I cd to /media/usbdisk and touch junk I got:
touch: cannot touch `junk': Permission denied.
By the way, after mounting /media/usbdisk, the directory still belongs to root:
drwxr-xr-x 4 root root 4096 Oct 16 21:09 usbdisk
Shouldn't the ownership have changed to "jmborr" ? jose
Old 10-17-2005, 02:07 PM   #4
LQ Newbie
Registered: Oct 2005
Posts: 3

Original Poster
Rep: Reputation: 0
I found two quick and dirty ways to gain write access:
One, after mounting as single user, switch to root and change access bits to /media/usbdisk (chmod go+w usbdisk)

Two, chown jmborr:jmborr usbdisk

But these have nothing to do with the mounting process, and one needs root access .
Old 10-17-2005, 02:38 PM   #5
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 55
Add a gid and umask to the fstab line.


The above options will make it root:users with permissions of 775


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Only root access to automounted USB drive denis1314 Linux - Software 11 07-19-2005 09:01 AM
Read and write USB device with non-root access halfzware_shag Linux - Hardware 3 10-11-2004 04:26 AM
External USB drive -- only WRITE as root 1kyle Linux - Hardware 0 08-03-2004 10:00 AM
when I mount my usb hard drive, I have to be root to access it? nakedpretzel Linux - Hardware 2 02-27-2004 09:47 PM
usb pen drive - only root can write? BrianK Linux - Newbie 3 01-29-2004 12:50 AM > Forums > Linux Forums > Linux - Hardware

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration