Home > OS >  Where are my volumes mounted when using Docker Desktop and WSL2?
Where are my volumes mounted when using Docker Desktop and WSL2?

Time:11-11

I am using Docker Desktop and Docker Kubernetes with WSL2 (Ubuntu 20.04). I have a yaml file for a persistent volume that mounts the volume in /mnt/data. Where is this located since there is nothing when I do "ls /mnt/data" in WSL even as sudo?

hostPath:
  path: "/mnt/data"

ls /mnt/data

ls: cannot access '/mnt/data': No such file or directory

Cheers.

CodePudding user response:

You might need to add the disk you're trying to access in the path. For example, if you're trying to access disk C:

path: "/mnt/c/data"

You can double check by going into your /mnt path and executing an ls so that you see all the directories.

CodePudding user response:

The data isn't stored on your local machine but on the worker node running your cluster, e.g. the minikube vm. You need to connect to that machine to find the data.

E.g. for minikube:

minikube ssh
ls /mnt/data
  • Related