Allow mount of removable drive across all containers

Ideally, we want to mount our NVMe drive to all containers, allowing each to independently access large files. Additionally, we want our database container to have access to the database without it being the sole container connected to the NVMe.

Alex Gonzalez: Hi Dillan, if the NMVe drive is an external hotpluggable device, you could add a udev rule in the OS to mount it on detection and bind it to volumes that can then be accessed from all containers. Something similar to what GitHub - balena-io-experimental/balena-localvolume: Example app to bind a local directory into a volume describes for USB drives.

Alex Gonzalez: If you raise the use case via our support channels (Get in touch for support - balena) we can help you with the specifics.

In our case the NVMe drive is an internal device connected via PCIe.

Alex Gonzalez: You could still add a udev rule to mount it at boot, and then use the example above to bind it to a volume that can be used across containers. Did you try? Let us know in our support channels if we can help you to try this out.

How will this solution differ from all other explanations of why you can’t mount an NVMe across multiple containers?
Example: Method for Mounting External Storage to Multiple Containers

I can try and see if this works. Would there be any concerns with using this method?

Alex Gonzalez: The example linked won’t work as since then balenaOS have moved to using UUIDs to mount partitions. Usually, exposing OS internals and using them in ways they were not designed for does not end well.

What I describe is using a custom udev rule to mount the disk at a known mountpoint, and binding it to a volume. Then the named volume can be shared between containers. It’s all standard functionality.

Ok I will try your suggested method and let you know if it works. Should I open a support ticket to discuss further?

Alex Gonzalez: > Should I open a support ticket to discuss further

Please do if you need help to try it out - if it works I would appreciate a comment here for visibility.