LinuxQuestions.org
Review your favorite Linux distribution.
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 10-03-2006, 11:02 PM   #1
Sigkill(9)
Member
 
Registered: Jan 2005
Location: Dallas/TX
Distribution: OpenBSD/FreeBSD/Debian/Mac OS X
Posts: 40

Rep: Reputation: 15
Mount Ext3 Writeable for Specific Users


Hello,

I have searched the forums and cannot find an answer.

My dilemma is this:

I want to be able to let the user with say uid=1000,gid=1000 have write access so i can scp files through
the machine to the mounted usb drive.

Right now only root can write to the drive.

Due to file size limitations I do not want to use fat or fat32.

I also don`t care about windows compatability as I am now free of that wretched environment.

it doesn`t seem that ext2 or ext3 supports the uid,gid option.

Am i using the wrong fs maybe?

Please advise,

The Machine is configured as follows:
Debian Sarge
2.6.8-2-686


250GB external usb drive.
Partioned as follows.

me@sarge:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 250.0 GB, 250059350016 bytes
240 heads, 63 sectors/track, 32301 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 12918 97660048+ 83 Linux
/dev/sda2 12919 32301 146535480 83 Linux

Thank you in advance,
 
Old 10-04-2006, 05:42 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Try adding these lines to your /etc/fstab file. Substitute the mount points for the ones that you want. You can change the word "auto" to whatever file system type you are using such as ext2 or ext3.
Code:
/dev/sda1            /mnt/sda1                    auto        user,gid=1000        0 0
/dev/sda2            /mnt/sda2                    auto        user,gid=1000        0 0
You can add more options such as noexec and nosuid, which I recommend doing. I just wanted to put in the options that you need to be able to mount the device with a normally privileged user account in the 1000 user group.
 
Old 10-04-2006, 08:12 AM   #3
Sigkill(9)
Member
 
Registered: Jan 2005
Location: Dallas/TX
Distribution: OpenBSD/FreeBSD/Debian/Mac OS X
Posts: 40

Original Poster
Rep: Reputation: 15
Hey thanks,

Though, For portability purposes I need to use the command line method

mount /dev/sda1 /mnt/usb -t ext3 -ogid=1000

so I can take it with me and access it on other machines.

This does not seem to work.

Any idea why?

Also,
That didn`t work

me@sarger:~$ sudo mount -a
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

syslog entries:

EXT3-fs: Unrecognized mount option "gid=1000" or missing value

Last edited by Sigkill(9); 10-04-2006 at 08:17 AM.
 
Old 10-04-2006, 08:44 AM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Put a space between the o and the g in the term -ogid=1000. It should read -o gid=1000.

Nevertheless this still won't work because a normally privileged user cannot give himself rights, which is implied in the -o gid=1000. The mount command looks in the /etc/fstab file to find out whether the normal user account has the right to mount the drive. You can use the sudo command to execute a command as root.
Code:
sudo mount ...
When it asks you for a password you give it the password of the normal user account, not the root password. The normal user account has got to be listed in the /etc/sudoers file.

I don't think that there is a portable way for normally privileged users to mount a file system without doing something to the operating system first. Whether you have to edit a line in /etc/fstab or whether you add the user account in /etc/sudoers you still have to do something to a normal system configuration before a normal user account can mount a file system.
 
Old 10-04-2006, 09:07 AM   #5
Sigkill(9)
Member
 
Registered: Jan 2005
Location: Dallas/TX
Distribution: OpenBSD/FreeBSD/Debian/Mac OS X
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Put a space between the o and the g in the term -ogid=1000. It should read -o gid=1000.
The space didn`t make a difference ...

EXT3-fs: Unrecognized mount option "gid=1000" or missing value

Those aren`t valid options for ext2||ext3.

I found a workable solution HERE.

In case you don`t want to follow the link:


sudo mount /dev/hda1 /mnt/usb
sudo chmod 777 /mnt/usb


Thanks again for the help.

Last edited by Sigkill(9); 10-04-2006 at 09:09 AM.
 
  


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
mounting usb pen drive as writeable for other users linuxmandrake Ubuntu 19 03-18-2006 07:57 PM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
world writeable files will not stay world writeable antken Mandriva 1 03-02-2004 05:04 PM
making a vfat mount point writeable for users stevenhasty Linux - Newbie 27 03-31-2003 09:30 PM
HELP! Error from mount: drive is write-protected... won't mount writeable. system Linux - General 2 12-27-2001 09:08 PM

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

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

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