LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-19-2004, 06:02 PM   #1
durden2.0
Member
 
Registered: May 2003
Distribution: redhat 9.0
Posts: 113

Rep: Reputation: 15
fstab options


I am having trouble finding the correct options to put in my fstab to fix my permissions on a fat partition. I have a partition that I use for mp3s and everything in the file is owned by root. I would like the mp3s and such on the partition to be owned by a regular user. Here is my fstab line:

/dev/hda5 /media vfat user,umask=000 0 0

I hope this makes sense, and I have found similar posts about this problem but none seemed to fix it for me. Thanks for the help everyone.
 
Old 01-19-2004, 06:12 PM   #2
ash4stuff
Member
 
Registered: Aug 2003
Location: Viena
Distribution: Debian Sarge
Posts: 139

Rep: Reputation: 15
try this:



/dev/hda5 /media vfat exec,rw,umask=000 0 2

although it is good practice to put mounts under /mnt (/mnt/media i.e.)
 
Old 01-19-2004, 06:19 PM   #3
durden2.0
Member
 
Registered: May 2003
Distribution: redhat 9.0
Posts: 113

Original Poster
Rep: Reputation: 15
Ok I made that change but everything is still owned by root under that partition and I can't change the ownership still. I get the operation not permitted error. Is there something else I am doing wrong? Also could you explain the reason for the choice of options you gave me, I am just curious and want to learn he he. Thanks again
 
Old 01-19-2004, 08:04 PM   #4
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
That umask value (000) will allow anyone to do anything in the media directory from this point on, changing the permissions to "rwxrwxrwx" for that directory........................When trying to change ownership for the already existing files, did you use the 'chown' command as root:
Code:
chown -R <username here>:users /media
 
Old 01-19-2004, 08:26 PM   #5
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
I don't think you can change the ownership of the files on an FAT file system. Whoever mounts the file system owns the files. If you mount it automatically, then all the files will be owned by root. If you must have them 'owned' by a normal user, you can mount the file system manually as a normal user if you have user or users option set in fstab. But umask=000 should allow you to do everything you want with the files even if they are owned by root. (they are not really owned since fat filesystem doesn't support file ownership).
 
Old 01-19-2004, 09:10 PM   #6
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
Your right...............vfat is a pain

In that case, you _can_ set the ownership through fstab using the 'uid=' and 'gid=' options. You will need to know the id numbers for the user (uid) and the group (gid). To easily find them, run this command:
Code:
cat /etc/passwd | grep -i <username here>
You'll get some output similar to this (this is mine):
Code:
thegeekster:x:1002:100:geekster:/home/thegeekster:/bin/bash
The first four-digit set of numbers is the 'uid', the second three-digit set of numbers is the 'gid'.........................FYI, the first field is the username, the third field is the user id (uid), the fourth field is the group id (gid), the fifth field is the user's full name, the sixth field is the user's home directory, and the last field is the default shell for the user. I'm not sure what the x in the second field is, except maybe to enable/disable the user (just a guess).

Anyway, in fstab you want to set the options for your vfat directory like so:
Code:
/dev/hda5    /media    vfat    defaults,umask=000,uid=1002,gid=100    0 0
Just be sure to use the numbers for your username. That'll set the user and group attributes to match the user....................After making any changes, you'll need to 'umount /dev/hda5' then run 'mount -a' to let the changes take effect.

But as quatsch pointed out, with the umask=000 option alone, anyone can do anything in that directory. This was just to show you how it can be done.
 
Old 01-19-2004, 09:23 PM   #7
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
make sure the folder /media is set to 777 permissions (chmod 777 /media)

try adding the option "auto" (without quotes) to that fstab line; that way whenver a user logs on, the partition is mounted by that specific user
 
Old 01-19-2004, 09:41 PM   #8
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
Quote:
Originally posted by TheOneAndOnlySM
make sure the folder /media is set to 777 permissions (chmod 777 /media)

try adding the option "auto" (without quotes) to that fstab line; that way whenver a user logs on, the partition is mounted by that specific user
The umask=000 option is the same as the 'chmod 777' command and the 'defaults' option includes 'auto'.

From the man pages for mount:
Code:
defaults 
     Use default options: rw, suid, dev, exec, auto, nouser, and async.
 
  


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
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
auto and bind options in fstab kaplan71 Linux - Networking 1 05-18-2005 08:58 AM
Options in /etc/fstab seem not to apply when device is mounted. dr_zayus69 Linux - Hardware 2 03-07-2005 06:28 AM
What're the default grub and fstab options for SuSE 9.1? gavinbeatty Linux - Distributions 2 10-10-2004 05:08 PM
Kernel 2.6.2 options question - LOCKED options ? tvojvodi Linux - General 0 02-17-2004 04:23 AM


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