Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a script that I need to execute on an NTFS partition. The script's permission is set to 600.

I attempted to modify the permissions by running chmod 755 script.sh, which doesn't report a failure or anything - but it also doesn't change the permissions on the file:

$ stat script.sh

  File: `script.sh'
  Size: 297070      Blocks: 584        IO Block: 4096   regular file
Device: 811h/2065d  Inode: 35515       Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/  xxxxxx)   Gid: ( 1000/  xxxxxx)
Access: 2010-09-30 14:05:16.041621000 -0700
Modify: 2010-09-30 14:05:05.070157000 -0700
Change: 2010-09-30 14:05:05.070475000 -0700

$ chmod 755 script.sh
$ stat script.sh

  File: `script.sh'
  Size: 297070      Blocks: 584        IO Block: 4096   regular file
Device: 811h/2065d  Inode: 35515       Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/  xxxxxx)   Gid: ( 1000/  xxxxxx)
Access: 2010-09-30 14:05:16.041621000 -0700
Modify: 2010-09-30 14:05:05.070157000 -0700
Change: 2010-09-30 14:05:05.070475000 -0700

As you can see, it remains unchanged.

share|improve this question

8 Answers 8

up vote 44 down vote accepted

The mode is determined by the partition's mount options (you cannot change it via chmod).

For '755' on files and '777' on directories you would use something like

sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000 /dev/whatever /mnt/whatever
share|improve this answer
Okay, that would explain a few other things too. –  Nathan Osman Nov 6 '10 at 23:42
What what should I put in place of /dev/whatever and /mnt/whatever if I have to change permission of my HDD partition named /media/Prtn –  Prakash Gautam Feb 3 at 13:02
Does mounting in this way preserve the disk's original settings? I.e. it is safe to mount a Windows drive? –  defaye May 22 at 0:58

Contrary to what most people believe, NTFS is a POSIX-compatible¹ filesystem, and it is possible to use permissions on NTFS.

To enable this, you need a "User Mapping File" or just give the permissions option when mounting (when no compatibility with Windows is needed). This maps linux users on your system with the user IDs like NTFS/Windows use them internally.

See the ntfs-3g manpage for some info and some examples. If you need more information, see the ntfs-3g advanced documentation about ownership and permissions.

(Note that this does not work on FAT filesystems.)

¹ Yes, it can also store filenames that are valid in linux/unix but not under Windows, supports symlinks & hardlinks, etc.

share|improve this answer
here is good documentation. in short: sudo ntfs-3g.usermap /dev/disk/by-label/MY-NTFS and then sudo mv UserMapping /media/MY-NTFS/.NTFS-3G/ –  flying sheep Jan 6 '13 at 23:40
So this will allow you to arbitrarily set permissions like chmod 655 /some/file on the NTFS partition mounted in Linux? I'm trying to figure out how to merge my home partition from linux into c:\Users. Will using usermap allow me to retain all the permissions? I was planning on mounting the c:\Users directory to /home in linux. –  trusktr Feb 13 at 7:22

In addition to setting the fmask and/or dmask in htorque's answer above, if you want to execute scripts on the drive, I had to also set the "exec" mount option.

So the example would be:

sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000,exec /dev/whatever /mnt/whatever
share|improve this answer

For NTFS partitions, use the permissions option in fstab.

First unmount the ntfs partition.

Then edit /etc/fstab

# Graphical 
gksu gedit /etc/fstab

# Command line
sudo -e /etc/fstab

Identify your partition UUID with blkid

sudo blkid

And add or edit a line for the ntfs partition

    # change the "UUID" to your partition UUID
    UUID=12102C02102CEB83 /media/windows ntfs-3g auto,users,permissions 0 0

Make a mount point (if needed)

sudo mkdir /media/windows

Now mount the partition

mount /media/windows

The options I gave you, auto, will automatically mount the partition when you boot and users allows users to mount and umount .

You can then use chown and chmod on the ntfs partition.

share|improve this answer
How are these permissions stored? In ADS? Other metadata? –  hexafraction Nov 4 '12 at 19:47
What about fat32 ? I have a Micro sd card which is write protected and i cant access,format it. –  Rana Muhammad Waqas Nov 8 '13 at 17:27
@RanaMuhammadWaqas - this is an old question, but you can also mount it with different options. Hard to know what your problem is, perhaps identify your hardware and ask a separate question. –  bodhi.zazen Nov 8 '13 at 17:28

You can always explicitly invoke the script interpreter, in which case execution permissions are not required. If the script uses bash, as can be verified by looking at the first line of the script, just run

bash script.sh

Note that the script calls other scripts or binaries on the same partition, this won't work. Note also that the strategy doesn't work with binaries as opposed to textual script files written in Bash Script, Perl, Python or the like.

share|improve this answer
+1 - I never thought about invoking it that way. –  Nathan Osman Dec 14 '10 at 20:58
To execute binaries, use /lib64/ld-linux-x86-64.so.2 ./program.bin for 64-bit programs and /lib/ld-linux.so.2 ./program.bin for 32-bit ones. –  Lekensteyn Apr 13 '12 at 19:52

There is n related question for USB devices. This answer provides an ugly hack if you want to mount every USB device automatically with execute permissions.

share|improve this answer

Old thread, I know, but still relevant and missing a particular use case tip, composed from different suggestions on various other forums/threads and tested on Ubuntu GNOME 13.04 where I wanted an external drive to hold a Steam library...

When the NTFS partition is on an external usb drive, for example -- which means the partition is mounted on the fly upon connection -- then you can use the following method to make udev mount ntfs partitions with execution rights.

Open a terminal window and do:

$ sudo nano /etc/udev/rules.d/90-usb-disks.rules

Then paste this line in what should be a blank/new file (if not, then exit nano and reissue the command but starting the file name with a higher number like 91-...):

ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs-3g"

Then save and close. Unplug the drive and then do in terminal:

$ sudo service udev restart

Next, plug the drive back in and enjoy :)

share|improve this answer

NTFS permissions work differently than those on linux. You cannot use chmod to modify those permissions.

share|improve this answer
Unless you configure it so you can. –  Eliah Kagan Sep 8 '12 at 10:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.