I am diving into nixos fully for the first time and am setting up my system for the first time. My setup is as default minimal as possible right now apart from trying to setup lvm raid1. Currently when booting the system hangs trying to mount /dev/raidpool/home to /home.
I have 2 HDD (4tb each) on /dev/sda and /dev/sdb
Here are the exact steps I took to setup my system.
# fdisk /dev/sda
# fdisk /dev/sdb
// new, primary, Linux LVM
# pvcreate /dev/sda1
# pvcreate /dev/sdb1
# vgcreate raidpool /dev/sda1 /dev/sdb1
# modprobe dm_raid
# lvcreate --type raid1 -m 1 -l 100%FREE -n home raidpool
# mkfs.ext4 /dev/raidpool/home
And how I modified my /etc/nixos/configuration.nix
adding:
boot.initrd.kernelModules = [
"dm-raid"
];
fileSystems.”/home" = {
device = "/dev/raidpool/home";
fsType = "ext4";
};
After a reboot the system fails to mount this device stating:
Timed Out Waiting for device /dev/raidpool/home
Dependency failed for File System Check on /dev/raidpool/home
Dependency failed for /home
Dependency failed for Local File System
This then drops me into the emergency shell, when ls /dev
the directory does not have raidpool
.
Running vgchange -ay
remounts the system.
I am on nixos version 24.11, brand new.
Do forgive me for anything missing, I am typing on my phone
I tried adding in the following lines to my configuration file to no success based on other threads I found:
boot.initrd.preDeviceCommands = "vgchange -ay";
boot.initrd.preLVMCommands = "lvm vgchange -ay";