A balena container that format and create partition if not exist

Hello

I’m trying to build a solution and it requires many storage unit to be handled by raspberry pi.
Currently I’m stuck building a docker that detects a storage if it doesn’t have partition and then attempt to create a new one. Do you have any ideas?
Thanks

Hi,
I’m not sure what you are trying to achieve, but to work with external media or storage devices in BalenaOS I can point you to the documentation: https://www.balena.io/docs/learn/develop/runtime/#mounting-external-storage-media

My rp will connect to many new unpartitioned usb storages. Thats why I need to a docker to format usb storages before using it.

Hi there, based on your description, it seems like you will need to create a Docker container, you can certainly use one of base images available in Docker Hub for that. However, the Docker images are mostly just the base operating system to build upon, and your Application needs to be written to handle whatever functionality it is that you are seeking. So, within your application you will need to handle the mounting and unmounting of the USB drives. From an OS perspective though, you can have a look at “Automounting/unmounting with UDev rules” in the documentation that we provide, located here: https://www.balena.io/docs/learn/develop/runtime/#mounting-external-storage-media