NTFS-3G

From Gentoo Linux Wiki

Jump to: navigation, search

Filesystems TOC

Filesystem.png
Ntfs-3g-logo.png

From Wikipedia: NTFS-3G is an open source cross-platform implementation of the Microsoft Windows NTFS file system with read-write support. NTFS-3G uses the FUSE file system interface, so it can run unmodified on many different operating systems. It has been reported to work with Linux, Mac OS X, FreeBSD, NetBSD, Solaris, BeOS and Haiku. It is licensed under the GNU General Public License. It is a fork of ntfsmount and is under active development.

Contents

[edit] Installation

NTFS-3g supports the following USE flags:

Note: hal flag isn't available in the stable version
  • hal: Enable Hardware Abstraction Layer (HAL) support
  • debug: Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
  • suid: Enable setuid root for the program, with potential security risks. This flag allows simple users to mount an ntfs partition using ntfs-3g.

Check the default state of the flags:

emerge -pv ntfs3g

Enable flags that you need and emerge this package.

[edit] Configuration

[edit] Kernel Configuration

Linux Kernel Configuration: NTFS-3g kernel configuration
 File systems  --->
     <M> Filesystem in Userspace support 
Linux Kernel Configuration: NTFS-3g kernel configuration - kernel 2.6.29
 File systems  --->
     <M> FUSE (Filesystem in Userspace) support

Build and install this module:

make && make modules_install

Load the module (this also updates /etc/modules.conf):

update-modules

[edit] Usage examples

Replace /dev/hda1 with your NTFS volume and /mnt/windows with your mountpoint.

[edit] Mount a volume manually

Full access to all users, permission free (if suid USE-flag is set):

ntfs-3g /dev/hda1 /mnt/windows

[edit] Mount at boot

To mount windows partition we need to edit /etc/fstab.

Note: You can combine the options provided in the following examples into one single line of /etc/fstab
Warning: Make sure that if /usr is a separate partition, the mount line for ntfs-3g has to be after the mount line for /usr, otherwise it won't load because the ntfs-3g files are stored in there.
File: /etc/fstab
# Simple mount
#  /dev/hda1 /mnt/windows ntfs-3g 0 0

# Add Locale:
#  /dev/hda1 /mnt/windows ntfs-3g locale=en_US.utf8 0 0

# Access for non Root-Users(make ntfs partitions mountable for a normal user, unmountable for everyone else): 
# Set the suid flag for the ntfs-3g binary and then re-emerge it:
#  /dev/hda1 /mnt/windows ntfs-3g users 0 0

# To make a user/group own everything on the ntfs drive:
# A User's ID and GID can be found with command: id your_username
#  /dev/hda1 /mnt/windows ntfs-3g users,uid=THE_ID_OF_THE_OWNER,gid=THE_ID_OF_THE_GROUP 0 0

# If you don't want the drive to be automounted at boot:
#  /dev/hda1 /mnt/windows ntfs-3g noauto 0 0

# One single line doing all above options 
   /dev/hda1 /mnt/windows ntfs-3g users,locale=en_US.utf8,uid=THE_ID_OF_THE_OWNER,gid=THE_ID_OF_THE_GROUP,noauto 0 0

# Also, if you've given the partition a label (by giving it a "volume name" from Windows or a "label" using ntfslabel 
# from sys-fs/ntfsprogs), you can mount the partition by it's label in /etc/fstab: 
#  LABEL=Windows-XP /mnt/windows ntfs-3g users,locale=en_US.utf8,uid=THE_ID_OF_THE_OWNER,gid=THE_ID_OF_THE_GROUP,noauto 0 0

For more mount options please read the manual:

man ntfs-3g

If you added option users then now you can mount the drive as a normal user:

mount /mnt/windows

When using the automount features, you can set the read/write mode by default by creating the following symlink:

ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs

To disable it, just remove the symlink.

Personal tools
In other languages