Add USB volume to portainer

Can someone explain to me how to add a USB external drive that’s already mounted in dietpi through portainer’s volume management GUI. I need containers to have access to the storage.

/dev/sda1       3.6T  1.5T  2.2T  41% /mnt/bc22c440-9272-45d6-acfc-f9829efa2e93

You cannot add volumes to running container. Means you would need to drop excysting container and specify the USB drive as additional volume during container setup.

I’m trying to add to portainer so that I can rebuild containers with the new volume.

means you are trying to create a Docker volume? Well this is created on /mnt/dietpi_userdata/docker-data/volumes/. But this has nothing to do with Portainer. It’s a Docker config.

Better to add your USB disk as plain directory using full path and not a Docker volume.

Sorry, it was my understanding that I could manage my docker volumes from within portainer. I didn’t realize that my request for help in the portainer volume management section of portainer had nothing to do with adding volumes for use in docker or my containers that are in portainer.

Portainer is nothing more than a GUI for managing Docker. It has no configuration of its own. Creating a volume with Portainer is basically nothing else than a docker volume create <name>

A simple docker volume create demo on CLI should result in the volume being displayed in Portainer

root@DietPiOPi5:~# docker volume ls
DRIVER    VOLUME NAME
local     demo
local     portainer_data
root@DietPiOPi5:~#

There has not been a solution provided:

  • Note: treat this thread like what you submit is a guide for others to use for a complete solution towards there problem. Just because I’m asking questions doesn’t mean I don’t understand how to use the cli or don’t have years of administration and experience working with nix. I’m asking because I have yet to find the answer through other resources so far.
  1. Title is “Add USB volume to portainer”. Maybe a little vague but nothing in this thread defines how to add a USB volume through the portainer interface much less the docker cli.
  • The only direction you have provided is how to add a volume to docker via cli that lets me label it whatever I want but doesn’t define a path to any mount point of external USB storage.

  • Purpose of thread: Need to know how to make available my existing mounted external USB drive to docker using the portainer interface. If you do not use portainer or do not know then do not reply. No one wants unnecessary noise in the forum. If this answer already exists then please point me to the thread that provides the details and I will remove this thread if possible.

  • Details provided: I explained my scenario, the interface which I am using, and also provided the mount point I currently have which should give enough data to answer appropriately with an answer from someone knowledgeable with portainer’s volume management. I am more than happy to wait for someone that has accomplished this already, knows how to do it step by step, or knows that it is not something that the interface currently supports.

I am asking for solution support, not a vague or incomplete answer then claiming it to be solved.

You have totally misunderstood what Partainer does. You can’t add USB drives via Portainer because Portainer is not doing any magic itself. It just creates a Docker volume as I showed you. The location of this Docker volume is defined within the Docker configuration and default to /mnt/dietpi_userdata/docker-data/volumes/, already stated above. There you will find the volume name and the _data folder container all data from the volume.

Therefore, my recommendation is not to use Docker volumes, but to add your USB drive as a regular directory within your container configuration.

I am very aware that portainer is simply a frontend to docker/docker compose.

A large amount of functionality that can be done in the cli for docker/docker compose is integrated into portainer.

I am looking for how to perform the necessary actions through the portainer interface to accomplish the same result as one would do through the cli to add a volume that would map to the existing mounted USB drive. There is volume management in the portainer interface, there is the ability to add a volume here. I would prefer to add a volume that is available to all my containers I create. In portainer, when you create a container you have the ability to add a volume that is already created in the portainer volume management interface. There is a drop-down that provides a list of created volumes that are there. If this isn’t a feature of docker then it is a “config” feature offered by portainer. This allows me to easily and quickly associate multiple containers with a single, already defined volume.

Now on to what we are trying to work through.

Are you saying that there is no definitive way to solely use the portainer interface to add a new volume and associate it with an existing mounted external drive that exists outside of the default docker volume directory?

Are you saying that a symbolic link to my drive, placed in the default docker directory, would resolve my problem?

To add a USB external drive that’s already mounted in DietPi through Portainer’s volume management GUI, you’ll typically follow these steps:

  1. Access Portainer: Log in to your Portainer instance and navigate to the “Volumes” section.

  2. Click “Add Volume”: Look for an option like “Add Volume” or “Create Volume” in the Portainer interface.

  3. Provide Volume Name: Enter a name for the volume you’re creating, something descriptive like “usb-storage.”

  4. Select Volume Driver: Choose the appropriate volume driver. For local USB drives, the default driver may suffice.

  5. Specify Mount Point: This is where you’ll specify the path to your USB drive. This could be something like /mnt/usb or wherever your USB drive is mounted in DietPi.

  6. Configure Volume Options: You might have options to configure the volume’s behavior, such as whether it’s read-only or read-write.

  7. Apply Changes: Once you’ve configured the volume settings, apply the changes to create the volume.

  8. Assign Volume to Container: After creating the volume, go to the container you want to have access to the storage.

  9. Edit Container Settings: Find the option to edit the container settings and navigate to the volume section.

  10. Add Volume Binding: Add a volume binding that links the container’s directory to the volume you just created. This usually involves specifying a source path in the container and the volume name.

  11. Save Changes: Save the changes to the container settings.

  12. Restart Container: If necessary, restart the container to apply the changes.

Once these steps are completed, your container should have access to the storage on the USB external drive that’s mounted in DietPi. Remember to adjust paths and settings according to your specific setup.

@Jappe are you sure? According Portainer docs, you can add NFS, CIFS and tmpfs only Add a new volume | 2.19 | Portainer Documentation

If I understood correctly, OP would need additional local-persist driver docker - Portainer create new volume - Stack Overflow

Way easier would be to add the USB drive as regular folder

-v /path/to/where/you/have/usb:/path/to/where/you/want/data/

The first block in the docs say “Local Volume”, and an USB drive is a local volume?
The host path should then be /mnt/bc22c440-9272-45d6-acfc-f9829efa2e93.

After creating the volume you can attach it then to the container:
https://docs.portainer.io/user/docker/containers/attach-volume

no you need the additional driver as I understood. However these package seems missing for ARMv8 from local-persist GitHub Missing release for arm64 · Issue #106 · MatchbookLab/local-persist · GitHub

EDIT: Yes local-persist is required

Basically manuell install is required but a different file to be download because there is no ARMv8 executable actually