Monday 18 April 2011

Setting permissions of a Windows partition in Ubuntu

My Windows partition is in NTFS format which does not support chmod or chown for changing file permissions and ownership. These are set at the time of mounting. If I click the partition icon to mount it, the default permission does not allow execution. To change the mount settings, you need to edit the /ect/fstab file which is a system configuration file and is used to tell the Linux kernel which partitions (file systems) to mount and where on the file system tree.

Here is an example of a configuration to add to the fstab file:
/dev/sda4 /media/WinData ntfs uid=<user_name>,exec,fmask=037,dmask=027 0 0

fmask and dmask change the permissions of files and directories respectively. The numbers represent the permissions to turn off, and  4, 2, 1 represents read, write and execute respectively.

After setting this, the partition needs to be mounted by root using mount command line.

For more details, see this post: http://ubuntuforums.org/showthread.php?t=283131

No comments :

Post a Comment