Subject: USB device not available at early boot on Raspberry Pi 4?

From: David Demelier <[email-masked]>
Date: Thu, 12 Mar 2020 09:24:59 +0100

Hey there,

I've installed Alpine Linux as "classic" mode on my Raspberry Pi 4 
(aarch64 version). It has a USB hard drive connected to it permanently 
so I wanted it to be available at boot thus I've dropped a simple line 
in the fstab:

     /dev/sda1 /mnt defaults 1 1

When booting, openrc mounts every filesystems except that one. I can see 
the error between all OpenRC status lines:

     /dev/sda1: No such file or directory

This indicates that while booting the USB device seems to not be 
immediately probed as I need to wait until I logged in and manually 
mount it afterwards. Someone also advised on IRC that modules may be 
missing in the initramfs but I don't think so (I have usb also in 
mkinitfs.conf).

Is there any way to make the OpenRC boot script to wait more for the 
device to be available? Or any other solution, I wanted to use autofs 
but seems buggy yet (several crashes at the moment).

So I can avoid typing `sudo mount -a` everytime I log in :-).

-- 
David

---

From: Konstantin Kulikov <[email-masked]>
Date: Thu, 12 Mar 2020 12:41:38 +0300

On 3/12/20 11:24 AM, David Demelier wrote:
> device to be available?

I made this script for my rpi:

# cat /etc/init.d/sleepboot
#!/sbin/openrc-run

description="Sleeps 10 seconds on boot."

depend() {
         before localmount
}

start() {
         ebegin "Waiting 10 seconds"
         sleep 10
         eend $?
}

And enable it with:
# rc-update add sleepboot boot