How to add second hard drive HDD

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

On easy way is to mount it where you want it and then run nixos-generate-config

That will update /etc/nixos/hardware-configuration.nix with your current mount points.


mounted sdb1 and then
writing /etc/nixos/hardware-configuration.nix…
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 /etc/nixos/hardware-configuration.nix

From there, running nixos-rebuild switch should getting everything working and update /etc/fstab

ok works i have got it thanks

1 Like