Click to See Complete Forum and Search --> : FAT32 and permissions HELP!!


zanzan11
07-09-2002, 03:32 PM
I mounted a fat32 partition, but cannot set permissions for the files / directories.

I've tried mounting it as auto, vfat, umsdos all with the same effect. I cannot change permissions on a fat partition.

ps: I AM logged in as root and none of the directories are open in any apps. :confused:

fancypiper
07-09-2002, 06:45 PM
Fat32 is a Windows filesystem and doesn't use permissions as does Lunux filesystems such as ext 2, ext 3, reiserfs. xfs, etc.

JohnT
07-09-2002, 09:02 PM
Try formatting it as Fat16 and see if that works.

bdl
07-09-2002, 09:27 PM
As was mentioned, FAT/FAT32 (or NTFS for that matter) cannot be altered with chmod, chown or any other manner that would allow you to change permissions on the filesystem or files therein. You can however, mount the filesystem in such a way as to trick it into giving you the perms you want. What you'll need to do is (either by hand or within your fstab), use the 'user' option when mounting. In doing so, you can pass the argument 'umask' to the mount and therefore mount it with the permissions you want.

Let's say you want to mount your Windows partition, with permissions so only you can read-write to it. You'll pass the 'user', 'uid', 'gid' and 'umask' arguments to the mount command like so:

prompt# mount -t vfat -o rw,user,uid=1000,gid=100,umask=027 /dev/hda1 /mnt/windows

(subsitute your partition, mount point, uid and gid)

What this is saying is, mount the partition as you (UID 1000), with the group 'users' (GID 100) and give it 'rwx-r_x-___' permissions. Only you will be able to read-write to the partition. This, IMHO, is the most usefull way to do it. You can, of course, leave out the 'uid' and 'gid' parms, but then only root will be able to access the partition. If you want to make this permanent so it mounts appropriately each time you boot the system, add it to your /etc/fstab file:


## /etc/fstab example entry
## mount a vfat filesystem with permissions

/dev/hda1 /mnt/windows vfat rw,user,uid=1000,gid=100,umask=027 0 0



That'll do it. Please check the 'mount' manpage for details --> prompt$ man mount. Luck!