我构建了一个 debootstrap chroot 并将 /proc 绑定到它,即 sudo mount -o bind /proc <chroot>/proc
当我发现我不再需要它时,我很愚蠢地做了rm -r <chroot>
它。当然,rm 拒绝删除 /proc。
现在 umount 表示 /proc 正在使用中,无法卸载。我现在如何卸载它?
谢谢。
Linux 拒绝删除作为挂载点的目录,因此<chroot>/proc
应该仍然存在。Linux 拒绝删除不为空的目录,因此<chroot>
应该仍然存在。
从表面上看你写的内容,你试图卸载/proc
,而不是<chroot>/proc
。因此内核尝试卸载none
挂载在 上的文件系统/proc
。您应该使用then卸载none
挂载的文件系统。<chroot>/proc
umount <chroot>/proc
rmdir <chroot>/proc <chroot>
请注意,如果您移动了<chroot>
,则必须将新名称传递给umount
。您可以通过查看来检查内核认为已安装的内容/proc/mounts
。
如果umount
因为您的/etc/mtab
不同步而抱怨,请使用umount -n
.
如果甚至umount -n <chroot>/proc
不起作用,可能是因为某些进程仍在 chroot 内运行以访问它。用于lsof
定位进程并杀死它。