LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why can't I set user read access for mounted ntfs drives? (https://www.linuxquestions.org/questions/linux-software-2/why-cant-i-set-user-read-access-for-mounted-ntfs-drives-400981/)

sureshot324 01-08-2006 05:55 PM

Why can't I set user read access for mounted ntfs drives?
 
I've put these lines in my fstab to mount my windows partitions:

/dev/hda1 /mnt/c-drive ntfs ro,auto,user 0 0
/dev/hdb1 /mnt/d-drive ntfs rw,auto,user 0 0

This mounts them successfully, but I can only access them as root. Even when I am root, it won't let me change the permissions, since it says they are read only drives. As you can see I did specify hdb1 to have write access, but I guess linux ntfs doesn't have write support yet. I don't want to have to log in as root every time I access these drives, especially since I won't have write access anyway and can't do any harm.

When I have those drives mounted, doing and ls -l on the /mnt folder shows this:

dr-x------ 1 root root 8192 2006-01-08 15:38 c-drive
drwxr-xr-x 2 root root 4096 2006-01-07 22:42 common
dr-x------ 1 root root 4096 2006-01-08 15:39 d-drive

and I am unable to change the permissions of c-drive or d-drive, even as root. If I unmount the drives, the permissions automatically change to this:

drwxr-xr-x 2 root root 4096 2006-01-07 22:47 c-drive
drwxr-xr-x 2 root root 4096 2006-01-07 22:42 common
drwxr-xr-x 2 root root 4096 2006-01-08 16:56 d-drive

Anyone know how I can get read access to these drives as a regular user?

Tinkster 01-08-2006 06:51 PM

The key is in the umask value.



Have a search, this is asked and answered all the time.


Cheers,
Tink

gilead 01-08-2006 07:00 PM

You'll need to check your kernel to see if you have write support for ntfs compiled in, you've obviously already got read support.

Check the man page for mount - as well as the umask option mentioned by Tinkster you'll probably need to set either uid or gid. From the man page under Mount options for ntfs:

Quote:

uid=value, gid=value and umask=value
Set the file permission on the filesystem. The umask value is given in octal. By default, the files are owned by root and not readable by somebody else.

sureshot324 01-08-2006 08:23 PM

Added umask=000 to the mount options and now it's working fine. How is ntfs write support these days, is it safe to use?

Tinkster 01-08-2006 08:39 PM

Not according to the documentation for the kernel. If you
use the ntfstools from sourceforge it's a whole different
story, though :}


Cheers,
Tink

syg00 01-08-2006 08:49 PM

Nope ... not last time I tested (2.6.13)

Edit: - just rechecked the site after seeing Tinks post. Think I have a 2.6.15 system laying around somewhere - might be time to re-test.

sureshot324 01-08-2006 10:42 PM

Quote:

Originally Posted by Tinkster
Not according to the documentation for the kernel. If you
use the ntfstools from sourceforge it's a whole different
story, though :}


Cheers,
Tink

Is ntfstools completely seperate from the ntfs support in the kernel? I might have to check that out, because it would be very convenient if I could write to ntfs partitions reliably and without risk of corrupting the data on those partitions.


All times are GMT -5. The time now is 12:42 PM.