NTFS: Difference between revisions

Pigs (talk | contribs)
Troubleshooting: adds section on dirty flag
DHCP (talk | contribs)
m style improvements
 
Line 6: Line 6:


1. Run {{ic|lsblk}} to list device names.
1. Run {{ic|lsblk}} to list device names.
{{code|
<syntaxhighlight lang=console>
sd...
sd...
└─sdX
└─sdX
}}
</syntaxhighlight>
2. Mount the device using [https://man7.org/linux/man-pages/man8/mount.8.html {{ic|mount}}], where {{ic|/dev/sdX}} replaced with your device name and {{ic|/mnt/sdX}} replaced with an existing folder path to mount your drive.
2. Mount the device using [https://man7.org/linux/man-pages/man8/mount.8.html {{ic|mount}}], where {{ic|/dev/sdX}} replaced with your device name and {{ic|/mnt/sdX}} replaced with an existing folder path to mount your drive.
{{code|<nowiki>mount /dev/sdX /mnt/sdX -t ntfs3 -o uid=$UID</nowiki>}}
<syntaxhighlight lang=console>
$ mount /dev/sdX /mnt/sdX -t ntfs3 -o uid=$UID
</syntaxhighlight>
3. Run {{ic|nixos-generate-config --dir .}} to generate hardware configuration. This will <strong>automatically</strong> add all currently mounted devices to {{ic|hardware-configuration.nix}}.
3. Run {{ic|nixos-generate-config --dir .}} to generate hardware configuration. This will <strong>automatically</strong> add all currently mounted devices to {{ic|hardware-configuration.nix}}.
{{file|/etc/nixos/hardware-configuration.nix|diff|3=
{{file|/etc/nixos/hardware-configuration.nix|diff|3=
Line 48: Line 50:
To verify:
To verify:


<pre>
<syntaxhighlight lang=console>
journalctl -b0 | grep -i "The disk contains an unclean file system"
$ journalctl -b0 | grep -i "The disk contains an unclean file system"
</pre>
</syntaxhighlight>


It should return a similar message to what follows:
It should return a similar message to what follows:


<pre>
<syntaxhighlight lang=console>
The disk contains an unclean file system (0,0). Metadata
The disk contains an unclean file system (0,0). Metadata
kept in Windows cache, refused to mount. Falling back to
kept in Windows cache, refused to mount. Falling back to
Line 60: Line 62:
state. Please resume and shutdown Windows fully (no
state. Please resume and shutdown Windows fully (no
hibernation or fast restarting.)
hibernation or fast restarting.)
</pre>
</syntaxhighlight>


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