2009-12-12 02:26:10     Permission issue with directory create

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-12 02:26:10     Permission issue with directory create

Jayakumar Ananthakrishnan (INDIA)

Message: 83407   

 

Hi,

 

When I create directories on mounted pen drives with permissions other than "777" it is not set though I set dmask,fmask, umask to 0 while mounting the device.

 

Command used for mounting the pen-drive(FAT32):

 

mount /dev/sda1 mnt/ -o dmask=0,fmask=0,umask=0

 

Command used for directory creation:

 

mkdir -m 755 /mnt/test

 

Dir permissions set when checked with "ls -l" is "drwxrwxrwx"

 

I expect the directory permission to be "drwxr-xr-x"

 

Anybody have any explanation why this happens.

 

Thanks in advance,

 

Jai

QuoteReplyEditDelete

 

 

2009-12-12 05:41:22     Re: Permission issue with directory create

Mike Frysinger (UNITED STATES)

Message: 83424   

 

if you want a POSIX compliant FS, dont use VFAT.  the mount option dictates the mask used for *all* dirs.

QuoteReplyEditDelete

 

 

2009-12-12 07:07:22     Re: Permission issue with directory create

Jayakumar Ananthakrishnan (INDIA)

Message: 83426   

 

I am not clear with your explanation.

 

My understanding - Mask can only reduce the user level file/ directory creation permission, but it can't increase the permission.

 

i.e, if mask=0, then how can it change 755 to 777 while creation.

 

My objective is to mount a FAT32 drive and create files/ directories with the user level permission passed while file/dir creation. If VFAT can't be used, please suggest some other options.

QuoteReplyEditDelete

 

 

2009-12-12 07:53:04     Re: Permission issue with directory create

Mike Frysinger (UNITED STATES)

Message: 83427   

 

like i said, VFAT is not a POSIX compliant filesystem.  it has no way of storing permissions, so the only thing that gets used is 777 & (mask you gave at mount time).

 

pick a real linux file system if you want real permission / ownership control.

QuoteReplyEditDelete

 

 

2009-12-13 03:18:15     Re: Permission issue with directory create

Jayakumar Ananthakrishnan (INDIA)

Message: 83459   

 

Thanks Mike, I shall check for alternatives and update

QuoteReplyEditDelete

Attachments

    Outcomes