LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-26-2005, 05:20 PM   #1
Avatar33
Member
 
Registered: May 2003
Location: South Africa
Distribution: Ubuntu
Posts: 75

Rep: Reputation: 15
Mounting a drive as my user


Hi all.

I'm trying to mount an ext3 drive as my user. I can get this to work by adding the "user" option to mount or fstab.
But if I look at the permissions of the directory, the owner and group is root meaning that I can not create files in the directory.
Code:
drwxr-xr-x  4 root root 80 2005-09-26 23:58 /mnt/extDrive
I've looked through the mount man page and not found a way to do this, so sorry if this is a stupid question.

Any suggestions would be appreciated, because it's really inconvenient to work as root all the time when working in this directory.

Thanks
Avatar
 
Old 09-26-2005, 06:14 PM   #2
tomj88
Member
 
Registered: Apr 2005
Location: Wolverhampton, England
Distribution: Ubuntu
Posts: 334

Rep: Reputation: 30
I'm not sure, but maybe adding umask=000 next to user in /etc/fstab (seperated by a comma so user,umask=000) should mount the drive with the permisions 777 so should be writeable by everyone, otherwise you can mount it with gid or uid options I think, I can't really remember so try google or wait for another reply
 
Old 10-04-2005, 04:09 PM   #3
NomadX
Member
 
Registered: Jul 2005
Location: Portland, OR
Distribution: Debian Testing
Posts: 78

Rep: Reputation: 15
Actualy...

For security reasons, it would be best to mount the drive specificly for the user you want to have access, i.e.

/dev/hda5 /mnt/D vfat rw,user,uid=1000,gid=100 0 0

in your /etc/fstab .... noauto is another good security idea, but if your lazy like me you wont use it, heh...

DrS
 
Old 10-05-2005, 01:55 AM   #4
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
All of that would work perfectly if the Avatar33 was mounting an vfat or fat disk. However, he is asking about ext3 :-)

With ext3, /mnt/extDrive will get the permissions and ownership of the root of the floppy. So you first need to mount the floppy, then assign ownership of the root of the floppy to you (using chown), and then all will be fine.

Groetjes,

Kees-Jan
 
Old 10-05-2005, 04:27 PM   #5
NomadX
Member
 
Registered: Jul 2005
Location: Portland, OR
Distribution: Debian Testing
Posts: 78

Rep: Reputation: 15
Unhappy Doh!

Dunno if I read that wrong or there was something in my coffee or what...

So what tom said, as root do something like:

chmod 777 /dev/hdb1
mkdir /stuff
and in fstab, /dev/hdb1 /stuff ext3 auto,user,owner,rw 0 0

then do mount -a

if this I wrong I may have to shoot myself

DrS
 
Old 10-05-2005, 04:46 PM   #6
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Re: Doh!

Quote:
Originally posted by DrStoney
Dunno if I read that wrong or there was something in my coffee or what...

So what tom said, as root do something like:

chmod 777 /dev/hdb1
This will add nothing, since mount is suid root.
Quote:
mkdir /stuff
and in fstab, /dev/hdb1 /stuff ext3 auto,user,owner,rw 0 0
the owner option allows the owner of the device file (i.e. /dev/hdb1) to mount the volume. So in order for this to be useful, you have to do a chown on /dev/hdb1. However, since you also specified user, which allows any user to mount the volume, the owner option doesn't add much.

To make matters worse, all of this still won't guarantee that the user is able to write in /stuff. For that, you need an addtional chown on /stuff, after mounting it.

Please do be carefull with firearms ;-)

Groetjes,

Kees-Jan
 
Old 10-06-2005, 01:01 AM   #7
NomadX
Member
 
Registered: Jul 2005
Location: Portland, OR
Distribution: Debian Testing
Posts: 78

Rep: Reputation: 15
Hmmmm

You are absolutely right. I will use a rope.

DrS
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting my CD/DVD with my own user jaakkop Slackware 1 01-13-2005 08:32 AM
Mounting samba drive as user... elluva Linux - Networking 8 05-25-2004 08:35 PM
slackware 9.1 mounting problems (cd drive, cd writer drive, win partition (ntfs)) mr.gizm0 Slackware 8 05-11-2004 06:23 PM
Mounting a network drive so a normal user can rwx it J.Q. Monkey Linux - Newbie 4 02-20-2004 07:17 AM
Mounting as user qcoder Linux - General 3 11-29-2003 12:00 PM

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

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