Windows – Best practice for mounting a Windows partition

mountpartitionpermissionswindows

I am running a dual boot of Windows and Debian on my Laptop. I use Linux mostly but from time to time I need to access my files in my Windows partition. My Windows partition is mounted as follows at startup.

>cat /etc/fstab |grep Win7
LABEL=Windows7_OS /mnt/Win7 auto nosuid,nodev,nofail,x-gvfs-show 0 0

Basically every file in the Windows partition is owned by root:root and has a 777 permission. Then whenever I mv a file to my working (Linux) partition, I have a 777 file under my partition, owned by me (while cp in terminal will give a 755 file but if done via gnome will save the file with a 777 permission).

Is this the best practice to mount a partition? Or should I mount it such that instead of root, I am the owner of all files/dirs and somehow be able to set all dirs to 755 and files to 644 when the mount happens at boot? If so, how can it be done?

Best Answer

You can use fmask and dmask mount options* to change the permission mapping on an ntfs filesystem.

To make files appear rw-r--r-- (644) and directories rwxr-xr-x (755) use fmask=0133,dmask=0022. You can combine this with uid= and gid= options to select the file owner and group if you need write access for your user.

* fmask and dmask seem to work for the kernel (read-only) driver as well, even that they are not documented in mount man page. They are documented options for ntfs-3g.

Related Question