1 |
Apparently, though unproven, at 17:58 on Sunday 03 October 2010, Mick did |
2 |
opine thusly: |
3 |
|
4 |
> On Sunday 03 October 2010 16:39:53 Nikos Chantziaras wrote: |
5 |
> > On 10/03/2010 05:13 PM, Mick wrote: |
6 |
> > > Hi All, |
7 |
> > > |
8 |
> > > On a box which dual boots into MSWindows I mount a ntfs partition using |
9 |
> > > fstab as follows: |
10 |
> > > |
11 |
> > > /dev/sda9 /mnt/data ntfs-3g defaults,noatime,locale=en_GB.utf8 |
12 |
> > > 0 0 |
13 |
> > > |
14 |
> > > however, when I ls the contents all files and directories are shown as: |
15 |
> > > |
16 |
> > > (d)rwxrwxrwx |
17 |
> > > |
18 |
> > > The problem is that these are different to the MSWindows rights and |
19 |
> > > also if I untar any fs in there then the access rights of that tarred |
20 |
> > > fs are not retained. |
21 |
> > > |
22 |
> > > What is an appropriate way to configure this so that the Linux user has |
23 |
> > > the same access rights as the MSWindows user? |
24 |
> > > |
25 |
> > > PS. I have set up a UserMapping file, but this has not made any |
26 |
> > > difference. |
27 |
> > |
28 |
> > AFAIK, it's not possible. Windows access rights are totally different |
29 |
> > than Unix ones. |
30 |
> : |
31 |
> :-( OK, thanks. |
32 |
|
33 |
I don't have ntsf-3g installed here, and have no use for it, and can't be |
34 |
arsed to install it to check :-) |
35 |
|
36 |
But, it's mount command ought to obey the usual permission model for using |
37 |
foreign filesystems on Unix, which is: |
38 |
|
39 |
As the models are so different and can't be mapped one to another sanely, |
40 |
mount fudges the permissions. Basically, it assigns the same umask and |
41 |
ownership to every object on the volume. The default is umask=0000, |
42 |
owner=root:root (actually 0:0), but that's just a default and it can actually |
43 |
be anything. Look into the docs for such mount options as |
44 |
|
45 |
uid |
46 |
gid |
47 |
umask |
48 |
fmask |
49 |
dmask |
50 |
|
51 |
The last two are from vfat, they just let you use one mask for directories and |
52 |
another for files (which is quite sane actually - otherwise you get every file |
53 |
on the volume being executable which is crazy). |
54 |
|
55 |
Assuming your uid is 1000, primary group 1000, you can then use options |
56 |
something like: |
57 |
|
58 |
uid=1000,gid=1000,dmask=0007,fmask=0117 |
59 |
|
60 |
which gives a sane unix-like set of permissions. Nothing close to windows but |
61 |
a) you don't have to be root to use it and b) the www user can't trash your |
62 |
files on the ntfs volume. |
63 |
|
64 |
Like I said, I've never used ntfs-3g but the above is a pretty common |
65 |
permissions model and it's reasonable to assume ntfs-3g probably implements it |
66 |
or something similar. As always, read the fine docs and YMMV. |
67 |
|
68 |
|
69 |
-- |
70 |
alan dot mckinnon at gmail dot com |