HowTo: Mount your NTFS Filesystem/Partition for Read/Write Access in openSUSE 10.0 through 10.3

Why: I found much advice on mounting NTFS partitions, anecdotal, fragmented, mostly good advice in the major Suse community support forums. But I was confused by the diversity. And some advice was problematic. Here is a consolidation.

Suse Versions: 10.0, 10.1, 10.2. This page is retained for early versions. It is no longer maintained. The openSUSE 10.3, 11 page is on this link.

Spare me the words, just give me the detail please:

  • Check/install ntfs-3g, libfuse2 and fuse
  • GUI application ntfs-config turns write permission on and off, one-click. See qualification below.
  • External USB NTFS drives will not automount rw for users when powered on
  • Fstab for Windows-like permissions (drwxrwxrwx):
    /dev/sda2  /mnt/winxp  ntfs-3g  defaults  0 0
  • CLI temporary mount for Windows-like permissions (drwxrwxrwx):
    mount -t ntfs-3g /dev/sda2 /mnt/winxp
  • Fstab for Linux-like permissions (drwxr-xr-x):
    /dev/sda2  /mnt/winxp  ntfs-3g  uid=1000,gid=100,umask=0022  0 0
  • CLI temporary mount for Linux-like permissions (drwxr-xr-x):
    mount -t ntfs-3g -o rw,uid=1000,gid=100,umask=0022 /dev/sda3 /mnt/sda3

Check correct software is installed

You need applications ntfs-3g and libfuse2 (or fuse which brings libfuse2 with it). And you can optionally have ntfs-config which allows one-click switching on/off of read permissions for ordinary users on ntfs partitions.

For 10.0, 10.1 and 10.2 the openSUSE.org site maintains a repository of filesystem-related RPMs, including the RPMs for fuse, ntfs-3g and ntfs-config. Check out the link and add the appropriate repository for you Suse version as an additional source in Yast --> Installation Source --> Specify URL. Now goto Yast --> Software Management --> use the search panel (LHS) to locate and if necessary install ntfs-3g, fuse, libfuse2 and ntfs-config.

For 10.2 the DVD media contains libfuse2 and ntfs-3g but not ntfs-config which is on the Suse 10.3 OSS repository. Activate that repository in 10.3 via Yast --> Community Repositories --> Tick "Main Repository (OSS)". Now goto Yast --> Software Management --> use the search panel (LHS) to locate and if necessary install ntfs-3g, fuse, libfuse2 and ntfs-config.

Suse's default treatment of NTFS during installation: If you accepted the defaults for NTFS partitions then here's what you'll get after the installation finishes:

  • openSUSE 10.3 during installation will create entries in fstab that mount NTFS partitions permanently using the safe ntfs-3g driver. Root can read and write whereas users can only read. This is the same for internal IDE drives and external usb drives. Like all external usb drives in fstab Suse expects to find them powered on each time it boots.
  • Suse 10.0, 10.1, 10.2 during installation: If you accept the defaults both internal and external drives will be mounted permanently using fstab entries. The drives will be read-only and don't use safe drivers. They should quickly be changed to ntfs-3g if you need to access them.

Connecting NTFS drives after installing Suse: Newly-detected NTFS partitions won't automount in Suse or openSUSE. Also, you shouldn't even connect them in 10.0, 10.1, 10.2 unless ntfs-3g and fuse/libfuse2 have been installed.

The GUI application ntfs-config: You can start the app with this command in a terminal as root: ntfs-config. It's very easy to use. [Warning: ntfs-config switches between the safe driver "ntfs-3g" and the unsafe driver "ntfs". Oldcpu reports an incompatibility between the ntfs and ntfs-3g drivers in early versions of 10.x, for very large transfers ~> 100's Gb].

Permanent Mounts

You can observe your NTFS partition in Yast's partitioner manager, available via Yast --> System --> Partitioner. It will look something like mine which has this entry:

/dev/sda2      10.1 GB    HPFS/NTFS

Suppose that you want to mount that partition in a folder you create for it located anywhere you like in your filesystem, say at /mnt/winxp.

To mount your NTFS partition permanently, add your version of the following line into the file system table, no line spaces except for the very last line in fstab, which must be a blank line:

/dev/sda2    /mnt/winxp    ntfs-3g    defaults    0 0

When you reboot, the partion will mount into the folder /mnt/winxp 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:

/dev/sda2    /mnt/winxp    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 /mnt/winxp, for the owner/user with uid=1000, just like a standard linux user.

Temporary Mounts

If you want to mount the NTFS partition temporarily, then you don't put an entry into fstab. Instead you just execute this command as root user in a terminal:

hostname:~ # mount -t ntfs-3g /dev/sda2 /mnt/winxp

Note two things: Regardless of who owns the folder "winxp", this mount command changes the folder's permissions to read/write for everyone. Also, in openSuse 10.2 the command will produce a statement in your terminal beginning "Deficient Linux kernel detected ....". That's only a comment. It doesn't require action.

OK, that's fine if you want everyone to have access to the mounted NTFS partition in folder /mnt/winxp. If you want normal Linux-like permissions (rather than Microsoft free-for-all permissions) to apply to the mounted partition, you execute this alternate command as root user in a terminal:

hostname:~ # mount -t ntfs-3g -o rw,uid=1000,gid=100,umask=0022 /dev/sda3 /mnt/sda3

This alternate command-line version produces permissions drwxr-xr-x on folder /mnt/winxp, for the owner/user with uid=1000, which is the normal situation for a Linux first user's home folders.

If you want to adjust the folder, document or user permissions further, you should read the man pages. Check out the umask, dmask and fmask options. Also note the useful force option.

Here's a handy little table of octal permissions to use for directory permissions:

  • owner=rwx group=rwx other=rwx; i.e for drwxrwxrwx use umask=0000
  • owner=rwx group=rwx other=r-x; i.e for drwxrwxr-x use umask=0002
  • owner=rwx group=rwx other=---; i.e for drwxrwx--- use umask=0007
  • owner=rwx group=r-x other=r-x; i.e for drwxr-xr-x use umask=0022
  • owner=rwx group=--- other=---; i.e for drwx------ use umask=0077

Credits - I adopted this info and these methods after reading the following:

Cheers
Swerdna June 07; update 17 October 07