(Linux) User group has no permissions to mounted volume?

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
I have an NTFS partition that contains my documents, music, etc and I want to access it through Linux. It mounts fine, as /media/win, but only root can list the contents of the directory. For users, it lists permission denied. What do I need to do so users have read access?

I right clicked /media/win under nautilus when it was unmounted and set users permission to the aforementioned but it still says the same thing. I also tried it when it was mounted (probably shouldn't have because it could have actually changed permissions on the NTFS volume).

Here's how the permissions are set up when the volume is unmounted (nautilus under superuser mode here):

http://xtknight.atothosting.com/permissions1.jpg

'andy' still can't list /media/win when mounted. What's wrong? Do I need to set user ID (what's that do?)

Clarification: right clicked /media/win under nautilus.

Here's the corresponding fstab line:
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Check the man page for mount. NTFS volumes are mounted readable only by root by default. There are some options you can list in fstab to change that behavior.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
The users can't even read it (only root). I could give NTFS Captive a try I guess but every other distro on my system works fine with the mounted built-in ntfs driver so it's probably just some little permissions thing I have to change.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: xtknight
The users can't even read it (only root)...
Yes, I know. That's what it says in the man page I'm referring to.
...so it's probably just some little permissions thing I have to change.
Yes, it is. Look in the ntfs section of that man page.

 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Oh, oops, I missed your part about root. I'll go give that a shot. Apparently this won't do it then ("ro,user"):
/dev/sda1 /media/win auto ro,user 0 0
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Thanks. Apparently I needed to make it this instead:

/dev/sda1 /media/win auto ro,users,umask=777 0 0

Edit: hmm.. now stuff is all FUBAR like directories showing up as files (and some files still don't want to list). That only happens with umask=777 though. :( Oops, lol, umask isn't the same as the chmod-like permission thing. :eek:
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Try umask=000 if your kernel NTFS support is read-only (the default). It looks like the permissions start at 555 (instead of the usual 777) in that case, presumably since writing is unsupported. So you can get some very strange results, as you're seeing. umask=000 will make the files/directories 555 - 000 = 555 = rx for everyone, which seems to be what you want.

edit: This isn't quite right - 022 should be fine. It looks like perms start at 777 like you'd expect. I'm not sure what I was seeing before.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: xtknight
Oops, lol, umask isn't the same as the chmod-like permission thing. :eek:
It's related. Something like the inverse of it, actually. Try the umask manpage.

 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Oops, it needed to be umask=0022. That seems to work. What does 0022 allow?

umask sets the umask to mask & 0777.

Hmmmm...

(so, for example, the common
umask default value of 022 results in new files being created with per-
missions 0666 & ~022 = 0644 = rw-r--r-- in the usual case where the
mode is specified as 0666).

Well I guess that answered my question. It says only 'new files' though?
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: xtknight
It says only 'new files' though?
Yes, in that context. When you use the umask command it only affects newly created files/dirs. Mounting NTFS is the same idea, but it works by applying the umask to a base permission of 0777 for all existing files/dirs on the partition. So umask 0022 gets you 0777 & ~0022 = 0755, which (if you don't have NTFS write support in the kernel) gets forced to 0555 = rx for all.

 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Look in mount_ntfs(8) (or the equiv on Linux) for something like:
-u uid Set the owner of the files in the file system to uid. The default owner is the owner of the directory on which the file system is being mounted.

-g gid Set the group of the files in the file system to gid. The default group is the group of the directory on which the file system is being mounted.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The user option means nothing if you have it auto mounted. 'user' means that a user can mount/umount the filesystem and when the user mounts it they own it, but if it's mounted on bootup it's mounted by root.