LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2006, 07:26 AM   #1
thefinalxia
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
how can I mount an fat32 partition with full access for a normal user? (FC5)


Hi all,

I'm about to run out of space on my 60GB hdd (/dev/hda3), and I happen to have an extra 40GB hdd (/dev/hdb1) installed, which is a fat32 partition.

I now have the line below in my /etc/fstab

*
*
/dev/hdb1 /mnt vfat defaults 1 1
*
*

But after hdb1 has been (automatically) mounted, all the files on it has an ownership as "root:root".. and I would like to have hdb1 mounted under one of the normal user $HOME dir, with full access for a normal user. (which will make my life much more easier)..

I know it's all in the man pages, and I've read it many times.. Guess I really could use some help..

Thanks!

Last edited by thefinalxia; 04-08-2006 at 07:29 AM.
 
Old 04-08-2006, 07:33 AM   #2
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 30
The thing you need to change is the defaults bit, which defines the option with which the device is mounted. You'll need to know what your user ID (or UID) is - not your login name, but an actual number which represents your user to the system. You can issue the following command to find out (if you're curious, it displays all the lines from the login file /etc/passwd, filters them to only display the ones with your login name, then only shows the third field which is your UID):
Code:
cat /etc/passwd | grep <your username> | cut -d: -f3
Then, change 'defaults' to defaults,users,uid=<your user ID> and when you next mount the drive you should have the right permissions.

The reason being that non-Linux filesystems like FAT don't store file permissions, so Linux has to guess at them - and defaults to making it root-accessible. The uid=<UID> line tells Linux to consider that user as the owner of the files on the device (and you can also use gid= to set the owning group, should that be necessary). IIRC, you can also pass these options on the command line if you're mounting something manually as root but want to access is as a normal user.

Last edited by Dtsazza; 04-08-2006 at 07:36 AM.
 
Old 04-08-2006, 07:42 AM   #3
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
Quote:
Originally Posted by thefinalxia
Hi all,

I'm about to run out of space on my 60GB hdd (/dev/hda3), and I happen to have an extra 40GB hdd (/dev/hdb1) installed, which is a fat32 partition.

I now have the line below in my /etc/fstab

*
*
/dev/hdb1 /mnt vfat defaults 1 1
*
*

But after hdb1 has been (automatically) mounted, all the files on it has an ownership as "root:root".. and I would like to have hdb1 mounted under one of the normal user $HOME dir, with full access for a normal user. (which will make my life much more easier)..

I know it's all in the man pages, and I've read it many times.. Guess I really could use some help..

Thanks!
Change the fat32 line to:
/dev/hdb1 /mnt vfat auto,user,umask=000,exec 0 0

The "auto,user,umask=000,exec" part is important.
 
Old 04-08-2006, 10:36 AM   #4
thefinalxia
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the quick reply!

The problem is solved, for now.

Stillso much remains to be learned..
 
Old 04-10-2006, 03:02 AM   #5
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
Quote:
Originally Posted by thefinalxia
Thanks for the quick reply!

The problem is solved, for now.

Stillso much remains to be learned..
You'll learn new things every day for a long time to come.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't access ntfs partition as normal user rezzie Linux - Newbie 6 11-26-2005 09:09 AM
Automatically mount Windows partition with full access? Josh1billion Linux - Newbie 6 10-02-2005 01:41 AM
How to give cdrom access for user & can i mount FAT32 partition atomatically on boot? Ninja_212 *BSD 3 03-09-2005 04:01 PM
Debian normal user cant mount windows shared partition silverstormboy Debian 3 01-14-2005 08:25 AM
Access my windows partition as a normal user necbrownie Slackware 5 10-13-2004 05:22 PM


All times are GMT -5. The time now is 11:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration