NTFS
Not to be confused with NFS.
NTFS (New Technology File System) is a proprietary disk filesystem by Microsoft for Windows and Windows-based operating systems.
There are two primary methods to achieve NTFS support when using Linux. The kernel itself includes limited write support for the NTFS filesystem. This can be seen in the native support section below. There is also a FUSE filesystem driver called NTFS-3G that includes better write support. Because of this, most users who need NTFS support opt for the FUSE implementation over the rather limited built-in support.
Installation[edit | edit source]
Kernel[edit | edit source]
As of November, 2017, the mainlined NTFS kernel driver has very limited functional support for NTFS. The kernel configuration information defines support as "partial, but safe". This driver can overwrite existing files but is not capable of file or directory creation, deletion, or renaming.[1] Most NTFS users will want to enable the FUSE powered version.
Native support[edit | edit source]
File systems ---> DOS/FAT/NT Filesystems ---> <*> NTFS file system support <*> NTFS write support
FUSE support (NTFS-3G)[edit | edit source]
The following kernel options must be enabled for NTFS read/write capabilities over FUSE in Linux:
File systems ---> <*> FUSE (Filesystem in Userspace) support
The sys-fs/ntfs3g package is also required (see the emerge section below).
USE flags[edit | edit source]
Because NTFS-3G is a FUSE-based filesystem, it requires user space utilities. It is currently the best implementation of NTFS for Linux and the only FUSE-based implementation available in the main Gentoo repository. Make sure you enable USE flag suid, otherwise you get an error "read only filesystem".
USE flags for sys-fs/ntfs3g Open source read-write NTFS driver that runs under FUSE
acl
|
Add support for Access Control Lists |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
ntfsdecrypt
|
Build and install the ntfsdecrypt application. |
ntfsprogs
|
Include internal version of ntfsprogs. |
static-libs
|
Build static versions of dynamic libraries as well |
suid
|
Enable setuid root program, with potential security risks |
xattr
|
Add support for extended attributes (filesystem-stored metadata) |
Emerge[edit | edit source]
After reviewing USE flags and making adjustments as necessary, install the FUSE user space tools in order to manipulate NTFS filesystems:
root #
emerge --ask sys-fs/ntfs3g
Usage[edit | edit source]
Creation[edit | edit source]
The mkfs.ntfs command irreversibly destroys the contents of the partition it is told to format. Be sure to select the right partition before running this command!
To create an NTFS filesystem on the /dev/sda1 partition (needs ntfsprogs
USE flag):
root #
mkfs.ntfs /dev/sdyX
Please replace /dev/sdyX with the actual partition you want to format.
Mount[edit | edit source]
There are several ways to mount a NTFS filesystem:
- mount - Manual mounting.
- fstab - Automatic mount at boot time.
- removable media - Automatic mount at demand.
- AutoFS - Automatic mount on access.
Force mount NTFS partition after Windows was hibernated[edit | edit source]
NTFS file systems controlled by Windows may be hibernated instead of shutdown. When this occurs it will not be possible to mount the NTFS partition unless the hiberfil.sys file is removed. The following command can be used to force-mount a hibernated partition, which will result in the hiberfile being removed; all data in the file will be lost. Windows will have to perform a clean boot in order to resume operation:
root #
mount -t ntfs-3g -o remove_hiberfile /path/to/device /path/to/mountpoint
Beta features & releases[edit | edit source]
Jean-Pierre André, one of the ntfs-3g developers, provides some add-ons and releases in his website, not yet included in the official stable releases. See the page NTFS-3G in the Archlinux Wiki, the section "Beta features & releases."
See also[edit | edit source]
- FAT — originally created for use with MS-DOS (and later pre-NT Microsoft Windows)
- Dislocker — FUSE-based filesystem driver capable of reading BitLocker encrypted partitions.
- Ext4 — an open source disk filesystem and most recent version of the extended series of filesystems.
- Btrfs — a copy-on-write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair, and easy administration.
- Tmpfs — a virtual filesystem created to store files in dynamic (volatile) memory.
- UEFI Dual boot with Windows 7/8 — describes how to dual boot Microsoft Windows on a UEFI computer.
External resources[edit | edit source]
- NTFS at Microsoft's TechNet
- ArchWiki article "Dynamic disk" - "Dynamic disk" in Windows is an (unrecommendable) analog of LVM in Linux.