Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On linux, the base permission for a file is 666 and for directories, it is 777. With a umask=022, new files and directories have permissions 644 and 755 respectively.

When I mount a usb drive with umask=022, new files and directories both have permissions 755. Why is that so?

share|improve this question

marked as duplicate by Gilles, jasonwryan, slm, Anthon, Renan Jun 8 '13 at 13:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You could simply have had a look at the man page for mount (8)... –  Hauke Laging Jun 7 '13 at 7:23
    
Sorry about the close vote, I somehow clicked on the wrong tab. –  Gilles Jun 7 '13 at 22:19

1 Answer 1

On a vfat file system no real unix rights are stored. Thus umask blocks from the maximum rights possible. If a file is created then the creating process usually does not set execute bits but the file system cannot store this information (thus has to assume that these bits are set).

You can use dmask and fmask to set different values for files and directories. But you will not be able to execute files (directly) then.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.