Drucken

NTFS mounts on Linux

Permanent Mounts

Suppose that you want to mount a partition permanently in a folder you create for it (e.g. mount_point), located anywhere you like in your filesystem, say at /path_to/mount_point.

To mount your NTFS partition permanently, add your version of the following line into the file system table, fstab. make sure you leave no line spaces, except the last entry must be a blank line. Recommended option for world-writeable mount:
/dev/sda2    /path_to/mount_point    ntfs-3g    defaults    0 0

When you reboot, the partion will mount into the folder /path_to/mount_point with permissions drwxrwxrwx, i.e with read/write access for everybody, in the style of Microsoft's insecure filesystems.

Here's an alternate option for fstab: If you want the permissions to be linux-like, you can specify a particular owner for the mount folder and its contents with this sort of line in fstab. Recommended option for sole-owner mount:
/dev/sda2    /path_to/mount_point    ntfs-3g    uid=1000,gid=100,umask=0022    0 0

In this example the "umask" with octal value 0022 produces permissions drwxr-xr-x on folder /path_to/mount_point, for the owner/user with uid=1000, just like a standard linux user. Of course, uid values run 1000, 1000, 1002,.... as the case may be.

Temporary Mounts

I'm making this section brief, hoping you will refer above to the section on permanent mounts for the fuller details.

If you want to mount the NTFS partition temporarily, then you don't put an entry into fstab. Instead you just execute the command line versions of either of the recommended mounts discussed earlier. Don't forget these must be issued as root, so enter su first to get rootly powers.

mount -t ntfs-3g /dev/sda2 /path_to/mount_point

Note that the directory "mount_point" automagically changes permissions during the mount process to drwxrwxrwx, regardles of where and what it was before..

mount -t ntfs-3g -o rw,uid=1000,gid=100,umask=0022 /dev/sda2 /path_to/mount_point

This alternate command-line version produces permissions drwxr-xr-x on folder /path_to/mount_point, for the owner/user with uid=1000, which is the normal situation for a Linux first user's home folders. You can of course use other values of uid, depending who needs to own the mount.