LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-13-2008, 12:40 PM   #1
digerati1338
Member
 
Registered: May 2007
Location: CO
Distribution: Ubuntu
Posts: 152
Blog Entries: 1

Rep: Reputation: 18
Setting Fstab Permissions


I just switched distributions to Debian. I'm trying to set up fstab to auto-mount my windows partition to /media/winc. It works fine, but only root has read/write permissions. No other users can even see the contents. I want normal users to have read-write as well. I've done this many times before, but it isn't working for me now. Here are the options I'm using:
Code:
/dev/hda2  /media/winc  ntfs  defaults  0  0
Any Ideas?
 
Old 01-13-2008, 01:32 PM   #2
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
In the options field, add this:
umask=000

This is easy to remember, and works. The downside of using this one, is that every file gets execute permissions, and thats not a good thing. Therefore I recall someone who said the fmask and dmask would be better suiting (file/directory mask) to use as you can have different mask for files and folders. That way you can have all rights to the folders, and limited rights to the files.

fmask=111,dmask=111

If you use this instead of umask, the files are not executable. Files got permission rw- and folders rwx. It's convenient to use in fstab, but PITA when you mount manually.

Edit:
Uhm. If you're unsure of what field is the options field, this is your complete line to add in the fstab:
/dev/hda2 /media/winc ntfs defaults,fmask=111,dmask=111 0 0

Last edited by Dinithion; 01-13-2008 at 01:35 PM.
 
Old 01-13-2008, 01:53 PM   #3
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
You can also chown -R the directory and then mount it by putting these options in fstab:
defaults,rw,nls=utf8,gid=1000,uid=1000,umask=0022
 
Old 01-13-2008, 02:33 PM   #4
digerati1338
Member
 
Registered: May 2007
Location: CO
Distribution: Ubuntu
Posts: 152

Original Poster
Blog Entries: 1

Rep: Reputation: 18
The umask option let me view the contents, but I cannot write as a normal user or root. Operation not permitted.

Last edited by digerati1338; 01-13-2008 at 04:11 PM.
 
Old 01-13-2008, 04:39 PM   #5
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
Oh, of course. You have to use ntfs-3g and fuse to get write permission to NTFS.
 
Old 01-13-2008, 05:43 PM   #6
digerati1338
Member
 
Registered: May 2007
Location: CO
Distribution: Ubuntu
Posts: 152

Original Poster
Blog Entries: 1

Rep: Reputation: 18
Got it working now. Thanks.
 
Old 01-14-2008, 06:50 PM   #7
sonichedgehog
Member
 
Registered: Oct 2007
Location: London UK
Distribution: Fedora Core 17
Posts: 298

Rep: Reputation: 32
I was tempted to start a new thread but this seems appropriate. I run dual boot Vista/debian lenny and have just created a small FAT32 partition as a Linux/Windows interface, my fstab is:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda4 / ext3 defaults,errors=remount-ro 0 1
/dev/sda6 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sda5 /home/dos msdos user,noauto 0 0

My permissions are fine. Only trouble is: I have to mount sda5 manually- instinct tells me that I should erase/replace (Foo Fighters are great aren't they?) the noauto but I've got the thing working so I don't want to mess it up unless someone wiser than I can guide me a little.

I'm also a bit freaked out by the fact that, before I mount the partition, /home/dos has a few files in it that I put in just after I did mkdir dos and before I got fstab sorted- then they disappear when the partition is mounted and I see what I expected, ie files created in both Windows and Linux. Only to come back again after unmount.

This partition is accessible in both media and home/dos after mounting- is this normal or have I created a monster?

I don't have to solve this but would like to learn how so any comments will be most welcome- Phil
 
Old 01-15-2008, 02:05 AM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Yes, get rid of the "noauto", you shouldn't use that unless you want to prevent partitions from being mounted automatically. The option is used most often for floppies and cds.

Those files disappearing is perfectly normal. When you mount a partition on a mount point, it places itself over anything that was already there. When it gets unmounted, the files reappear. The best option is not to store anything at all in a directory that serves as a mount point.

Neither is there anything freaky about the partition being accessible from two places. It is just what happens when you use the "noauto" option.

And you may want to modify your file system type. msdos is used for floppies, if it's really a fat32 partition, you should use vfat instead.
 
Old 01-16-2008, 03:03 PM   #9
sonichedgehog
Member
 
Registered: Oct 2007
Location: London UK
Distribution: Fedora Core 17
Posts: 298

Rep: Reputation: 32
followed your suggestion jay73, job done. Thank you!- Phil
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab permissions sall Linux - General 3 08-07-2005 12:57 PM
fstab ntfs and permissions zorlock Linux - Newbie 1 11-17-2004 04:06 AM
fstab permissions problem drigz Linux - General 8 05-09-2004 01:32 PM
/etc/fstab and permissions jeff1500 Slackware 7 03-27-2004 08:15 PM
Permissions and fstab help The SIN Raven Slackware 18 11-21-2003 05:54 PM

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

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