Difference between revisions of "NTFS-3G"

From ArchWiki
Jump to: navigation, search
(Primary boot sector is invalid: - Erased. Has to do with the ntfsprogs implementation of mounting.)
m (Mount Failure: Remove gap.)
(38 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:File systems (English)]]
+
[[Category:File systems]]
{{i18n|NTFS Write Support|NTFS-3G}}
+
[[es:NTFS-3G]]
 
+
[[he:NTFS-3G]]
[http://www.tuxera.com/community/ntfs-3g-download/ NTFS-3G] is an open source implementation of Microsoft's NTFS file system that includes read and write support.  Because it is considered to be easier to configure and developed write support earlier, users generally prefer NTFS-3G over {{Package Official|ntfsprogs}} ntfsmount.  NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.  This document will describe how to setup NTFS-3G to work on your computer.
+
[[it:NTFS-3G]]
 +
[[ru:NTFS-3G]]
 +
[[zh-CN:NTFS-3G]]
 +
[[zh-TW:NTFS-3G]]
 +
[http://www.tuxera.com/community/ntfs-3g-download/ NTFS-3G] is an open source implementation of Microsoft's NTFS file system that includes read and write support.  Because it is considered to be easier to configure and developed write support earlier, users generally prefer NTFS-3G over {{Pkg|ntfsprogs}} ntfsmount.  NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.  This document will describe how to setup NTFS-3G to work on your computer.
  
 
== Installation ==
 
== Installation ==
  
The {{Package Official|ntfs-3g}} package is available in '''Extra''' and can be installed by:
+
[[pacman|Install]] the {{Pkg|ntfs-3g}} package from the [[Official Repositories|official repositories]].
 
+
# pacman -S ntfs-3g
+
  
 
== Manual mounting ==
 
== Manual mounting ==
  
 
Two options exist for manually mounting NTFS partitions.  The traditional:
 
Two options exist for manually mounting NTFS partitions.  The traditional:
 
 
  # mount -t ntfs-3g /dev/<your-NTFS-partition> /{mnt,...}/<folder>
 
  # mount -t ntfs-3g /dev/<your-NTFS-partition> /{mnt,...}/<folder>
  
{{Codeline|mount}} will utilize the provided {{Codeline|ntfs-3g}} utility, which can instead be called directly:
+
Mount type {{ic|ntfs-3g}} does not need to be explicitly specified in Arch. The {{ic|mount}} command by default will use {{ic|/sbin/mount.ntfs}} which is symlinked to {{ic|/bin/ntfs-3g}} after the {{Pkg|ntfs-3g}} package is installed.
  
 +
The second option is to call {{ic|ntfs-3g}} directly:
 
  # ntfs-3g /dev/<your-NTFS-partition> /<mount-location>
 
  # ntfs-3g /dev/<your-NTFS-partition> /<mount-location>
  
 
== Configuring ==  
 
== Configuring ==  
  
Your NTFS partition(s) can be setup to mount automatically, or pre-configured to be able to mount in a certain way when you would like them to be mounted.  This configuration can be done in the static filesystem configuration ([[fstab]]) or by the use of HAL.
+
Your NTFS partition(s) can be setup to mount automatically, or pre-configured to be able to mount in a certain way when you would like them to be mounted.  This configuration can be done in the static filesystem configuration ([[fstab]]) or by the use of udev rules.
  
 
=== Default settings ===
 
=== Default settings ===
  
Using the default settings will mount the NTFS partition(s) at boot.  With this method, '''if''' the parent folder that it is mounted upon has the proper user or group permissions, then that user or group will be able to read and write on that partition(s).
+
Using the default settings will mount the NTFS partition(s) at boot.  With this method, '''if''' the parent folder that it is mounted upon has the proper user or group [[Users and Groups|permissions]], then that user or group will be able to read and write on that partition(s).
  
<pre>
+
Put this in {{ic|/etc/fstab}}:
# <file system>  <dir> <type>    <options>            <dump>  <pass>
+
# <file system>  <dir> <type>    <options>            <dump>  <pass>
/dev/<NTFS-part>  /mnt/windows  ntfs-3g  defaults   0      0
+
/dev/<NTFS-part>  /mnt/windows  ntfs-3g  defaults   0      0
</pre>
+
  
 
=== Allowing Group/User ===
 
=== Allowing Group/User ===
  
You can also tell fstab (the NTFS-3G driver) other options like those who are allowed to access the partition.  For example, for you to allow people in the '''users''' group to have access:
+
You can also tell {{ic|/etc/fstab}} (the NTFS-3G driver) other options like those who are allowed to access (read) the partition.  For example, for you to allow people in the {{ic|users}} group to have access:
  
 
  /dev/<NTFS-part>  /mnt/windows  ntfs-3g  gid=users,umask=0022    0      0
 
  /dev/<NTFS-part>  /mnt/windows  ntfs-3g  gid=users,umask=0022    0      0
 +
 +
By default, the ntfs-3g driver enable write support for root only. To enable user writing, use the {{ic|dmask}} parameter to enable user writing:
 +
 +
/dev/<NTFS-part>  /mnt/windows  ntfs-3g  gid=users,fmask=113,dmask=002    0      0
 +
 +
If you are running on a single user machine, you may like to own the file system yourself:
 +
/dev/<NTFS-part>  /mnt/windows  ntfs-3g  uid=USERNAME,gid=users    0      0
  
 
=== Basic NTFS-3G options ===
 
=== Basic NTFS-3G options ===
Line 43: Line 51:
 
For most, the above settings should suffice.  Here are a few other options that are general common options for various Linux filesystems.  For a complete list, see [http://www.tuxera.com/community/ntfs-3g-manual/#6 this]
 
For most, the above settings should suffice.  Here are a few other options that are general common options for various Linux filesystems.  For a complete list, see [http://www.tuxera.com/community/ntfs-3g-manual/#6 this]
  
* '''umask''': umask is a built-in shell command which automatically sets file permissions on newly created files.  For Arch the default umask for root and user is 0022.  With 0022 new folders have the directory permissions of 755 and new files have permissions of 644.  You can read more about umask permissions [http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html here].
+
;umask: umask is a built-in shell command which automatically sets file permissions on newly created files.  For Arch Linux, the default umask for root and user is 0022.  With 0022 new folders have the directory permissions of 755 and new files have permissions of 644.  You can read more about umask permissions [http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html here].
* '''noauto''': If noauto is set, NTFS entries in fstab do not get mounted automatically at boot.
+
;noauto: If {{ic|noauto}} is set, NTFS entries in {{ic|/etc/fstab}} do not get mounted automatically at boot.
* '''uid''' : The user id number.  This allows a specific user to have full access to the partition.  Your uid can be found with the {{Codeline|id}} command.
+
;uid: The user id number.  This allows a specific user to have full access to the partition.  Your uid can be found with the {{ic|id}} command.
* '''fmask''' and '''dmask''': Like '''umask''' but defining file and directory respectively individually.
+
;fmask and dmask: Like {{ic|umask}} but defining file and directory respectively individually.
* '''locale''' : (deprecated as of 2009.1.1) - <s>some locales will need to specify their region for local characters to display properly.</s>
+
;locale: (deprecated as of 2009.1.1) - <s>some locales will need to specify their region for local characters to display properly.</s>
  
== Other configurations ==
+
=== NTFS-config ===
  
Some other configurations that might help you set up your NTFS partition.
+
{{AUR|ntfs-config}} is a program that may be able to help configure your NTFS partition(s) if other methods do not work.
  
=== HAL mounting ===
+
== Troubleshooting ==
  
[[HAL]] can automatically mount your NTFS partition with the use of hotplugging or you can choose to have your Desktop Environment do this too (if it has this feature (which also uses HAL)).  By doing this, there is no need to configure NTFS in the {{Filename|fstab}} configuration file.
+
Some ideas for troubleshooting common problems.
  
==== HAL direct ====
+
=== Damaged NTFS Filesystems ===
  
To automatically mount a NTFS partition with HAL you will have to create a [[HAL#NTFS_write_access|custom HAL policy]]. After you do this, add yourself to the '''storage''' group to obtain write permission.
+
If an NTFS filesystem has errors on it, NTFS-3G will mount it as read-only. To fix an NTFS filesystem, load Windows and run its disk checking program, chkdsk.
 +
Take in account that ntfsfix can only repair some errors. If it fails, chkdsk will probably succeed.
  
==== KDE 4 ====
+
To repair the file system without booting windows, [[pacman|install]] the {{Pkg|ntfsprogs}} package available in the [[Official Repositories|official repositories]].
  
For >=KDE 4.4, right-click the Device Notifier applet and choose '''Device Notifier Settings''' then in '''Removable Devices''' select your partition and choose '''Automount on login'''.
+
To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in {{ic|/dev/sda2}}:
  
=== NTFS-config ===
+
# umount /dev/sda2
 +
# ntfsfix /dev/sda2
 +
Mounting volume... OK
 +
Processing of $MFT and $MFTMirr completed successfully.
 +
NTFS volume version is 3.1.
 +
NTFS partition /dev/sda2 was processed successfully.
 +
# mount /dev/sda2
  
{{Package AUR|ntfs-config}} is a program that may be able to help configure your NTFS partition(s) if other methods don't work.
+
If all went well, the volume will now be writable.
  
== Troubleshooting ==
+
=== Mount Failure ===
  
Some ideas for troubleshooting common problems.
+
If you cannot mount your NTFS partition even when following this guide, try using the [[UUID]] instead of device name in {{ic|/etc/fstab}} for all NTFS partitions. Here's an fstab [[Fstab#UUID|example]].
  
=== Damaged NTFS Filesystems ===
+
=== Format NTFS ===
  
If an NTFS filesystem has errors on it, NTFS-3G will mount it as read only.  To fix an NTFS filesystem, load Windows and run it's disk checking program.  Repairs of an NTFS filesystem are not possible yet in Linux.
+
Install {{pkg|ntfsprogs}}.
  
=== Mount Failure ===
+
{{Warning|As always, double check the device path.}}
  
If you can't mount your NTFS partion even when following this guide, try to add the UUID section to your {{Filename|fstab}} to all ntfs partions.
+
# mkfs.ntfs -L myCoolDiskName /dev/sdc1
  
 
== Resources ==
 
== Resources ==
  
 
* [http://www.tuxera.com/community/ntfs-3g-manual/ Official NTFS-3G Manual]
 
* [http://www.tuxera.com/community/ntfs-3g-manual/ Official NTFS-3G Manual]

Revision as of 07:47, 1 November 2012

NTFS-3G is an open source implementation of Microsoft's NTFS file system that includes read and write support. Because it is considered to be easier to configure and developed write support earlier, users generally prefer NTFS-3G over ntfsprogs ntfsmount. NTFS-3G developers use the FUSE file system to facilitate development and to help with portability. This document will describe how to setup NTFS-3G to work on your computer.

Installation

Install the ntfs-3g package from the official repositories.

Manual mounting

Two options exist for manually mounting NTFS partitions. The traditional:

# mount -t ntfs-3g /dev/<your-NTFS-partition> /{mnt,...}/<folder>

Mount type ntfs-3g does not need to be explicitly specified in Arch. The mount command by default will use /sbin/mount.ntfs which is symlinked to /bin/ntfs-3g after the ntfs-3g package is installed.

The second option is to call ntfs-3g directly:

# ntfs-3g /dev/<your-NTFS-partition> /<mount-location>

Configuring

Your NTFS partition(s) can be setup to mount automatically, or pre-configured to be able to mount in a certain way when you would like them to be mounted. This configuration can be done in the static filesystem configuration (fstab) or by the use of udev rules.

Default settings

Using the default settings will mount the NTFS partition(s) at boot. With this method, if the parent folder that it is mounted upon has the proper user or group permissions, then that user or group will be able to read and write on that partition(s).

Put this in /etc/fstab:

# <file system>   <dir>		<type>    <options>             <dump>  <pass>
/dev/<NTFS-part>  /mnt/windows  ntfs-3g   defaults		  0       0

Allowing Group/User

You can also tell /etc/fstab (the NTFS-3G driver) other options like those who are allowed to access (read) the partition. For example, for you to allow people in the users group to have access:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   gid=users,umask=0022    0       0

By default, the ntfs-3g driver enable write support for root only. To enable user writing, use the dmask parameter to enable user writing:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   gid=users,fmask=113,dmask=002    0       0

If you are running on a single user machine, you may like to own the file system yourself:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   uid=USERNAME,gid=users    0       0

Basic NTFS-3G options

For most, the above settings should suffice. Here are a few other options that are general common options for various Linux filesystems. For a complete list, see this

umask
umask is a built-in shell command which automatically sets file permissions on newly created files. For Arch Linux, the default umask for root and user is 0022. With 0022 new folders have the directory permissions of 755 and new files have permissions of 644. You can read more about umask permissions here.
noauto
If noauto is set, NTFS entries in /etc/fstab do not get mounted automatically at boot.
uid
The user id number. This allows a specific user to have full access to the partition. Your uid can be found with the id command.
fmask and dmask
Like umask but defining file and directory respectively individually.
locale
(deprecated as of 2009.1.1) - some locales will need to specify their region for local characters to display properly.

NTFS-config

ntfs-configAUR is a program that may be able to help configure your NTFS partition(s) if other methods do not work.

Troubleshooting

Some ideas for troubleshooting common problems.

Damaged NTFS Filesystems

If an NTFS filesystem has errors on it, NTFS-3G will mount it as read-only. To fix an NTFS filesystem, load Windows and run its disk checking program, chkdsk. Take in account that ntfsfix can only repair some errors. If it fails, chkdsk will probably succeed.

To repair the file system without booting windows, install the ntfsprogs package available in the official repositories.

To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in /dev/sda2:

# umount /dev/sda2
# ntfsfix /dev/sda2
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sda2 was processed successfully.
# mount /dev/sda2

If all went well, the volume will now be writable.

Mount Failure

If you cannot mount your NTFS partition even when following this guide, try using the UUID instead of device name in /etc/fstab for all NTFS partitions. Here's an fstab example.

Format NTFS

Install ntfsprogs.

Warning: As always, double check the device path.
# mkfs.ntfs -L myCoolDiskName /dev/sdc1

Resources