We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func DeleteMountPoint(mntURl string) { cmd := exec.Command("umount", mntURl) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { fmt.Println(err) return } if err := os.RemoveAll(mntURl); err != nil { fmt.Println(err) return } }
The text was updated successfully, but these errors were encountered:
我也有碰到这个问题了: if err := os.RemoveAll(mntURl); err != nil { fmt.Println(err) return }是在删除的时候报的错误,但是在上面执行umount /root/mnt的时候并没有报错出问题,希望帮忙解答下,谢谢
Sorry, something went wrong.
我的linux内核是: CentOS Linux release 7.9.2009 (Core) 我发现出现这个原因是因为,/root/mnt被当前的容器进程给挂载了多次, 所以需要在umount的时候加上-A参数,这样就能删除/root/mnt目录。不过由于我挂载的文件系统是overlay的,不是aufs的不知道跟这个 有没有关系。 修改代码如下: cmd := exec.Command("umount", "-A", mntURL)
No branches or pull requests
func DeleteMountPoint(mntURl string) {
cmd := exec.Command("umount", mntURl)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println(err)
return
}
if err := os.RemoveAll(mntURl); err != nil {
fmt.Println(err)
return
}
}
The text was updated successfully, but these errors were encountered: