fstab partition automounted but can't write to it [SOLVED]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

fstab partition automounted but can't write to it [SOLVED]

Postby PeguinMints on Tue Feb 05, 2013 5:55 pm

After searching on the forums I managed to automount a partition.
This guide http://forums.linuxmint.com/viewtopic.php?f=42&t=22093 resulted in a hang on boot so I edited the fstab file with
Code: Select all
/dev/sdaxx /home/user/sharedfat   vfat   rw,user   0   0

The partition mounts but it's locked. I can read it but however I play with the persmissions I can't write to it.


Anyone know what I'm missing??
Last edited by PeguinMints on Wed Feb 06, 2013 1:08 am, edited 1 time in total.
PeguinMints
Level 1
Level 1
 
Posts: 4
Joined: Sat Jan 12, 2013 10:43 am

Linux Mint is funded by ads and donations.
 

Re: fstab partition automounted but can't write to partition

Postby altair4 on Tue Feb 05, 2013 8:24 pm

Your partition will mount with with root as owner and permissions of 755. Root has read/write permissions everyone else has only read permissions. If you are the only user take posession of the mounted partition and remove the options that make no sense:
Code: Select all
/dev/sdaxx /home/user/sharedfat   vfat   defaults,uid=1000   0   0

I'm assuming your uid is 1000. TO find out run the following command:
Code: Select all
id

If you have multiple local users then make permissions available to all:
Code: Select all
/dev/sdaxx /home/user/sharedfat   vfat   defaults,umask=000   0   0


Then unmount the partition:
Code: Select all
sudo umount /home/user/sharedfat

And then run the following command that will test for errors and if there are none mount the partition without requiring a reboot:
Code: Select all
sudo mount -a
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6279
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab partition automounted but can't write to partition

Postby PeguinMints on Wed Feb 06, 2013 1:06 am

Awesome that worked like a charm.
I've reading about fstab http://www.tuxfiles.org/linuxhelp/fstab.html but it makes no mention of the uid you used.
Could you post a link to the site you used for my future reference.
PeguinMints
Level 1
Level 1
 
Posts: 4
Joined: Sat Jan 12, 2013 10:43 am

Re: fstab partition automounted but can't write to it [SOLVE

Postby altair4 on Wed Feb 06, 2013 7:50 am

You're not going to like this but most of what you need is already on your system:
Code: Select all
man mount

The link you gave is one of the more coherent references to fstab but it's very Linux filesystem centric and somewhat outdated. I prefer the "template" approach that Fred uses in his HowTo, it just needs updating:
/dev/sdxx /home/fred/Data vfat umask=0000,uid=1000,gid=1000,auto,rw,users 0 0


** The current approach to specifying the device name is to use either UUID or LABEL. You would find both by executing this command:
Code: Select all
sudo blkid -c /dev/null

** rw and auto are in the defaults so there really is no reason to explicitly state them as long as some option is used - although I prefer to use the option "defaults".
** Never understood why Fred used the "users" option since the last thing you want is for any old user to unmount the partition ( and the "user" options makes no sense either since the only user present when the system executes fstab is root ).

So a modern fstab template would look something like this for FAT32:
Code: Select all
UUID=C4DB-C1B0 /media/WinE vfat defaults,utf8,uid=1000,umask=000 0 2

Even here there is some redundancy. "umask=000" will make it accessible to every local user including whoever is "uid=1000" so you really don't need both options. I like to keep it in so that I can send something to the trash without getting an error message and so that I can use Nautilus / Nemo to create a samba share. The utf8 option is for character encoding and to tell you the truth I think it happens by default now - sometimes I add these things out of habit.

And by manipulating uid, gid ( group name or id ), and umask you pretty much have complete control over who can access the partition and with what privileges.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6279
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab partition automounted but can't write to it [SOLVE

Postby dodgefan on Sun Feb 10, 2013 7:53 pm

***EDIT*** never mind, changed it to
Code: Select all
/dev/md0 /raid1 ext4 defaults 0 0

and just changed the permissions on the mount point itself...duh
***EDIT***

sorry to bring this thread back up but im having this same issue

i have a raid 1 array at /dev/md0 and im trying to mount it at /raid1, so in my fstab i have

Code: Select all
/dev/md0 /raid1 ext4 defaults 0 2


and it will mount fine, but i cant write to it

so if i change it to something like this (gid 1050 is the group i made to access this mount point)

Code: Select all
/dev/md0 /raid1 ext4 gid=1050,umask=000,auto,rw 0 2


i get an error that says Unrecognized mount option "gid=1050" or missing value (read at dmesg | tail)

how do i get it to mount and have rw access for all my local users?
-Jerry
Mopar or No Car
Dodge Fan For Life
User avatar
dodgefan
Level 1
Level 1
 
Posts: 47
Joined: Wed May 28, 2008 10:45 am
Location: Kannapolis NC USA


Return to Newbie Questions

Who is online

Users browsing this forum: Google Adsense [Bot], nerdtron and 34 guests