[Hampshire] Re: fstab question

Top Page

Reply to this message
Author: Owain Clarke
Date:  
To: hampshire
Subject: [Hampshire] Re: fstab question

> On Mon, Aug 06, 2007 at 04:25:04PM +0100, Owain Clarke wrote:
>
>> I have this line in /etc/fstab:-
>>
>> /dev/hdb1  /windows/e  ntfs  ro,users    0    0

>>
>> The intention is that I can read files in this partition as an ordinary
>> user - I'm not interested in writing to it as I haven't investigated the
>> current state of play with writing to NTFS. But when I try to open the
>> directory to read I get a permission denied message, with access as
>> read-only for root and none for anyone else. What have I got wrong?
>>
>
> NTFS doesn't use the same permissions scheme as UNIX filesystems, so
> you have to tell it in the mount options which user/group will own the
> files and what their permissions should be. The "user" option
> merely allows a non-root user to mount the fs; what you end up with
> is still an fs with all files owned by root.
>
> See "uid", "gid" and "umask" options.
>
> Cheers,
> Andy
>


> The problem is that Windows filesystems don't deal with file permissions
>
> very well, so by default the whole partition is owned by root.
>
> You can fix this problem by setting the group ID the partition is mounted
> with to one your user is a member of, like this:
>
> /dev/hdb1  /windows/e  ntfs  ro,users,gid=1000    0    0

>
> Where 1000 is the group ID. You can also add other users to this group to
> give them read access.
>
> Hope that helps,
> Mark
>


> NTFS file permissions are far more complex than standard Unix ones,
> so Linux doesn't even attempt to map between them. Instead, it sets a
> single set of permissions over the whole filesystem at once, with
> mount options. Instead of "ro,users", you probably want something like
> "ro,user,uid=myuser,gid=mygroup,umask=0222". (Note: "user", not
> "users"). The umask value will give you read and execute for all users
> on all objects within the filesystem. You may want to use 0220
> instead, which will allow read and execute for the specified user and
> group only.
>
>    This is covered, briefly, in the "ntfs" section of "man mount".

>
>    Note that "user" as an option in fstab will allow non-root users to
> mount the filesystem, and only the user which mounts it to be able to
> unmount it afterwards. It has nothing to do with permissions on the
> filesystem itself.

>
>    Hugo

Thanks a lot guys
Owain