How to add second hard drive HDD

Hi
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

https://nixos.org/nixos/manual/index.html#ch-file-systems
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 nixos-generate-config

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

3 Likes

mounted sdb1 and then
nixos-generate-config
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