It is possible mount a flash drive without read permission?

  • 2
    What do you mean by “without read permissions”? Do you want to prevent reading all the files and listing the directory contents? Will you at least allow traversing directories? What's the filesystem? What are you trying to achieve? Apr 10, 2014 at 22:26
  • @Gilles Do you want to prevent reading all the files and listing the directory contents? yes... that's exactly what I want. I'm working in a app (udev-independant) for controling flash drives permissions. Apr 11, 2014 at 12:39
  • So what's the filesystem? Apr 11, 2014 at 13:26
  • Well, right now I'm working with vfat. Apr 11, 2014 at 13:27

1 Answer 1


You can choose the permissions of the files and directories on a vfat filesystem in the mount options. Pass fmask to indicate the permission on files that are not set, and dmask for directories — the values are the same as in umask. For example, to allow non-root users to only traverse directories but not list their content, and create files and directories and overwrite existing files but not read back from any file, you can use fmask=055,dmask=044 (4 = block read permission, 5 = block read and execute permissions). You can assign a group with more or fewer permissions; for example, if you want only the creator group to be allowed to create directories, you can use the options gid=creator,fmask=055,dmask=046.

This is a handy way of preventing the creator of a file from reading back the data written to the file. However, this is a rare requirement, and it has the considerable downside of not allowing the creator of a file to read back the data written to the file.

  • Thanks, perfect!!! One last question, there is some way to do this with mount function (from "sys/mount.h")? Apr 14, 2014 at 15:31
  • @RaydelMiranda You'd normally do this by calling the mount program, or indirectly depending on whether you want to trigger the action from a hardware hook (e.g. udev) or from an unprivileged process. Apr 14, 2014 at 20:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .