We help IT Professionals succeed at work.

setting permissions for a mounted fat32 partition

basicinstinct
on
Medium Priority
1,704 Views
Last Modified: 2012-05-05
I have a dual boot system (SUSE 10 / WIN XP).  My hard disk has a shared fat32 partition.  My problem is, the fat partition is mounted in SUSE under /windows/d but I can't seem to write to it unless I am operating as root.  

I first tried changing my fstab file to include this line:
/dev/hda5           /windows/d              vfat           users,owner,rw,umask=000 0 0

That didn't work.  

Then I got very confused when I found there was also a file called mtab which had an entry for windows/d, so I changed that line to be exactly the same as the one in fstab.  Why is there an fstab and an mtab?  What's the difference?  Which one is used? Which takes precedence?

Then I opened a terminal, changed to su and used chmod thus:
chmod /windows/d 777 -Rv
The command executed without error and said it changed the permissions, however I still could not write to the fat partition unless logged in as root.  

I checked the permissions on windows/d in Konqueror, and they had not been changed - only root had full access.  So I opened Konqueror as root and changed to permissions  to give full access to everyone, applied to all subdirectories and files.  Konqueror accepted this command, appeared to apply the permissions, but as soon as I closed the 'properties' window and opened it again the changes were lost - once again only root has full access.

All I want is to have write access to my fat32 permission when not logged in as root.  Any ideas?  Or should I just give up on linux and go back to windows?

 
Comment
Watch Question

Sr Software Engineer
CERTIFIED EXPERT
Commented:
You need to change the attributes in the fstab file. Change the line to
/dev/hda5    /windows/d   vfat     umask=000,users,owner,rw,uid=<the user id you want to be able to write as>,gid=<the group id you want to write with> 0 0

FAT32 doesn't have permission capability so you trick it with providing a uid and gid at mount

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Hi Cyclops
thanks for your suggestion.  My fstab and mtab now contain the line:
/dev/hda5 /windows/d  vfat  umask=000,users,owner,rw,uid=1000,gid=100 0 0

I'm afraid that hasn't seemed to fix it, I still can't write to the fat partition.

I got the uid and gid by typing 'id' in the terminal.  The output was:
uid=1000(rick) gid=100(users) groups=16(dialout),33(video),100(users)

I don't have to reboot do I?  I tried closing my session and then logging back in.  I also changed to su and entered 'umount -a' followed by 'mount -a'.

I'm not sure if it makes any difference, but I am not accessing the linux machine directly, I am connecting over a LAN from a winXP laptop using VNC Viewer.  I doubt this makes any difference but thought I should mention.

Any further ideas appreciated.

Commented:
Hi, are you sure that it is fat32 partition? Can you run
# fdisk -l  and post output here?

tun :
# mount

to see how are partition mounted.

if your partition is mounted os ro then simply run:

#mount -o remount,rw  /windows/d

this will remount partition to rw.

> chmod /windows/d 777 -Rv <== this are only permition to folders.

good luck

lubo

Author

Commented:
hi lubo - thanks for the comments
here is the output from 'fdisk -l' and 'mount'

#fdisk -l
Disk /dev/hda: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *          72        1019     7614778+   7  HPFS/NTFS
/dev/hda2            1020        9580    68766232+   f  W95 Ext'd (LBA)
/dev/hda3               1          71      570276   83  Linux
/dev/hda4            9581        9733     1228972+  82  Linux swap / Solaris
/dev/hda5            1020        3569    20482843+   b  W95 FAT32
/dev/hda6            3570        4595     8241313+  83  Linux
/dev/hda7            4596        6125    12289693+  83  Linux
/dev/hda8            6126        9580    27752256   83  Linux

Partition table entries are not in disk order

Disk /dev/hdc: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1        2434    19551073+  42  SFS

Disk /dev/hdd: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1               2         638     5116702+   f  W95 Ext'd (LBA)
/dev/hdd2             639        2434    14426338+   c  W95 FAT32 (LBA)
/dev/hdd5               2         638     5116671    b  W95 FAT32

#mount
/dev/hda6 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda3 on /boot type ext3 (rw,acl,user_xattr)
/dev/hda7 on /home type ext3 (rw,acl,user_xattr)
/dev/hda8 on /usr type ext3 (rw,acl,user_xattr)
/dev/hda1 on /windows/c type ntfs (rw)
/dev/hda5 on /windows/d type vfat (umask=000,users,owner,rw,uid=1000,gid=100)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/fd0 on /media/floppy type subfs (rw,nosuid,nodev,noatime,fs=floppyfss,procuid)
/dev/hdc1 on /mnt/storeii type ntfs (rw)
/dev/hdd2 on /mnt/oldc type vfat (rw)
/dev/hdb on /media/dvdrecorder type subfs (ro,nosuid,nodev,fs=cdfss,procuid,iocharset=utf8)


Commented:
Correct me if I'm wrong by this /dev/hda5 on /windows/d type vfat (umask=000,users,owner,rw,uid=1000,gid=100) is needed to setup partiton with NTFS filesystem.

You have already mounted FAT32 on /dev/hdd2  /mnt/oldc type vfat (rw). Check you /etc/fstab and adjust the line for /dev/hda5 according /dev/hdd2 and you should be fine.

Commented:
did you try this: #mount -o remount,rw  /windows/d

try it and then run #mount and paste it here
Top Expert 2005
Commented:
> I don't have to reboot do I?
It seemed to be missed.
Yes. Either You have to remount the partition or restart the machine.
try:
umount /windows/d
mount /windows/d

Author

Commented:
Well surprise surprise - I rebooted my computer and it works now.  It's hard for me to know what fixed it in particuler, and I'm grateful to all you experts who took the time to help.  

I think the suggestion from Cyclops to set the gid and uid was a necessary part of the fix, and raven told me that I actually did have to reboot the machine (by the way, umount /windows/d followed by mount /windows/d did not work).  So I think I will split the points between those two.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.