Home | News | Download | Packages | Forum | Wiki | Github

USB Wait feature?


(marcin kowalski) #1

I’ve recently started to repeatedly stumble into a problem on raspberry pi 3.

I have my main system on sd card, but there are a few data partitions mounted off usb hdd. Unfortunately at bootup, void interrupts the boot because it cannot see those drives yet so mounting fails. The partitions in question appear few seconds after i am dropped to recovery shell, which requires a manual intervention at every reboot.

Is there a way to introduce some kind of timeout for usb devices? Also, this appears to be a regression, since i didn’t experience this issue until recently.


#2

Hi @yoshi314

For something like a “wait feature” there’s this program waitforfile in Void repos.
( I’m not saying that is the solution to your problem :wink: )


#3

How about running this

#!/bin/sh

usbdevice=/dev/sda
timeout=60

i=0
while [ $i -lt $timeout ]; do
    [ -b "$usbdevice" ] && exit 0
    sleep 1
    i=$((i+1))
done
printf '%s timed out' "$usbdrive"

before /etc/runit/core-services/03-filesystems.sh?