Nixos-install mount: command not found

Hi there, new to nixos.

I’m using my fedora to install nixos on a second btrfs subvolume, by following NixOS Manual
However, I had issue at the end of the installation.

sudo PATH="$PATH:/usr/sbin:/sbin" `which nixos-install` --root /mnt
installing the boot loader...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
...
/nix/var/nix/profiles/system/sw/bin/bash: line 8: mount: command not found

Not sure why that error occurred, I have the binary in /usr/bin.

/usr/bin/mount

I found this issue that looks similar, but not sure what the solution is nixos-install script 'mount: command not found' · Issue #220211 · NixOS/nixpkgs · GitHub

Any guidance is really appreciated. Thanks.

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.12.9-200.fc41.x86_64, Fedora Linux, 41 (KDE Plasma), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.25.4`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/home/eric/.nix-defexpr/channels/nixpkgs`

nix-channel --list
nixpkgs https://nixos.org/channels/nixos-24.11
1 Like

Try using the nixOS live ISO to install nixos on the second btrfs subvolume

It is probably more reliable than: sudo PATH="$PATH:/usr/sbin:/sbin" which nixos-install --root /mnt

I thought it’d be cool to see the self contained reproducibility in action, but it seems to be more headache than I expected.
I’ll restart with a live ISO. Thanks for the help.

1 Like

I’m running into a similar problem as OP.

Unfortunately I don’t really have the option of booting a live ISO:
I booted in Debian on an Aarch64 machine, then installed Nix, and now need to install NixOS with nixos-install.

Because of that, a solution to the mount command not being found in nixos-install (despite which mount returning /nix/store/fdv1ary508pbwkzfh3rzgamqyzqsbmwk-util-linux-2.39.4-bin/bin/mount) would be greatly appreciated.

1 Like

I’m running into this problem also. It’s suspicious to run into this and see that all of the references to it are in the last few weeks. I wonder if something has broken recently.

1 Like

There’s nothing “reproducible” or “self-contained” about relying on an external binary in /usr/bin that wasn’t built by nix.