I have configured a NixOS machine to have user’s home directories on an external USB SSD (luks2, btrfs) which is mounted on boot - most of the time.
Upon boot, I get a message saying the system will wait for 10 seconds for the external drive to appear. That’s not always long enough (unclear why). When the drive takes longer than that, I get on error very similar to what’s below
Waiting for device /dev/disk/by-label/<...> to appear...
...
Timed out waiting for device /dev/disk/by-label/<...>, trying to mount anyway.
An error occured in stage 1 of the boot process, which must mount the
<...> and then start stage 2. Press one
of the following keys:
r) to reboot immediately
*) to ignore the error and continue
but neither r
nor *
do something useful - when I hit them the system just breaks completely with a bunch of nonsense on the screen.
What’s interesting is that usually, when I end up on this screen, the SSD (case) does give its signature blinking that indicates activity after another 2 or 3 seconds. So I’d like the system to just wait a little bit longer. Maybe 20 seconds?! Any idea how/if I can configure that?
{
# Extra config for external drive
boot.initrd.availableKernelModules = ["usbhid" "usb_storage" "uas"];
fileSystems."/mnt/data" = {
device = "/dev/disk/by-uuid/5acfbedc-65a3-4490-9240-fe08a0c5e88b";
fsType = "btrfs";
};
boot.initrd.luks.devices."luks-9ac420c4-2855-4bb3-ac22-6f0a3111b555" = {
device = "/dev/disk/by-uuid/9ac420c4-2855-4bb3-ac22-6f0a3111b555";
preLVM = false;
};
}