LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Howto: set permissions on a ntfs drive. (https://www.linuxquestions.org/questions/slackware-14/howto-set-permissions-on-a-ntfs-drive-59384/)

Coramoor 05-12-2003 10:01 AM

Howto: set permissions on a ntfs drive.
 
How do I set permissions when mounting a ntfs drive(which is dead set on being read-only).

All my mp3s are on my windows drive and i can only get there as root which is really annoying...

Keep in mind that I'm a newbie so if it's very complicated you don't have to bother.

jharris 05-12-2003 10:04 AM

NTFS support is read only. Do you just want to be able to access the drive as a normal user? If so you'll probably just need to chmod whatever directory you are using as a mount point (say /mnt/ntfsDrive) to 755. (so to follow the example - chmod 755 /mnt/ntfsDrive && mount /dev/hdXN /mnt/ntfsDrive)

HTH

Jamie...

Coramoor 05-12-2003 10:42 AM

That's just it.. I can't because it's read-only.

acid_kewpie 05-12-2003 10:44 AM

Quote:

NTFS support is read only.
or rather, you can write to it with a lot of farting around, but it's very likely that you'll damage the drive, so we don't normally tell you.

there's a lot of information abuot NTFS on this site, try a little search

Seph64 05-12-2003 11:06 AM

You have to edit the way you mount it to read it from a regular user. I am going to assume Windows is on the first drive

mount -t ntfs /dev/hda1 /mnt/windows -r -o umask=022

That usually works when mounting it.

For the fstab, I usually put in:

Code:

/dev/hda1      /mnt/windows    ntfs    ro,umask=000  0 0

chemzar 05-12-2003 03:30 PM

If that doesn't work try using umask=0000 (an extra leading zero for the directory bits). After you modify /etc/fstab then you will want to

umount /dev/hda1
mount -a

This will effect the changes that you made by remounting your windows directory. If you want to be more careful you can disable write so that you don't mess up your data (I do this cuz im paranoid) by using umask=0222.

Hope this helps.

Alan Hicks 05-12-2003 07:46 PM

Quote:

mount -t ntfs /dev/hda1 /mnt/windows -r -o umask=022
umask 022 only removes the write permission for everyone but the owner. On a read-only ntfs drive this is foolish. Since you're wanting to mount it so that a normal user can access it instead of just root, take a look at the man page for mount. Pay particular attention to the part about gid and uid options to mount. The default is to set the owner of all files in the filesystem if no owner is specified as root. You can change this with uid.

TheDot 05-12-2003 10:32 PM

Let me see if I can shed a little light on this subject...
 
*cracks his knuckles and begins to type...*

First off, you have to have NTFS file system write support in your kernel.

Second, read the following.

Now, this is taken from the configuration for choosing NTFS file system write support in kernel configuration:
Quote:

CONFIG_NTFS_RW:

If you say Y here, you will (maybe) be able to write to NTFS file
systems as well as read from them. The read-write support in NTFS
is far from being complete and is not well tested. If you say Y
here, back up your NTFS volume first, since it will probably get
damaged. Also, download the Linux-NTFS project distribution from
Sourceforge at <http://linux-ntfs.sf.net/> and always run the
included ntfsfix utility after writing to an NTFS partition from
Linux to fix some of the damage done by the driver. You should run
ntfsfix _after_ unmounting the partition in Linux but _before_
rebooting into Windows. When Windows next boots, chkdsk will be
run automatically to fix the remaining damage.

Please note that write support is limited to Windows NT4 and
earlier versions.

If unsure, say N.
Basically, to sum it up, if you're running WindozeXP as your other operating system, that is NT5, then you'll never mount it as writable, until support changes later. However, if you're using NT4 (or earlier), this is how you would mount it for users to write to it:
Code:

/dev/hdxn        /dirname              ntfs        uid=0,gid=100,umask=002  1  0
(hdxn... x and n being the letter and number for the partition that ntfs resides on, in my case, this would look like /dev/hda1)
(/dirname being the folder you want to mount the partition under)

But, as it says above, use the fix utility how it says to use it! You'll save yourself a lot of trouble. :)

That should give you a good starting, if nothing else.

Good luck! :)

lostboy 05-12-2003 10:51 PM




From what I've read, the umask option in fstab is the only way to mount the drive in a state that you will be able to make permission changes, and have them actually do anything. The state in which a FAT or NTFS drive mounts is determined by microsoft. It has a default setting. Microsoft handles drives a bit differently, and since I'm not qualified to go into detail, I won't. When you mount the drive in Linux, with the umask bits =0000 , you are un-doing the default state, and setting the drive to a neutral state . Then you can change permissions on the drive with 'chmod 555' in this case, so that you can read and execute on the NTFS drive.

On my home network, if I were on my Windows 98 box or WinXP box, I could not even navigate FAT volumes which were hosted by my Linux box through Samba.And no attempt to change permissions had any effect at all.
However, when I changed the umask bits, that changed everything. I could change the permissions as I see fit, AND I was now allowed to navigate these volumes with my Windows boxes, and do anything that the permissions granted. In my case 'chmod 777' . I don't give a shat about security, it's only my home network.

Anyway, you have read my interpretation of what I have read, and my results in my situation.

JC


All times are GMT -5. The time now is 08:48 AM.