-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NixOS: nofail option breaks remounting changed filesystems #31260
Comments
@bts I am unable to reproduce the above issue with current NixOS. Technical details
|
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:
|
I can reproduce the problem. It is caused by the |
I marked this as stale due to inactivity. → More info |
Not stale. This also occurs for VMware guests due to unsupported
|
Here's a stupid-but-simple workaround: if the mount unit changed, preemptively stop it in an activation script. This makes NixOS start the unit instead of attempting and failing to reload it. Here's an example for VMware guest's
|
I reported a bug regarding |
For me the This is my workaround: # XXX: This isn't working
# fileSystems."/backup" = {
# device = "/dev/mapper/ssd";
# options = [ "nofail" ];
# };
systemd.services.myBackupMount = {
description = "Mount /backup";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
ExecStart = "${pkgs.utillinux}/bin/mount /dev/mapper/ssd /backup";
ExecStop = "${pkgs.utillinux}/bin/umount /backup";
};
unitConfig = {
ConditionPathExists = "/dev/mapper/ssd";
};
}; |
I just set up a fresh system and have multiple optional disks configured with
HOWEVER, when switching to a changed configuration, this (at least initially) fails because it tries to start the mount units of the non-existing drives, which fails:
I cannot reproduce this issue though, so it might have something to do with the initial switch or so? After a reboot, switching to new configurations works fine. |
Issue description
When a
fileSystems
entry is changed and the"nofail"
option is specified, switching to the new configuration fails becausemount
doesn't recognize the"nofail"
option (though/etc/fstab
does.)The
"nofail"
option should only be used to populate/etc/fstab
, and not provided tomount(8)
when remounting.Steps to reproduce
fileSystems
entry using"nofail"
to/etc/nixos/configuration.nix
like:sudo nixos-rebuild switch
Change the
fileSystems
entry (e.g. remove theuid=1001
entry above)sudo nixos-rebuild switch
At this point we get an error like the following:
Running this command (
mount mac-home /mnt/mac-home -o remount,ro,nofail -t vboxsf
) by hand produces the following output:I am able to successfully switch to the new configuration if I first manually unmount the partition (
umount /mnt/mac-home
).Technical details
The text was updated successfully, but these errors were encountered: