Hi!
Replying to @n8henrie, and also to future time travellers that end up here.
As you probably know, these boot options end up on /etc/fstab
, which is a text file with I think six columns, separated by whitespace. The fourth field (fs_mntopts) declare the mount options for the filesystem in question. So, imagine that for a certain filesystem we don’t specify options. Then we end up with a line that has not six, but just five columns, and that breaks its parsing. That’s why the have the no-op “defaults”. But when we specify at least one mount option, such as “umask=0077”, the “defaults” keyword is redundant.
To verify that this is actually correct, you can just verify which mount options are active with the “mount” command, with and without the “defaults” keyword, on top of the specified ones.
This is a common misconception, that is not even properly clarified in the fstab(5) manpage, although if you piece together the relevant parts, it’s all there:
The fourth field (fs_mntops).
…
The usual convention is to use at least “defaults” keyword there.
(Which would hint that is needed).
Basic filesystem-independent options are:
defaults
use default options. The default depends on the kernel and the filesystem.
mount(8) does not have any hardcoded set of default options.
(But this last paragraph hints the other way around).
The only reason I can come up with to justify having “defaults” around when other options are present is to simplify the scripts that create it (I’ve seen this over several distros over the years, if memory serves), but since this is clearly not the case in NixOS, I’d say we are better off without it.
Hope that it helps.
Happy hacking!