How to mount a USB Thumb Drive (External Storage) in HASSIO? and Add-Ons?

What is the best way to mount a USB thumb drive in HASSIO? For use within HA and HASSIO Add-Ons?

I’ve seen several questions in the forums asking this but no answers.

3 Likes

I don’t have an answer, but Hassio is not something out of the blue, but:

  • ResinOS
  • Docker
  • Home Assistant in a container
  • each add-on is a docker container
  • some glue to hold all together (supervisor, custom menu etc.)

You can google on “how to mount an USB drive in a docker container” or “how to mount USB drive in ResinOS” and see if you find something useful.

1 Like

I think the underlying issue that I’m running into as others - the SSH add-on only get’s you to the HA container not the OS level.

Yes. To get SSH access at OS level you should follow this:

It’s possible, but I wouldn’t recommend it. For your addon to have access to /dev/sda1, add this to config.json for your custom addon.

  "privileged": [
    "SYS_ADMIN"
  ],
  "devices": [
    "/dev/sda1:/dev/sda1:rwm"
  ],

In run.sh for your addon, you can just mount the drive.

mount /dev/sda1 /mnt
3 Likes

I have tried running a custom addon to mount /dev/sda1 but it is not showing and i am not able to mount it to /mnt.

i am running hassos 1.13 and hassio 0.83.3. Can anyone let me know the best way to mount external drives to access them from within hassio.

That’s true!
For the new system hassOS instead of resinOS and this config.json example I get only a “Permission denied” when I try to mount sda1.

I added:

     "full_access": true

to the config.json instead of “privileged” and disabled the “Protection mode” in the AddOn Hass.io settings. Now I could mount the drive! But all drives are now visible in the AddOn.
Maybe someone has a better solution for that?

I’ve managed to share an external storage among Add-ons. Take a look at: