# External Media + Multiple containers (Raspberry Pi 3B+)

**URL:** <https://forums.balena.io/t/external-media-multiple-containers-raspberry-pi-3b/4783>\
**Category:** balenaOS\
**Tags:** raspberrypi3\
**Created:** [December 21, 2018, 6:59am UTC](https://forums.balena.io/t/external-media-multiple-containers-raspberry-pi-3b/4783 "2018-12-21T06:59:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsadoski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jsadoski/32/1419_2.png) [@jsadoski](https://forums.balena.io/u/jsadoski)\
**Post date:** [December 21, 2018, 6:59am UTC](https://forums.balena.io/t/external-media-multiple-containers-raspberry-pi-3b/4783/1 "2018-12-21T06:59:47Z")

</div>

I’ve read the article [Communicate outside the container: Storage](https://www.balena.io/docs/learn/develop/runtime/#storage). I was wondering if a device could be mounted in a multiple container setup as a volume that could be shared by multiple containers. I have data on the storage which more than one container needs access to.

If that’s not possible, are there any potential workarounds? Or, am I misunderstanding what can be done in terms of mounting an external device?

---

<div class="post-metadata">

**Author:** ![dansku](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dansku/32/1183_2.png) [@dansku](https://forums.balena.io/u/dansku)\
**Post date:** [December 21, 2018, 9:17am UTC](https://forums.balena.io/t/external-media-multiple-containers-raspberry-pi-3b/4783/2 "2018-12-21T09:17:17Z")

</div>

Hey @jsadoski,

If you want to access external devices from multiple containers, you could follow the information from this page:

> **[Interact with hardware - Balena Documentation](https://www.balena.io/docs/learn/develop/hardware/#interact-with-hardware)**
>
> Access GPIO, I2C and SPI interfaces with {{ $names.company.lower }}

Exactly what kind of device are you trying to mount?

Thank you,

---

<div class="post-metadata">

**Author:** ![jsadoski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jsadoski/32/1419_2.png) [@jsadoski](https://forums.balena.io/u/jsadoski)\
**Post date:** [February 27, 2019, 1:48am UTC](https://forums.balena.io/t/external-media-multiple-containers-raspberry-pi-3b/4783/3 "2019-02-27T01:48:49Z")

</div>

Sorry for the very late reply. I had to set this project aside for a while, but recently I’ve been able to pick it back up.

I’m trying to mount a 3 TB USB drive on a Raspberry Pi. I was able to accomplish this based on the article you provided. I gave the containers the appropriate privileges and I was able to mount via my entrypoint script.

The process is somewhat laborious and prone to create a lot of issues, however. For example, when trying to run a container such as [linuxserver/mariadb](https://github.com/linuxserver/docker-mariadb), I need to hook up persistent storage for the `/config` directory _before_ any execution of mariadb. I can’t mount the drive in the Dockerfile, as it would fail on the build server. Because `/config` is already busy, I can’t mount or link anything there. I can get my mount script to run before other execution, but this is not as easy to do for each container as specifying a bind in the `docker-compose.yml`.

Anyways, the information was very helpful. Thank you!

EDIT: After some thought, it would be really viable to use named volumes if I could choose where those volumes were stored. I’m creating a system to backup large uncompressed video files, so the SD card will not be sufficient storage space. Does balenaOS permit me to change the place that volumes are stored?
