[英]Minikube Mount: bad file descriptor
When I mount a directory in Minikube and list out the directory, I get the errors below:当我在 Minikube 中挂载目录并列出目录时,出现以下错误:
ls: cannot access '/mnt/nilla/assets': Bad file descriptor
ls: cannot access '/mnt/nilla/lib': Bad file descriptor
ls: cannot access '/mnt/nilla/priv': Bad file descriptor
ls: cannot access '/mnt/nilla/config': Bad file descriptor
ls: cannot access '/mnt/nilla/README.md': Bad file descriptor
ls: cannot access '/mnt/nilla/mix.exs': Bad file descriptor
ls: cannot access '/mnt/nilla/test': Bad file descriptor
ls: cannot access '/mnt/nilla/testmount': Bad file descriptor
total 0
-????????? ? ? ? ? ? README.md
d????????? ? ? ? ? ? assets
d????????? ? ? ? ? ? config
d????????? ? ? ? ? ? lib
-????????? ? ? ? ? ? mix.exs
d????????? ? ? ? ? ? priv
d????????? ? ? ? ? ? test
-????????? ? ? ? ? ? testmount
This is problem because when I mount this directory in my pod, the lsyncd
service is copying it to a distribution folder.这是个问题,因为当我在我的 pod 中挂载这个目录时, lsyncd
服务正在将它复制到一个分发文件夹。 lsyncd
does not know what to do with files that don't have proper descriptors. lsyncd
不知道如何处理没有正确描述符的文件。
I mount the the volume after starting Minikube, like:我在启动 Minikube 后挂载卷,例如:
nohup minikube mount ${HOME}/Development/nilla/:/mnt/nilla &> /dev/null &
How can I mount a directory and transfer the normal file descriptors that appear when I list the directory on my local computer?如何挂载目录并传输在本地计算机上列出目录时出现的普通文件描述符? These are what they look like:这些是它们的样子:
$ < ls -l nilla/
total 28
drwxr-xr-x 6 joes joes 4096 Apr 10 22:23 assets
drwxr-xr-x 2 joes joes 4096 Apr 10 22:23 config
drwxr-xr-x 4 joes joes 4096 Apr 10 22:23 lib
-rw-r--r-- 1 joes joes 1905 Apr 10 22:23 mix.exs
drwxr-xr-x 4 joes joes 4096 Apr 10 22:23 priv
-rw-r--r-- 1 joes joes 735 Apr 10 22:23 README.md
drwxr-xr-x 4 joes joes 4096 Apr 10 22:23 test
-rw-rw-r-- 1 joes joes 0 May 15 23:08 testmount
Additional notes: I'm using System 76's Pop OS, which is a fork of Ubuntu 20, and my Minikube VM is running Ubuntu 20 on Virtual Box.附加说明:我正在使用 System 76 的 Pop OS,它是 Ubuntu 20 的一个分支,我的 Minikube VM 在 Virtual Box 上运行 Ubuntu 20。
Thanks.谢谢。
@MikołajGłodziak in the comments pointed me in the right direction.评论中的@MikołajGłodziak 为我指明了正确的方向。 The problem was the default driver for Minikube.问题是 Minikube 的默认驱动程序。 I changed my minikube start
command to specify one of the recommended drivers .我更改了我的minikube start
命令以指定推荐的驱动程序之一。 As an example:举个例子:
minikube start --driver=docker --mount-string ${HOME}/project/:/mnt/project
NOTE: You may get errors for trying to start up the same Minikube VM with a different driver.注意:尝试使用不同的驱动程序启动同一个 Minikube VM 时可能会出错。 If that's the case, minikube delete
will delete your current VM and make a new one the next time you run minikube start
.如果是这种情况, minikube delete
将删除您当前的 VM,并在您下次运行minikube start
时创建一个新 VM。
This seems to be an issue with minikube, which is currently being worked on.这似乎是 minikube 的一个问题,目前正在研究中。
See https://github.com/kubernetes/minikube/issues/12301见https://github.com/kubernetes/minikube/issues/12301
Current workaround is to use another driver .当前的解决方法是使用另一个驱动程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.