How to mount media folder in supervised docker

Did you add your volume to /etc/fstab?
Here is my entry in fstab:

UUID=1f29691b-720e-4bac-8339-51723a93dbab /usr/share/hassio/media btrfs rw,exec,subvolid=2000 0 0

Thank you very much Dominik,
your solution works like a charm for me. Instead of a SMB-Share I use a external connected USB-Drive to my Pi 4, which I then mount via this created service into the homeassistant container.

As @onl1kairi mentioned, it helpted to change the “docker exec” parameter from “-it” to “-i” otherwise errors would occur during the service execution.

One interesting point tho:
I was afraid that the snapshot would backup the whole content of my “mounted” media folder and hence be very big. After starting a backup and then looking into it, everything was fine. The mounted device and its content did not get backed up, which is perfect for me :slight_smile:

Best Regards & have a nice day,
forSince

1 Like

I “fixed” this issue by adding the following two Crontabs for the root user (crontab -e)

@reboot rm -r /usr/share/hassio/media
@reboot sleep 10 && rm -r /usr/share/hassio/media && ln -s /path/to/your/media /usr/share/hassio/media && docker restart homeassistant

(I’m running a supervised installation on Ubuntu 20.04, not sure if the @reboot command also works like this in Crontabs on Debian)

I have HomeAssistant supervised install on RaspberryPy.

I execute

sudo docker exec -it homeassistant bash

and

mount -t cifs -o "domain=WORKGROUP,username=xxx,password=xxx" //192.168.1.xx/camera /media/camera

When I execute in docker

ls-l camera

I see files from NAS

When I execute same command inside HomeAssistant TerminalSSH addon i see only empty catalog

When I create file into docker, I see this one on NAS, but I can not see this file inside HomeAssistant.
And when I create file inside HA I can not see this file inside docker or inside NAS.

Where is my wrong?

1 Like

Hi everybody,

trying to mount the folder, but I’m kinda lost. I’m not familiar with docker but the minimum.
I’ve mounted an SSD on the host (debian) on /media/plex and I’d like to see it by HA and Plex. I tryied to modify the /usr/sbin/hassio-supervisor adding a volume using -v, but it doesnt work, probably because it use “create” and not “run”? (just a speculation on my part).

Need some help, do a symbolic link to /usr/share/hassio/media/plex would work?