LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Making mounted FAT32 partition writable by all (https://www.linuxquestions.org/questions/fedora-35/making-mounted-fat32-partition-writable-by-all-180849/)

jrittvo 05-12-2004 06:21 PM

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.

jrittvo 05-12-2004 06:31 PM

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.

ben_build#2.1.0 05-12-2004 07:19 PM

Re: Making mounted FAT32 partition writable by all
 
Quote:

Originally posted by jrittvo
/dev/hdc3 /mnt/LinTrans vfat defaults 0 0
try this:

Code:

/dev/hdc3  /mnt/LinTrans  vfat  user,rw    0 0
Having defaults under mout options gives you no permissions to mount the swap drive with anything other than root.

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.

cristiroma 05-24-2004 01:10 PM

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.

gandalf2041 05-24-2004 02:27 PM

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
take a look at the mount man page for more details.

cristiroma 05-25-2004 04:43 AM

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.

gandalf2041 05-25-2004 07:40 AM

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.

tomhemba 05-27-2004 10:56 PM

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

jrittvo 05-27-2004 11:10 PM

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)

cristiroma 05-28-2004 01:22 PM

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.

tomhemba 05-28-2004 09:07 PM

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

jrittvo 05-28-2004 09:17 PM

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.

tomhemba 05-28-2004 11:11 PM

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

cristiroma 05-29-2004 02:30 AM

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" ?

xenithi 06-07-2004 02:39 AM

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.