Followed NixOS Manual's instructions for mounting drives.
My config:
fileSystems."/drives/Windows" =
{
device = "/dev/disk/by-uuid/0C2C937A2C935E10";
};
The drives are mounted as root and inaccessible as a user, and the manual does not tell how to change this default behavior.
Next to device
, try options = [ "uid=1000" "gid=1000" "dmask=007" "fmask=117" ];
with your desired uid and gid.
Everything is mounted as root (Linux works this way because it would be insecure otherwise); you're running into something specific to NTFS/FAT32 partitions, which do not have uid/gid owners attached to files. The mount options I listed set a non-root owner for everything; the fmask is a convenience for not having everything be executable.
Next to
device
, tryoptions = ["uid=1000", "gid=1000", "dmask=007", "fmask=117"];
with your desired uid and gid.Everything is mounted as root (Linux works this way because it would be insecure otherwise); you're running into something specific to NTFS/FAT32 partitions, which do not have uid/gid owners attached to files. The mount options I listed set a non-root owner for everything; the fmask is a convenience for not having everything be executable.
Awesome. thank you. I just had a thought: is there a user-specific .nix file I can specify this information in? It would make sense to have a user-level configuration file like /home/myusername/userconfig.nix
@ivan are dmask and fmask directory permission mask and file permission mask?
@ivan the options list should not be separated by commas ,
.
@ivan the mounted drives are read-only. Is this intentional? i.e. can I change the permissions or is this a filesystem driver limitation?
Leaving this issue open. This needs to be included in the Manual.
I believe instructions on how to mount specific drives and file systems do not necessarily need to be included in the manual, as mounting options are not a NixOS-specific thing. A short notice that device options can be set with options
should do.
are dmask and fmask directory permission mask and file permission mask?
yes, see man 8 mount
, search for dmask
the options list should not be separated by commas
,
.
indeed.
options = [ "uid=1000" "gid=1000" "dmask=007" "fmask=117" ];
the mounted drives are read-only. Is this intentional? i.e. can I change the permissions or is this a filesystem driver limitation?
iirc if you have mounted a Windows 8 (and up) system partition, it's likely that you still need to turn off Windows' Fast Boot and Hibernation behaviour.
Error: Invalid argument
You must include those things in the manual. The manual’s job is to get a
user’s system set up and configured for every-day use. Don’t be
short-sighted.
On Fri, Feb 15, 2019 at 4:26 AM Christoph Neidahl notifications@github.com
wrote:
I believe this does not necessarily need to be included in the manual, as
mounting options are not a NixOS-specific thing.are dmask and fmask directory permission mask and file permission mask?
yes, see man 8 mount, search for dmask
the options list should not be separated by commas ,.
indeed.
options = [ "uid=1000" "gid=1000" "dmask=007" "fmask=117" ];
the mounted drives are read-only. Is this intentional? i.e. can I change
the permissions or is this a filesystem driver limitation?iirc if you have mounted a Windows 8 (and up) system partition, it's
likely that you still need to turn off Windows' Fast Boot and Hibernation
behaviour.
https://www.linuxuprising.com/2019/01/fix-windows-10-or-8-partition-mounted.html—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/NixOS/nixpkgs/issues/55807#issuecomment-463987455,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAooiEzrWa-97n076PNJKCB35fOLDDFks5vNotYgaJpZM4a9LL1
.>
Ryan Johnson
Hey @AMDphreak I'm glad @ivan could help you. Maybe you would like to send a PR improving our fine manual? w.r.t. @ivan's example having ,
s I assume you found the solution to that based on the List example in the NixOS manual:
boot.kernelModules = [ "fuse" "kvm-intel" "coretemp" ];
With regards to other mounting behavior, looks like we have them documented here: https://nixos.org/nixos/manual/options.html#opt-fileSystems._name__.options
Hope this helps.
P.S. Pretty sure Linux's default behavior can't be described as idiotic in this case. Please don't be rude in our issue tracker, it is unnecessary and unwanted.
@OPNA2608 :
I believe instructions on how to mount specific drives and file systems do not necessarily need to be included in the manual, as mounting options are not a NixOS-specific thing. A short notice that device options can be set with
options
should do.
It needs to explain the syntax for including options, as well as explain that the fileSystems entries are being assembled into a list of arguments and passed directly into the mount
command (this is not apparent, but it is necessary for users to know what to include as options). The syntax is not discoverable, because it is predicated on the decision of the language designers when they were choosing how the language should operate and how the specific command's pieces should be split into different variables. This is a problem: if device="/blah"
is an argument and options=["blah" "blah"]
is just more arguments, why aren't these just put into one giant options=
statement? The distinction is arbitrary and contingent on the preferences of the language designer. Because of this idiosyncrasy in the Nix language syntax for the mount
command, it is therefore required to explain the syntax in detail, in the mounting section in the manual.
@grahamc :
P.S. Pretty sure Linux's default behavior can't be described as idiotic in this case. Please don't be rude in our issue tracker, it is unnecessary and unwanted.
The numeric umask system (as opposed to the symbolic one) is actually a 100% idiotic design that should have never made it past the "should I do this?" check. There is not a single solid advantage to forcing users to memorize a secret code system and then memorize an arbitrary number with special significance that they must then subtract the other memorized numbers from. If I wanted to memorize a cryptographic cipher, I would have joined the CIA. All I want to do is use my files. Whoever decided to make it numeric was thinking "gee I can save a few keystrokes and half a second when typing," and now they've confused everyone with this unnecessary, unintuitive, jargony "mask" concept.
https://www.computerhope.com/unix/uumask.htm would be a good source to cite.
uid
option (and maybe gid
, if it is important).Assuming that the language has to format the options into arguments, how does one specify a symbolic option similar to the -S
option for umask
?
Example Nix options:
options=["-S" "uid=1000" ... "u+rwx,g+rwx,o+rwx" ]
Is the options=
field generic (applicable to all command line calls?)
These are all problems for an experienced knowledgeable user. This can only be 100x more confusing for a new user. The manual is not prepared for the questions that will go through their minds.
@OPNA2608 :
iirc if you have mounted a Windows 8 (and up) system partition, it's likely that you still need to turn off Windows' Fast Boot and Hibernation behaviour.
Thanks for the heads up. I will include in the Manual, in future.
@grahamc :
Hey @AMDphreak I'm glad @ivan could help you. Maybe you would like to send a PR improving our fine manual? w.r.t.
I hope to. I'm planning on fixing all of the recommendations/bugs I've reported after I get a working system and figure out what generator stack the manual is written in and where it is in the git repo.
@ivan's example having
,
s I assume you found the solution to that based on the List example in the NixOS manual:
I found the solution somehow, probably a syntax error message.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/borgfs-user-mount-in-nixos-filesystems/7697/1
Most helpful comment
Hey @AMDphreak I'm glad @ivan could help you. Maybe you would like to send a PR improving our fine manual? w.r.t. @ivan's example having
,
s I assume you found the solution to that based on the List example in the NixOS manual:With regards to other mounting behavior, looks like we have them documented here: https://nixos.org/nixos/manual/options.html#opt-fileSystems._name__.options
Hope this helps.
P.S. Pretty sure Linux's default behavior can't be described as idiotic in this case. Please don't be rude in our issue tracker, it is unnecessary and unwanted.