Permanently mounting an external drive to home assistant on HA Green

I have a HA Green to which I am able to SSH (to the host) as root. When I am on the host, I can access the homeassistant container’s shell and there I can manually mount the USB drive which is connected to the HA Green (via a hub).
So: ssh root@ipaddress:22222, then
docker exec -it homeassistant /bin/bash
and now I can run
mount /dev/sda1 /media/frigate_ssd
which succeeds, and under Media → My Media I then see the connected SSD. Great, now I want to permanently mount it via /etc/fstab
I add this line to the file:
UUID=af25f8a3-1374-754f-b1f9-0b231d90a581 /media/frigate_ssd ext4 rw,user,nofail 0 0
the guid is obtained with blkid, which returns
/dev/sda1: LABEL=“HA-USB” UUID=“af25f8a3-1374-754f-b1f9-0b231d90a581” TYPE=“ext4”
Now if I unmount the manual mount (umount /media/frigate_ssd), verify that it’s not present in the output of “df -h”, and run
mount -av
(which seems to ignore “v” for some reason)
now I see it in df -h output:
/dev/sda1 915.8G 32.0K 869.2G 0% /media/frigate_ssd

Everything is dandy, however: should I now reboot the host, the device isn’t mounted any more. What do I press now?
I suppose, when I access the container from host’s shell, where I am the king of all roots, my access is enough to mount the drive, but when the container is booting and the same /etc/fstab is processed, it lacks the permissions or some other magic? I feel so close, how do I solve this?

If I look at dmesg, it doesn’t seem to me that the container attempts to mount anything from /etc/fstab at all. Some mounts happen on the startup, but those are probably controlled by docker magic? Argh…

I am also trying to mount the /dev/sda1 to /mnt/data/supervisor/media/frigate_ssd on the host (because I see in the docker inspect output that /mnt/data/supervisor/media is bound to container’s /media. And it works! But in order to make that mount permanent, I need to add a line to the host’s /etc/fstab, and it looks like the host’s filesystem is readonly… Please say something useful :slight_smile:

Here it is: udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory · GitHub
It’s an udev rule that can be imported into the HA host which then automatically mounts the USB drives under /mnt/data/supervisor/media which is bound to homeassistant container’s /media. Doctor’s orders!
eklex’s gists · GitHub - this guy’s a star!