NTFS-3G: Difference between revisions

From ArchWiki
(→‎Linux compatible permissions: add tip one many-to-one SID mapping)
 
(70 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[Category:FUSE]]
[[Category:FUSE]]
[[es:NTFS-3G]]
[[de:Schreibzugriff mit ntfs-3g]]
[[he:NTFS-3G]]
[[it:NTFS-3G]]
[[ja:NTFS-3G]]
[[ja:NTFS-3G]]
[[ru:NTFS-3G]]
[[ru:NTFS-3G]]
[[zh-hans:NTFS-3G]]
[[zh-hans:NTFS-3G]]
[[zh-hant:NTFS-3G]]
{{Related articles start}}
{{Related articles start}}
{{Related|File systems}}
{{Related|File systems}}
{{Related|NTFS}}
{{Related articles end}}
{{Related articles end}}


[http://www.tuxera.com/community/ntfs-3g-download/ NTFS-3G] is an open source implementation of [[w:NTFS|Microsoft NTFS]] that includes read ''and'' write support (the Linux kernel only supports reading NTFS). NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.
[https://github.com/tuxera/ntfs-3g NTFS-3G] is an open source implementation of [[Wikipedia:NTFS|Microsoft NTFS]] that includes read ''and'' write support. NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.


== Installation ==
== Installation ==
Line 48: Line 46:


{{hc|/etc/fstab|
{{hc|/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
 
}}
}}


Line 58: Line 57:
  # Mount internal Windows partition with linux compatible permissions, i.e. 755 for directories (dmask=022) and 644 for files (fmask=133)
  # Mount internal Windows partition with linux compatible permissions, i.e. 755 for directories (dmask=022) and 644 for files (fmask=133)
  /dev/''NTFS-partition''  /mnt/windows  ntfs-3g uid=''userid'',gid=''groupid'',dmask=022,fmask=133 0 0
  /dev/''NTFS-partition''  /mnt/windows  ntfs-3g uid=''userid'',gid=''groupid'',dmask=022,fmask=133 0 0
Alternatively, if the Windows permissions do matter to you, you can use the {{man|8|ntfsusermap}} command to map Windows users to Linux ones. ntfs-3g will handle the translation of these permissions.
{{Tip|You may wish to map more than one NTFS SID to the same Linux UID, such as in the presence of the [[Syncthing]] {{ic|SyncthingServiceAcct}}. This is trivial going from Windows to Linux, but from Linux to Windows, you want to make sure that files authored by your Linux user appear as belonging to your Windows user and not any service account.
First, you need to know the SID of the desired Windows user. You can determine this either using the {{ic|ntfsusermap}} wizard to guess off of file paths, or by executing {{ic|wmic useraccount get}} on the Windows system to get a definitive list of users. Then, reorder your {{ic|UserMapping}} file such that the Windows user SID is above the service account SIDs.
}}


=== Allowing group/user ===
=== Allowing group/user ===
Line 76: Line 82:
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 {{man|8|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 {{man|8|ntfs-3g|OPTIONS}}.


;[[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].
;[[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 [https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html here].
;fmask and dmask: Like {{ic|umask}} but defining file and directory respectively individually.
;fmask and dmask: Like {{ic|umask}} but defining file and directory respectively individually.
;noauto: If {{ic|noauto}} is set, NTFS entries in {{ic|/etc/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. This allows a specific user to have full access to the partition. Your uid can be found with the {{ic|id}} command.
;uid: The user id. This allows a specific user to have full access to the partition. Your uid can be found with the {{ic|id}} command.
The following option is specific to ntfs-3g only:
;windows_names: prevents files, directories and extended attributes to be created with a name not allowed by windows.
;windows_names: prevents files, directories and extended attributes to be created with a name not allowed by windows.


=== Allowing user to mount ===
=== Allowing user to mount ===


By default, ''ntfs-3g'' requires root rights to mount the filesystem, even with the "user" option in {{ic|/etc/fstab}}. See [http://www.tuxera.com/community/ntfs-3g-faq/#useroption ntfs-3g-faq] for details. The user option in the fstab is still required.
By default, ''ntfs-3g'' requires root rights to mount the filesystem if it is a [[block device]], even with the {{ic|user}} option in {{ic|/etc/fstab}}. See [https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ ntfs-3g-faq] for details. The {{ic|user}} option in the fstab is still required.


{{Note|
{{Note|
* The {{Pkg|ntfs-3g}} package does not have internal FUSE support. Rebuild the package using [[ABS]], or install {{AUR|ntfs-3g-fuse}}.
* The {{Pkg|ntfs-3g}} package does not have internal FUSE support. Rebuild the package using [[ABS]] to enable FUSE support.
** The full explanation is that "user" and "users" work via a setuid {{ic|mount}} not dropping its setuid privilege so that the block device can be used without root. However, ntfs-3g has a hard-coded restriction in ntfs-3g that bails on setuid if an external libfuse is used.
** There is no good technical reason for not allowing setuid for external FUSE besides a mistrust of the library. [https://github.com/AOSC-Dev/ntfs-3g/commit/c918fb79f9f340bce1a19dacf4b720d19922450d This patch] removes the said restriction.
* There seems to be an issue with unmounting rights, so you will still need root rights if you need to unmount the filesystem. You can also use {{ic|fusermount -u /mnt/''mountpoint''}} to unmount the filesystem without root rights. Also, if you use the {{ic|''users''}} option (plural) in {{ic|/etc/fstab}} instead of the {{ic|user}} option, you will be able to both mount and unmount the filesystem using the {{ic|mount}} and {{ic|umount}} commands.}}
* There seems to be an issue with unmounting rights, so you will still need root rights if you need to unmount the filesystem. You can also use {{ic|fusermount -u /mnt/''mountpoint''}} to unmount the filesystem without root rights. Also, if you use the {{ic|''users''}} option (plural) in {{ic|/etc/fstab}} instead of the {{ic|user}} option, you will be able to both mount and unmount the filesystem using the {{ic|mount}} and {{ic|umount}} commands.}}
For non-blockfiles like normal images, ''ntfs-3g'' on the command-line should work out-of-the-box with normal user privileges as the underlying FUSE calls are redirected to the setuid-root ''fusermount'' when direct kernel interaction is unavailable.


== Resizing NTFS partition ==
== Resizing NTFS partition ==
Line 98: Line 111:
For Live CDs the typical procedure is to download an ISO file, burn it to a CD, and then boot from it. [http://infrarecorder.org/ InfraRecorder] is a free (as in GPL3) CD/DVD burning application for Windows which fits the bill nicely. If you would rather use a bootable USB media instead, see [[USB flash installation media]] for methods to create bootable USB stick.
For Live CDs the typical procedure is to download an ISO file, burn it to a CD, and then boot from it. [http://infrarecorder.org/ InfraRecorder] is a free (as in GPL3) CD/DVD burning application for Windows which fits the bill nicely. If you would rather use a bootable USB media instead, see [[USB flash installation media]] for methods to create bootable USB stick.


There are a number of bootable CD/USB images avaliable. This list is not exhaustive, but is a good place to start:
There are a number of bootable CD/USB images available. This list is not exhaustive, but is a good place to start:


* {{App|[[Wikipedia:GParted|GParted]]|Small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application. Does not include additional packages System Rescue CD may incorporate, and disk encryption schemes may not be supported.|http://gparted.sourceforge.net/|}}
* {{App|[[Wikipedia:GParted|GParted]]|Small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application. Does not include additional packages System Rescue CD may incorporate, and disk encryption schemes may not be supported.|http://gparted.sourceforge.net/|{{Pkg|gparted}}}}
* {{App|[[Wikipedia:Parted Magic|Parted Magic]]|Very good complete hard disk management solution. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.|http://partedmagic.com/|}}
* {{App|[[Wikipedia:Parted Magic|Parted Magic]]|Very good complete hard disk management solution. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.|https://partedmagic.com/|}}
* {{App|[[Wikipedia:SystemRescueCD|SystemRescueCD]]|Good tool to have, and works seamlessly in most cases. Once booted, run GParted and the rest should be fairly obvious.|http://www.sysresccd.org/|}}


Note that the important programs for resizing NTFS partitions include ntfs-3g and a utility like (G)parted or fdisk, provided by the {{Pkg|util-linux}} package. Unless you are an "advanced" user it is advisable to use a tool like GParted to perform any resize operations to minimize the chance of data loss due to user error.
Note that the important programs for resizing NTFS partitions include ntfs-3g and a utility like (G)parted or fdisk, provided by the {{Pkg|util-linux}} package. Unless you are an "advanced" user it is advisable to use a tool like GParted to perform any resize operations to minimize the chance of data loss due to user error.


If you already have Arch Linux installed on your system and simply want to resize an existing NTFS partition, you can use the parted and ntfs-3g packages to do it. Optionally, you can use the GParted GUI after installing the [[GParted]] package.
If you already have Arch Linux installed on your system and simply want to resize an existing NTFS partition, you can use the parted and ntfs-3g packages to do it. Optionally, you can use the GParted GUI after installing the [[GParted]] package. At the core of the resizing is the {{man|8|ntfsresize}} command.


== Troubleshooting ==
== Troubleshooting ==


=== Compressed files ===
=== Unsupported reparse point ===
 
When mounting an NTFS filesystem for Windows 10, and reading files or directories, you may
 
# see broken symbolic links to 'unsupported reparse point', ''or''
# see the error message {{ic|cannot access ''some_file'': Input/output error}} (in this case you see {{ic|Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success}} in the [[journal]]).
 
The reason for this are [[Wikipedia:NTFS reparse point|NTFS reparse points]], used by Microsoft to extend the file system. NTFS-3G does not support some types of reparse points by default. NTFS-3G plugins may be used to provide compatibility with a part of the features defined by the following reparse points
 
* System compression: also known as "Compact OS", this feature provides a stronger, executable-optimized type of conversion than NTFS's old LZ77. Use the {{AUR|ntfs-3g-system-compression-git}} plugin for read-only support, or run {{ic|compact.exe /CompactOS:never}} in Windows to disable.
* Deduplicated files: this is a Windows Server 2012 feature providing block-level offline deduplication. Not yet packaged in AUR.
* OneDrive files: OneDrive files are stored as a special volume on Windows. The {{AUR|ntfs-3g-onedrive-bin}} plugin gives read-write access ''only'' for files marked "available locally".


If you have a Windows 10 partition and when accessing files/directories,
See [https://github.com/tuxera/ntfs-3g/wiki/Junctions-Points,-Symbolic-Links-and-Reparse-Points#other-types-of-reparse-points this page] for further details, and [https://web.archive.org/web/20210709190909/https://jp-andre.pagesperso-orange.fr/advanced-ntfs-3g.html archive.org] for downloads.
# you see broken symbolic links to 'unsupported reparse point', ''or''
# you see the error message "cannot access &lt;''filename''&gt;: Input/output error" (in this case you see in /var/log/messages "Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success")
then install {{Aur|ntfs-3g-system-compression}}. This plugin handles compressed files.


=== Damaged NTFS filesystems ===
=== 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.
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.
 
Note that ''ntfsfix'' can only repair some errors. If it fails, ''chkdsk'' will probably succeed.


To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in {{ic|/dev/sda2}}:
To fix the NTFS file system, the device must already be unmounted. For example, to fix an NTFS partition residing in {{ic|/dev/sda2}}:
Line 133: Line 154:


If all went well, the volume will now be writable.
If all went well, the volume will now be writable.
=== Garbled Chinese file name under Windows partition ===
See [[Localization/Simplified Chinese#Garbled Chinese file name under Windows partition]].


=== Metadata kept in Windows cache, refused to mount ===
=== Metadata kept in Windows cache, refused to mount ===
Line 153: Line 178:
You can check the current settings on ''Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do''. The box ''Turn on fast startup'' should either be disabled or missing.
You can check the current settings on ''Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do''. The box ''Turn on fast startup'' should either be disabled or missing.


=== Deleting Windows hibernate metadata ===
==== Deleting Windows hibernate metadata ====


As an alternative to above clean shutdown method, there is a way to completely destroy NTFS metadata that was saved after hibernating. This method is only feasible if you are not able or unwilling to boot into Windows and shut it down completely. This is by placing '''remove_hiberfile''' option when you are mounting your NTFS file system using ntfs-3g.
As an alternative to above clean shutdown method, there is a way to completely destroy NTFS metadata that was saved after hibernating. This method is only feasible if you are not able or unwilling to boot into Windows and shut it down completely. This is by running ''ntfsfix'' provided by {{Pkg|ntfs-3g}}.


  # mount -t ntfs-3g -o remove_hiberfile /dev/''your_NTFS_partition'' ''/mount/point''
  # ntfsfix /dev/''your_NTFS_partition''


{{Warning|Please note that this method means that the saved Windows session will be completely lost. Use this option under your own responsibility.}}
{{Warning|Please note that this method means that the saved Windows session will be completely lost. Use this option under your own responsibility.}}
Line 169: Line 194:
Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See [[fdisk]] or one of the [[partitioning tools]].
Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See [[fdisk]] or one of the [[partitioning tools]].


== Beta features & releases ==
== Beta features and releases ==
There is a [http://jp-andre.pagesperso-orange.fr/advanced-ntfs-3g.html web page ] on "advanced features" (add-ons) [1], maintained by Jean-Pierre André, one of the ntfs-3g authors. That page also provides new versions, not yet incorporated to the official releases.
 
There is a [https://jp-andre.pagesperso-orange.fr/advanced-ntfs-3g.html web page] on "advanced features", maintained by Jean-Pierre André, one of the NTFS-3G authors. It provides:


Currently these add-ons support:
* Documentation on handling of NTFS features in NTFS-3G, including:
* System compression
** Symlinks, junctions, and other reparse points
* OneDrive
** Extended attributes (xattrs) as an interface for ADS streams and special NTFS attributes
* Duplicated files
** Security and permission, including POSIX mapping and ACL mapping
* Plugins for parsing special reparse points.


In the page [1] there is a pointer to the "updated version" of the system compression plugin [[#Compressed files|mentioned above]]. In fact, the update is small; all updates are in:
Information provided in the documentation apply to the Tuxera version (2017.3.23) too. The system-compression and dedupe plugins work with the Tuxera version, but the onedrive plugin requires a tweak of the plugin-loading system only available in advanced releases.
* README.md
* configure.ac, with slight modification. See the attachment


The web page [1] is surely written by J.-P. André. The page [https://www.tuxera.com/community/ntfs-3g-advanced/ NTFS-3G Advanced] in the official site in tuxera.com has a link to the [http://jp-andre.pagesperso-orange.fr/openindiana-ntfs-3g.html OpenIndiana page], which in turn links to [1].
Since August 30, 2021, NTFS-3G AR has been merged back to the mainline NTFS-3G, which has moved to GitHub and restarted active development. The plugin source code has not been merged, however.


== See also ==
== See also ==


* {{man|8|ntfs-3g}}
* {{man|8|ntfs-3g}}

Latest revision as of 04:33, 9 March 2024

NTFS-3G is an open source implementation of Microsoft NTFS that includes read and write support. NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.

Installation

Install the ntfs-3g package.

Manual mounting

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

# mount /dev/your_NTFS_partition /mount/point

The mount type ntfs-3g does not need to be explicitly specified in Arch. The mount command by default will use /usr/bin/mount.ntfs which is symlinked to /usr/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/point

See ntfs-3g(8) for the available options.

Formatting

Warning: As always, double check the device path.
# mkfs.ntfs -Q -L diskLabel /dev/sdXY
Note: -Q speeds up the formatting by not zeroing the drive and not checking for bad sectors.

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 (e.g. /run/media/<username>/), then that user or group will be able to read and write on that partition(s).

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

Linux compatible permissions

Permissions on a Linux system are normally set to 755 for folders and 644 for files. It is recommended to keep these permissions in use for the NTFS partition as well if you use the partition on a regular basis. The following example assigns the above permissions to a normal user:

# Mount internal Windows partition with linux compatible permissions, i.e. 755 for directories (dmask=022) and 644 for files (fmask=133)
/dev/NTFS-partition  /mnt/windows  ntfs-3g uid=userid,gid=groupid,dmask=022,fmask=133 0 0

Alternatively, if the Windows permissions do matter to you, you can use the ntfsusermap(8) command to map Windows users to Linux ones. ntfs-3g will handle the translation of these permissions.

Tip: You may wish to map more than one NTFS SID to the same Linux UID, such as in the presence of the Syncthing SyncthingServiceAcct. This is trivial going from Windows to Linux, but from Linux to Windows, you want to make sure that files authored by your Linux user appear as belonging to your Windows user and not any service account.

First, you need to know the SID of the desired Windows user. You can determine this either using the ntfsusermap wizard to guess off of file paths, or by executing wmic useraccount get on the Windows system to get a definitive list of users. Then, reorder your UserMapping file such that the Windows user SID is above the service account SIDs.

Allowing group/user

In /etc/fstab you can also specify other options like those who are allowed to access (read) the partition. For example, for you to allow people in the groupid group to have access:

/dev/NTFS-partition  /mnt/windows  ntfs-3g   gid=groupid,umask=0022    0       0

By default, the above line will enable write support for root only. To enable user writing, you have to specify the user who should be granted write permissions. Use the uid parameter together with your user id to enable user writing:

/dev/NTFS-partition  /mnt/windows  ntfs-3g   uid=userid,gid=groupid,umask=0022    0       0

If you are running on a single user machine, you may like to own the file system yourself and grant all possible permissions:

/dev/NTFS-partition  /mnt/windows  ntfs-3g   uid=userid,gid=groupid    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 ntfs-3g(8) § OPTIONS.

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.
fmask and dmask
Like umask but defining file and directory respectively individually.
noauto
If noauto is set, NTFS entries in /etc/fstab do not get mounted automatically at boot.
uid
The user id. This allows a specific user to have full access to the partition. Your uid can be found with the id command.

The following option is specific to ntfs-3g only:

windows_names
prevents files, directories and extended attributes to be created with a name not allowed by windows.

Allowing user to mount

By default, ntfs-3g requires root rights to mount the filesystem if it is a block device, even with the user option in /etc/fstab. See ntfs-3g-faq for details. The user option in the fstab is still required.

Note:
  • The ntfs-3g package does not have internal FUSE support. Rebuild the package using ABS to enable FUSE support.
    • The full explanation is that "user" and "users" work via a setuid mount not dropping its setuid privilege so that the block device can be used without root. However, ntfs-3g has a hard-coded restriction in ntfs-3g that bails on setuid if an external libfuse is used.
    • There is no good technical reason for not allowing setuid for external FUSE besides a mistrust of the library. This patch removes the said restriction.
  • There seems to be an issue with unmounting rights, so you will still need root rights if you need to unmount the filesystem. You can also use fusermount -u /mnt/mountpoint to unmount the filesystem without root rights. Also, if you use the users option (plural) in /etc/fstab instead of the user option, you will be able to both mount and unmount the filesystem using the mount and umount commands.

For non-blockfiles like normal images, ntfs-3g on the command-line should work out-of-the-box with normal user privileges as the underlying FUSE calls are redirected to the setuid-root fusermount when direct kernel interaction is unavailable.

Resizing NTFS partition

Note: Please ensure you have a backup before attempting this if your data is important!

Most systems that are purchased already have Windows installed on it, and some people would prefer not wipe it off completely when doing an Arch Linux installation. For this reason, among others, it is useful to resize the existing Windows partition to make room for a Linux partition or two. This is often accomplished with a Live CD or bootable USB thumb drive.

For Live CDs the typical procedure is to download an ISO file, burn it to a CD, and then boot from it. InfraRecorder is a free (as in GPL3) CD/DVD burning application for Windows which fits the bill nicely. If you would rather use a bootable USB media instead, see USB flash installation media for methods to create bootable USB stick.

There are a number of bootable CD/USB images available. This list is not exhaustive, but is a good place to start:

  • GParted — Small bootable GNU/Linux distribution for x86 based computers. It enables you to use all the features of the latest versions of the GParted application. Does not include additional packages System Rescue CD may incorporate, and disk encryption schemes may not be supported.
http://gparted.sourceforge.net/ || gparted
  • Parted Magic — Very good complete hard disk management solution. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.
https://partedmagic.com/ ||

Note that the important programs for resizing NTFS partitions include ntfs-3g and a utility like (G)parted or fdisk, provided by the util-linux package. Unless you are an "advanced" user it is advisable to use a tool like GParted to perform any resize operations to minimize the chance of data loss due to user error.

If you already have Arch Linux installed on your system and simply want to resize an existing NTFS partition, you can use the parted and ntfs-3g packages to do it. Optionally, you can use the GParted GUI after installing the GParted package. At the core of the resizing is the ntfsresize(8) command.

Troubleshooting

Unsupported reparse point

When mounting an NTFS filesystem for Windows 10, and reading files or directories, you may

  1. see broken symbolic links to 'unsupported reparse point', or
  2. see the error message cannot access some_file: Input/output error (in this case you see Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success in the journal).

The reason for this are NTFS reparse points, used by Microsoft to extend the file system. NTFS-3G does not support some types of reparse points by default. NTFS-3G plugins may be used to provide compatibility with a part of the features defined by the following reparse points

  • System compression: also known as "Compact OS", this feature provides a stronger, executable-optimized type of conversion than NTFS's old LZ77. Use the ntfs-3g-system-compression-gitAUR plugin for read-only support, or run compact.exe /CompactOS:never in Windows to disable.
  • Deduplicated files: this is a Windows Server 2012 feature providing block-level offline deduplication. Not yet packaged in AUR.
  • OneDrive files: OneDrive files are stored as a special volume on Windows. The ntfs-3g-onedrive-binAUR plugin gives read-write access only for files marked "available locally".

See this page for further details, and archive.org for downloads.

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.

Note that ntfsfix can only repair some errors. If it fails, chkdsk will probably succeed.

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.

Garbled Chinese file name under Windows partition

See Localization/Simplified Chinese#Garbled Chinese file name under Windows partition.

Metadata kept in Windows cache, refused to mount

When dual booting with Windows 8 or 10, trying to mount a partition that is visible to Windows may yield the following error:

The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sdc1': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.

The problem is due to a feature introduced in Windows 8 called "fast startup". When fast startup is enabled, part of the metadata of all mounted partitions are restored to the state they were at the previous closing down. As a consequence, changes made on Linux may be lost. This can happen to any NTFS partition when selecting "Shut down" or "Hibernate" under Windows 8 or 10. Leaving Windows by selecting "Restart", however, is apparently safe.

To enable writing to the partitions on other operating systems, be sure fast startup is disabled. This can be achieved by issuing as an administrator the command:

powercfg /h off

You can check the current settings on Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do. The box Turn on fast startup should either be disabled or missing.

Deleting Windows hibernate metadata

As an alternative to above clean shutdown method, there is a way to completely destroy NTFS metadata that was saved after hibernating. This method is only feasible if you are not able or unwilling to boot into Windows and shut it down completely. This is by running ntfsfix provided by ntfs-3g.

# ntfsfix /dev/your_NTFS_partition
Warning: Please note that this method means that the saved Windows session will be completely lost. Use this option under your own responsibility.

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. See fstab#File system UUIDs for an example.

Windows mount failure

Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See fdisk or one of the partitioning tools.

Beta features and releases

There is a web page on "advanced features", maintained by Jean-Pierre André, one of the NTFS-3G authors. It provides:

  • Documentation on handling of NTFS features in NTFS-3G, including:
    • Symlinks, junctions, and other reparse points
    • Extended attributes (xattrs) as an interface for ADS streams and special NTFS attributes
    • Security and permission, including POSIX mapping and ACL mapping
  • Plugins for parsing special reparse points.

Information provided in the documentation apply to the Tuxera version (2017.3.23) too. The system-compression and dedupe plugins work with the Tuxera version, but the onedrive plugin requires a tweak of the plugin-loading system only available in advanced releases.

Since August 30, 2021, NTFS-3G AR has been merged back to the mainline NTFS-3G, which has moved to GitHub and restarted active development. The plugin source code has not been merged, however.

See also