untested fix for unable to mount usb disk at boot

This commit is contained in:
Daniel Barlow 2023-03-17 11:53:26 +00:00
parent 9f9558c9e8
commit 6e95932e0e

View file

@ -108,7 +108,7 @@ in rec {
}; };
programs.busybox = { programs.busybox = {
applets = ["blkid" "lsusb" "tar"]; applets = ["blkid" "lsusb" "findfs" "tar"];
options = { options = {
FEATURE_LS_TIMESTAMPS = "y"; FEATURE_LS_TIMESTAMPS = "y";
FEATURE_LS_SORTFILES = "y"; FEATURE_LS_SORTFILES = "y";
@ -121,7 +121,13 @@ in rec {
services.mount_external_disk = oneshot { services.mount_external_disk = oneshot {
name = "mount_external_disk"; name = "mount_external_disk";
up = "mount -t ext4 LABEL=backup-disk /srv"; up = ''
while ! findfs LABEL=backup-disk; do
echo waiting for backup-disk
sleep 1
done
mount -t ext4 LABEL=backup-disk /srv
'';
down = "umount /srv"; down = "umount /srv";
}; };