Mounting external HDD before docker container starts

  • Hey there,

    I need some help with some configuration stuff.

    I have a docker container that needs my external hdd. Starting the container on boot fails, as the container starts before the external hdd is mounted.

    Any idea on how to mount the external hdd before the docker container is started?

    thanks

  • Well there is another side effect I have noticed today:
    I use TVHeadend as a DVR saving all my recordings to the same external HDD.

    The "late" mounting of the HDD causes me to loose all shows I have recorded using TVHeadend - well not loosing in form of deleting, the files are still there, but they are no longer listed in the "recorded" section of Kodi.

    So is there a way to mount the HDD before Kodi and Docker starts?

    • Official Post

    What devices have you plugged into your USB hub? and is it powered? If so what is the amperage of the PSU. I can see you're booting off a 64G SD card, with multiple USB devices.

    You are getting errors, usually related to power issues.

    [8.658636] usb 1-1.4.4.2: device descriptor read/64, error -110

    [ 24.231855] usb 1-1.4.4.2: device descriptor read/64, error -110

    [ 29.565214] usb 1-1.4.4.2: device descriptor read/64, error -110

    [ 45.138384] usb 1-1.4.4.2: device descriptor read/64, error -110

    [ 56.578200] usb 1-1.4.4.2: device not accepting address 10, error -110

    [ 67.244784] usb 1-1.4.4.2: device not accepting address 11, error -110

    Can you try unplugging non essential USB devices and see if that improves the situation. Or if you have a spare USB powered hub try that.

    A test on a RPi3, mounted a USB stick around the 5 second mark.

  • The USB Hub is powered, yes.
    It serves the following:
    External HDD (1TB), USB Tuner for DVB-C2 and a second 500GB HDD

    Additionally there is a USB Thumbdrive connected to the RasPi directly.

    I have now removed the Thumbdrive as well as the 500GB HDD as these are not essential.

    After a reboot, the docker is working.
    Thanks so much for pointing me towards the power issue.

    I will now test if the Thumbdrive or the second HDD were the issue.

  • I have two hard drives connected to the USB3 ports of my RP4, and I seem to be having the same problem with my Plex server running in a Docker container. I can only get it to detect the drives if I kill the container and start it again. Is there some way to make Docker wait until the drives have successfully mounted?

    Edit:

    I got Plex server to wait until the drives finished mounting by adding this:

    [Service]

    ExecStartPre=/bin/sleep 30

    To the docker.linuxserver.plex.service file in the storage/.config/system.d directory.

    It only took me 24 hours of trial and error to find something that worked!

    Edited 4 times, last by Morawake (August 26, 2021 at 6:39 AM).