強行卸載目錄

背景

strace ls /data/aquaman ,到這個目錄就卡住 了
現(xiàn)在這臺機器執(zhí)行 df -h \ ls /data/aquaman 都卡住了

處理

目錄下有個目錄
/data/aquaman/whatsapp 為掛載的阿里云nas.

mount 輸出結(jié)果如下

7f8184a111-hvs85.ap-southeast-1.nas.aliyuncs.com:/ on /data/aquaman/whatsapp type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.31.15.206,local_lock=none,addr=110.70.72.78)
  1. 強行刪除或者umount
sudo rm -rf /data/aquaman/whatsapp
sudo umount -f /data/aquaman/whatsapp

卡住無反應

  1. 查看文件占用
lsof  # 卡住
(cd /proc; ls -d [0-9]* | xargs -n1 -i find {}/fd {}/cwd -type l -printf "{} %l\n") |grep /data/aquaman/wh
# 沒有文件占用
  1. 直接強制umount
root@ubuntu:/home/qiantao# fuser -m -k -i -v /data/aquaman/whatsapp
Cannot stat /data/aquaman/whatsapp: Input/output error
# 報錯無法使用

qiantao@ubuntu:~$ sudo umount -f /data/aquaman/whatsapp
umount.nfs4: /data/aquaman/whatsapp: device is busy
qiantao@ubuntu:~$ sudo umount -f -l /data/aquaman/whatsapp

Man Umount 查看f和l的參數(shù)說明如下:

       -f, --force
              Force an unmount (in case of an unreachable NFS system).  (Requires kernel 2.1.116 or later.)
       -l, --lazy
              Lazy unmount.  Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore.  (Requires kernel 2.4.11 or later.)

參考文件

強制Umount NFS終極手法

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容