4 节点 proxmox 生产环境, 由于在做 nfs 共享时, 为考虑仔细, 存在多个 pve(集群和单机) 备份时, 相同虚拟机 ID 同时备份到此 nfs 共享目录的情况, 为了区别, 需要把共享点进行分离.
- [root@localhost pve_dump]# more /etc/exports
- /data/db_bk 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
- /data/pve_dump 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
这是原 nfs 配置, 优化以后, 如下所示:
- [root@localhost pve_dump]# more /etc/exports
- /data/db_bk 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
- /data/pve_dump/pve_cluster 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
- /data/pve_dump/pve_150 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
- /data/pve_dump/pve_151 172.16.98.0/24(rw,all_squash,anonuid=500,anongid=500)
不同的 proxmox 挂接不同的共享目录, 就不会引起混淆了.
不幸的是, 挂接的时候, 在 proxmox web 管理界面输入了两次同样的挂接 ID, 导致挂接失败. 然后重新改一个名词, 挂接成功. 但登录 proxmox 宿主系统 debian9, 查看目录 / mnt/pve, 发现有不正常的挂接目录 (没挂上, 但 ls -al 显示若干问号). 感觉不爽, 企图用 rm 删除, 无法执行, 再用 mv 指令, 还是不行. 一气之下, 重启了 proxmox 集群的某个物理服务器, 起来后看看是否能删除.
还好, 系统起来后, 那两个曾经异常的目录, 用 rm 可以直接删除了.
但我不能把 proxmox 集群的服务器全部重启一遍, 毕竟是生产环境. 不过从上边的操作可知, 这种目录是可以删掉的. 怎么下手呢? 根据删除操作输出的提示 "cannot stat'backup156': Stale file handle". 这个提示大概意思是, 文件句柄还处于打开状态.
- root@pve10:~# ls -al /mnt/pve/
- ls: cannot access '/mnt/pve/nfs156backup': Stale file handle
- ls: cannot access '/mnt/pve/backup156': Stale file handle
- total 16
- drwxr-xr-x 6 root root 4096 Jan 12 23:26 .
- drwxr-xr-x 3 root root 4096 Dec 19 22:45 ..
- d????????? ? ? ? ? ? backup156
- drwxr-xr-x 6 500 500 4096 Jan 5 16:09 nfs155
- drwxr-xr-x 4 500 500 4096 Jan 29 2015 nfs156
- d????????? ? ? ? ? ? nfs156backup
试试 umount 该目录.
- root@pve20:/mnt/pve# umount backup156
- root@pve20:/mnt/pve# umount nfs156backup
执行成功, 再看看属性:
- root@pve20:/mnt/pve# ls -al
- total 24
- drwxr-xr-x 6 root root 4096 Jan 12 23:26 .
- drwxr-xr-x 3 root root 4096 Dec 19 22:45 ..
- drwxr-xr-x 2 root root 4096 Dec 28 19:09 backup156
- drwxr-xr-x 6 500 500 4096 Jan 5 16:09 nfs155
- drwxr-xr-x 4 500 500 4096 Jan 29 2015 nfs156
- drwxr-xr-x 2 root root 4096 Jan 12 23:16 nfs156backup
问号没有了, 执行删除.
- root@pve10:/mnt/pve# rm -rf backup156/ nfs156backup/
- root@pve10:/mnt/pve# ls -al
- total 20
- drwxr-xr-x 5 root root 4096 Jan 12 23:42 .
- drwxr-xr-x 3 root root 4096 Dec 19 22:45 ..
- drwxr-xr-x 2 root root 4096 Jan 12 23:40 del
- drwxr-xr-x 6 500 500 4096 Jan 5 16:09 nfs155
- drwxr-xr-x 4 500 500 4096 Jan 29 2015 nfs156
问题解决!
来源: http://blog.51cto.com/sery/2342085