NTFS: Difference between revisions

34j (talk | contribs)
mNo edit summary
34j (talk | contribs)
m Add link to man page for mount, add -o uid=$UID to mount command for consistency
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
└─sdX
└─sdX
}}
}}
2. Mount the device using {{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</nowiki>}}
{{code|<nowiki>mount /dev/sdX /mnt/sdX -t ntfs3 -o uid=$UID</nowiki>}}
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 20: Line 20:
+  };
+  };
}}
}}
4. Add {{ic|<nowiki>"uid=$UID"</nowiki>}} to {{nixos:option|fileSystems.*.options|fileSystems.<name>.options}} to get write access, where {{ic|<nowiki>$UID</nowiki>}} replaced with your UID:
4. Add {{ic|<nowiki>"uid=$UID"</nowiki>}} to {{nixos:option|fileSystems.*.options|fileSystems.<name>.options}} to get write access, where {{ic|<nowiki>$UID</nowiki>}} <strong>replaced with your UID</strong>:
{{file|/etc/nixos/configuration.nix|nix|3=
{{file|/etc/nixos/configuration.nix|nix|3=
fileSystems =
fileSystems =
Line 30: Line 30:
   lib.genAttrs ntfs-drives (path: {
   lib.genAttrs ntfs-drives (path: {
     options = [
     options = [
       "uid=$UID"
       "uid=$UID" # REPLACE "$UID" WITH YOUR ACTUAL UID!
       # "nofail"
       # "nofail"
     ];
     ];