Making mounted FAT32 partition writable by all
Fedora Core 2, kernel 2.6.5-1.358. Dual boot WindowsXP and Fedora, with a small FAT32 partition set up to move files back and forth.
I have the FAT32 partition mounting off of fstab and I can read, write, rename and delete in it as root, but as a regular user, which I want to be most of the time, I can only seem to get read access. At present, when I need to move a file into it logged in as a regular user, I am opening the Super User File Browser. Is there a way to set permissions on the mounted partition so that the user directly has full rights without having to get into any of the SU stuff???? If, logged in as root, I try right-clicking on the mounted folder, and changing the permissions (or owner) through the Property tab, the changes are not sticking or it says I'm not allowed to make them. The entry in my fstab is: /dev/hdc3 /mnt/LinTrans vfat defaults 0 0 Any advice will be greatly appreciated. |
I see this now from earlier today, and it will probably get me close, but how would I alter it to allow read/write access to ALL users?
------------------------------------- For the FAT32 partition try something like the following in /etc/fstab: code:-------------------------------------------------------------------------------- /dev/hdXn /mnt/data vfat quiet,showexec=no,uid=floyd,umask=007 0 0 -------------------------------------------------------------------------------- Change the device and the mountpoint to correspond to your system. Having every file with the permissions of 777 looks like the result of having "umask=000". Using the option of "showexec=no" will stop everything from being marked as executable. Since you're the only user of the system then you can use the "uid=floyd" option, or whatever your user name is, so you can change the umask to "umask=007" to remove write access from other non-user uids. Other users being the system users that are used by various programs. This has no affect on the access to the FAT32 other than in linux. |
Re: Making mounted FAT32 partition writable by all
Quote:
Code:
/dev/hdc3 /mnt/LinTrans vfat user,rw 0 0 I included the rw option because rw stands for Read-Write, and I didn't know If you need that there on a swap drive. |
If you succeed with kernel 2.6.x please let mere mortal here know it works, as I suspect a problem in the vfat support. I trying for a week on a 2.6.6 to make it work and always get the same result - failure.
cristian. |
This is actually a design issue in vfat. It doesn't support Unix permissions; therefore, it will take the ownership of the user at mount time (this is why root works). Try changing your fstab entry to something like:
Code:
/dev/hdc3 /mnt/LinTrans vfat gid=<enter users gid here>,umask=000 0 0 |
You are right, this works as you said for 2.4.x kernel, but for me, in 2.6 i cannot get it work.
For a reason it always mounts the directory with: 32K drwxr--r-- 18 root root 32K Jan 1 1970 fat_e no matter what I write in fstab ( uid/gid/umask etc. ) Besides the rights, there is also the year: 1 Jan 1970, altough the date of files inside the fat_e directory preserve their original date. Cheers. |
Thanks for setting me straight :) I wasn't aware that the behavior was different in the 2.6 kernel. Looks like I'll need to do some experimentation.
|
I'm having the same problem. I can't figure out a way to make my vfat partition (for dual boot system) read/writable for anybody but root.
Anyone with a solution please let us know Thomas |
You need to use "umask" to control the permissions. "umask=000" grants rwx to all categories. You want to use the "rw" option too, to have it mounted as read/write. The umask=000 and rw end you up with rwxrwxrwx permissions. "root" will still show as owner and group, but you can copy a file off the VFAT drive and the owner and group will change to the user for the copy, if that is important to you. My fstab entry (that now works!!!) is:
/dev/hdc3 /mnt/LinTrans vfat rw,umask=000 0 0 (Note: this is working on a 2.6.5 kernel, too) |
This is like twilight zone :)
I could swear that yesterday didn't work no matter what I wrote in fstab and today put your entry and worked. Don't know if matters but last night i resized that vfat partition. Anyway...thanks a lot! Cristian. |
Hmmm. What am I doing wrong?? I still can't get it to work. This is what I'm doing:
I log in as user I use su to mount hda5 thus: mount /dev/hda5 /home/files Then I go into fstab and add this line (per suggestion above): /dev/hda5 /home/files vfat rw,umask=000 0 0 Then I log out and log back in again as user and I'm not able to write to hda5. Any suggestions?? Thomas |
You need the line in fstab when you BOOT. fstab doesn't get "loaded" when you just login/out.
Once you save your fstab with that line in it, and you do a full reboot, you won't even need to do the mount command any more. fstab will do the mounting for you at boot time, every time, and it will stay mounted even as users or root log in or out. The umask permissions didn't get applied for you because they only get applied if they are in your fstab when you BOOT. |
Thanks. That was it. Now it's working like a charm.
While were on the topic, do you know if it is possible to mount this vfat partition at the /home directory. I tried to do this (after getting the rw permissions to work) and users were no longer able to log in. Thomas |
You can mount a partition in any dir you want to, but notice that mounting a partition within a directory you can no longer access the old content of the directory ( what was before mount ) until unmount that partition. Why would you mount the vfat in "/home" ?
|
could anybody help?
now i have this fat32 partition.. i can read/write to it fine in any user. i just wanted to put the /usr and /home to that partition. i've put a symlink. problem is the owner of the files in that partition is always 'root'. but even if i log in root, i can't change the owner of a file there. so i can't log in on my regular user cause 'root' owns my /home directory in that partition. |
All times are GMT -5. The time now is 12:39 PM. |