Apparently, though unproven, at 17:58 on Sunday 03 October 2010, Mick did 
opine thusly:

> On Sunday 03 October 2010 16:39:53 Nikos Chantziaras wrote:
> > On 10/03/2010 05:13 PM, Mick wrote:
> > > Hi All,
> > > 
> > > On a box which dual boots into MSWindows I mount a ntfs partition using
> > > fstab as follows:
> > > 
> > > /dev/sda9    /mnt/data    ntfs-3g   defaults,noatime,locale=en_GB.utf8
> > > 0 0
> > > 
> > > however, when I ls the contents all files and directories are shown as:
> > > 
> > > (d)rwxrwxrwx
> > > 
> > > The problem is that these are different to the MSWindows rights and
> > > also if I untar any fs in there then the access rights of that tarred
> > > fs are not retained.
> > > 
> > > What is an appropriate way to configure this so that the Linux user has
> > > the same access rights as the MSWindows user?
> > > 
> > > PS.  I have set up a UserMapping file, but this has not made any
> > > difference.
> > 
> > AFAIK, it's not possible.  Windows access rights are totally different
> > than Unix ones.
> :
> :-(  OK, thanks.

I don't have ntsf-3g installed here, and have no use for it, and can't be 
arsed to install it to check :-)

But, it's mount command ought to obey the usual permission model for using 
foreign filesystems on Unix, which is:

As the models are so different and can't be mapped one to another sanely, 
mount fudges the permissions. Basically, it assigns the same umask and 
ownership to every object on the volume. The default is umask=0000, 
owner=root:root (actually 0:0), but that's just a default and it can actually 
be anything. Look into the docs for such mount options as 

uid
gid
umask
fmask
dmask

The last two are from vfat, they just let you use one mask for directories and 
another for files (which is quite sane actually - otherwise you get every file 
on the volume being executable which is crazy).

Assuming your uid is 1000, primary group 1000, you can then use options 
something like:

uid=1000,gid=1000,dmask=0007,fmask=0117

which gives a sane unix-like set of permissions. Nothing close to windows but 
a) you don't have to be root to use it and b) the www user can't trash your 
files on the ntfs volume.

Like I said, I've never used ntfs-3g but the above is a pretty common 
permissions model and it's reasonable to assume ntfs-3g probably implements it 
or something similar. As always, read the fine docs and YMMV.


-- 
alan dot mckinnon at gmail dot com

Reply via email to