• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

writing to FAT partitions

how do you mount FAT16/FAT32 partitions so that any non-root user (or better yet, specified non-root users) can *write* on it?
  • 2
1 Solution
DOS does not store permissions like ext2 does.  by using lines in fstab liek the following

dev/hda1      /mnt/fat16 vfat user,exec,dev,suid,rw,umask=0000 0 0
/dev/hda5      /mnt/fat32 vfat user,exec,dev,suid,rw,umask=0000 0 0
/dev/hda6      /mnt/ntfs  ntfs user,exec,dev,suid,rw,umask=0000 0 0

the drive will be mounted with a deafault permission of 777 (the binary invers of 000) modified only if a file is read only.

the above lines from my fstab include a fat16, a fat32, and an NTFS partition.. they all work, and I can read write to all of them  (you only get access to NTFS if you enable it in the kernal, and it comes with dire warnings of not working properly but it seems to be fine for me)

As to getting it so only certain users can access the drive, you'd have to do something like:

place the lines in fstab, set so it wont mount at boot time
only allow certain users permission to use mount

then they need to mount the partition whenever they want  to use it, and other users can mount anything at all.

such is the drawback of a DOS file system.

(BTW:  if you use type MSDOS instead of VFAT, it will work but you lose long file names)
Alex_TanAuthor Commented:
Good answer (and I'll give it an A cos it answered what I really wanted to know) but the thing about limiting access to mount is still a kludge. I suppose this might well be necessary with DOS partitions but to limit access to mount might cause problems with things like access to /dev/fd0, if you get what I mean. This might well be a feature in some systems but not all...
you dont need to mount a floppy to use it.  you can use mcopy, mdir, mdel etc to access a floppy without mounting it (which is teh way you have to do it if you want to be secure about it)

FAT will never be secure though.  NTFS might be, but the linux implementation of teh write function is still in beta.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now