Gentoo Archives: gentoo-user

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Re: ntfs-3g access rights Nganon <nganon+gentoo@×××××.com>