Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

setting permissions for a mounted fat32 partition

Posted on 2006-03-30
8
Medium Priority
?
1,686 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?

 
0
Comment
Question by:basicinstinct
8 Comments
 
LVL 25

Accepted Solution

by:
Cyclops3590 earned 200 total points
ID: 16338533
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
0
 
LVL 23

Author Comment

by:basicinstinct
ID: 16338840
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.
0
 
LVL 10

Expert Comment

by:Luxana
ID: 16339598
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Author Comment

by:basicinstinct
ID: 16339975
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)


0
 
LVL 10

Expert Comment

by:Luxana
ID: 16340043
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.

0
 
LVL 10

Expert Comment

by:Luxana
ID: 16340053
did you try this: #mount -o remount,rw  /windows/d

try it and then run #mount and paste it here
0
 
LVL 43

Assisted Solution

by:ravenpl
ravenpl earned 200 total points
ID: 16340056
> 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
0
 
LVL 23

Author Comment

by:basicinstinct
ID: 16340553
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.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension . This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its cont…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question