Problem
When installing Linux in a dual-boot system along with Windows XP, you might having trouble accessing the Windows XP C: drive which is an NTFS type file system. That is, as a non-root user you won't have access to it. Because I first was stymied, and a google search gave me few clues, but eventually fixed the problem, I wrote this info page.
This page contains the sections:
Analysis
The reason is that linux support for NTFS is by default only granted for root. The reason for that is probably that the NTFS partition is most often used for the Windows system, and that ordinary users should not access system files.
After mounting an NTFS volume, the mount point permissions are set by the kernel to:
rwx------ root root /dosc
(without w if mounted read-only).
See also:
- the man page for mount under file-system specific mount options,
- the file Documentation/filesystems/ntfs.txt in the 2.6 kernel sources.
the dedicated site http://www.linux-ntfs.org/
Solutions
The solution is to change the permissions of the mount point through the ntfs mount options uid, gid, umask, fmask, dmask.
To give all users access to the ntfs volume, simply use the mount option: umask=0.
To give only a selected set of users access, you need to create a special group, e.g., dosc. The steps are:
addgroup dosc # with windows xp, the C: is often of type ntfs
addgroup roland dosc
mkdir /dosc; chown :dosc /dosc # mount point
grep dosc /etc/group # --> gid, e.g., 1004
mount options: gid=1004;fmask=0117,dmask=07
After mounting the ntfs volume and logging in as a user of group dosc, the volume looks like this:
roland@florijn:~$ ls -ld /dosc dr-xr-x--- 1 root dosc 4096 2006-03-06 16:30 /dosc roland@florijn:~$ ls /dosc AUTOEXEC.BAT IO.SYS ... etc
VFAT partitions
The umask mount options exist also for the several FAT-type file systems, see the man page for mount. Strangely, the default umask is defined different than for NTFS, namely as the umask of the current process.
As the umask is normally set to 022 (see: /etc/profile, ~/.bash_profile), the VFAT partition is then mounted rwxr-xr-x root:root.
However, I found that after issuing e.g., umask 077, this new setting does not affect a mount of the VFAT partition.
As with Ubuntu Linux, file systems are mounted by root, you probably want to include a 'umask=0' option in /etc/fstab for VFAT partitions that you want to write to. Read access to VFAT partitions works by default for all users.
Conclusion
Accessing an NTFS partition in Linux is different from older dos-type file systems as MSDOS/FAT/VFAT, but is still possible.
When installing Ubuntu Linux, this means manually editing the /etc/fstab file, otherwise you cannot access the Windows XP C: disk. The regular Ubuntu tools like disks-manager are not capable of fixing the mount permissions.
The issue of write-access of NTFS is not touched upon here. The official Linux docs say that write-access is very limited, but safe, but most voices say it is risky. The conservative view is to only mount NTFS partions read-only. After all, you are migrating away from windows, not towards it, right?
. . . . . Ir.S.S.R. Kwee Computer Consultancy