Can't read NTFS partition from Linux

Zelmo3

Senior member
Dec 24, 2003
772
0
0
On my dual-boot laptop I have a directory that I want accessible to both Windows XP and Linux, so I have it on the Windows partition. I put the following line in my /etc/fstab:

/dev/dha1 /mnt/hda1 ntfs ro,users 0 0

so that I can mount and unmount the partition as a regular user and can't accidentally try to write to it, and the mount point has the following permissions:

drwxr-xr-x 2 root root 4096

When I mount the volume the permissions change thus:

dr--r--r-- 1 root root 8192

But when I try to read the volume as a regular user I get "Permission denied."
I thought I'd found the answer by adding a umask option to the fstab, but it didn't change anything (tried 0000 through 0777).
Can anyone tell me how to access the partition as a regular user? Also, if you can explain the umask values that'd be swell. The man page didn't say much about it.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
umask is the permissions that are not present, so you would want 0000 to enable all permissions, the man page does say that but just not in the ntfs section. The mount point permissions before the mount are irrelevant, once the device is mounted it's root directory permissions take over the mount point's permissions.

Unless you recompiled the NTFS driver with write support you don't have to worry about accidentally writing to the drive, so the only options you should need in fstab are umask=0000, uid=blah if you'd like your user account to own the files, ro if you don't want to appear writable even though it's not, user if you want to be able to mount/umount the device as a user, note that the option is user singular and not users.
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
I tried setting the umask=0000 option again, still to no avail. Also tried changing the permissions on /dev/hda1 to o+r, which stuck just fine but still gives my normal user the "Permission denied" message.
I want root to own the mount, so I'm not using the uid option. And I'm using the plural users option so that anyone can unmount it, regardless of who mounts it.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The permissions on the device have no affect on the permissions on the filesystem and I've never had any problems using the umask on vfat or NTFS filesystems, so I have no idea what your problem might be. Infact I just tested it here and umask=0000 works just fine.
 

Zelmo3

Senior member
Dec 24, 2003
772
0
0
gid=users does fix the problem, thanks.
Out of curiosity, can someone explain something? Before mounting, the mount point's permissions are
drwxr-xr-x 2 root users
and the device's permissions are
brw-rw-r-- 1 root disk
but if I don't set umask=0000 (so the only options are ro,users,gid=users) then when mounted the mount point's permissions become
dr-x------ 1 root users
Shouldn't the permissions be read-only for everyone?
With umask=0000 I get
dr-xr-xr-x 1 root users
for the mount point and everything in it, and I'm not understanding why everyone (or anyone) has execute permission.