NTFS: Difference between revisions

From NixOS Wiki
imported>Erikarvstedt
show how to enable ntfs
imported>TheSirC
Add the syntax to enable write on NTFS
Line 5: Line 5:


NixOS uses NTFS-3G for NTFS support.
NixOS uses NTFS-3G for NTFS support.
=== Enable write mode ===
<syntaxHighlight lang=nix>
  fileSystems."/path/to/mount/to" =
    { device = "/path/to/the/device";
      fsType = "ntfs";
      options = [ "rw" "uid=theUidOfYourUser"];
    };
</syntaxHighlight>


== Troubleshooting ==
== Troubleshooting ==

Revision as of 12:50, 30 July 2019

Enable NTFS support

boot.supportedFilesystems = [ "ntfs" ];

NixOS uses NTFS-3G for NTFS support.

Enable write mode

  fileSystems."/path/to/mount/to" =
    { device = "/path/to/the/device";
      fsType = "ntfs"; 
      options = [ "rw" "uid=theUidOfYourUser"];
    };

Troubleshooting

Read-only file system

This is most likely caused by Windows not marking the disk as "clean" and unmounted.

To verify:

journalctl -b0 | grep -i "The disk contains an unclean file system"

It should return a similar message to what follows:

The disk contains an unclean file system (0,0). Metadata
kept in Windows cache, refused to mount. Falling back to
read-only mount because the NTFS partition is in an unsafe
state. Please resume and shutdown Windows fully (no
hibernation or fast restarting.)

If you have shutdown Windows fully, and not used hibernation, it may be caused by the fast startup or fast boot feature of Windows. It has been reported that major Windows updates may reset this setting to on.

This TechNet entry explains how to disable fast startup. Additionally, this blog post on howtogeek.com explains what is the fast startup mode, and how to disable it.