Iam new in nixos. How to add second hard drive in nix os system?
fstab is read only file and i cannot edit it. I cant find that info in manual.
Thanks in advance for reply
and also if you
man configuration.nix and search for
fileSystems (or just click here, but it’s a big HTML file https://nixos.org/nixos/manual/options.html#opt-fileSystems)
On easy way is to mount it where you want it and then run
That will update
/etc/nixos/hardware-configuration.nix with your current mount points.
mounted sdb1 and then
warning: not overwriting existing /etc/nixos/configuration.nix
what is wrong?
Nothing. It doesn’t overwrite
configuration.nix but it does overwrite
hardware-configuration.nix which is what you want. You should now see the mount in
From there, running
nixos-rebuild switch should getting everything working and update
ok works i have got it thanks
I tried this, but running
nixos-generate-config it did not change my hardware-configuration.nix.
I mounted my second drive /dev/sdb1 to /run/media/pablo/Data.
I’m running the newest 21.05 NixOS, so maybe this changed since you answered.
Edit: It might also have to do with the fact that it’s a windows drive. I just moved from windows to NixOS, so my data drive is still formatted for windows.
It skips filesystems mounted under
/run. That is where things get automounted, you probably don’t want to create permanent mounts there since it is a tmpfs.
Oh! That makes sense.
Where should I mount permanently? Just /mnt or is there a better place in NixOS?
Where do you need it?
You can put it almost anywhere. A subdirectory of
/mnt, inside your home directory or mounted at
/mydata. As long as you don’t mount it inside
/sys you should be fine.