df -h命令卡死解決辦法


1、現象

同事突然反應說有個服務器進入/目錄運行 ls  -l 無反應,同時運行df  -h也卡死了。如果你的機器有用到nfs請直接看第四大點。

 

2、分析

    運行mount

[conversant@swiftmedia-esc ~]$ mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/VolGroup-lv_home on /home type ext4 (rw)
/dev/mapper/VolGroup-lv_var on /var type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
203.116.18.239:/opt/storage-escape on /opt/storage-scms type nfs (rw,addr=203.116.18.239)
203.116.18.239:/opt/storage-escape on /opt/storage-escape type nfs (rw,addr=203.116.18.239)
203.116.18.239:/test on /test2 type nfs (rw,vers=4,addr=203.116.18.239,clientaddr=203.116.18.233)

發現有三個nfs目錄,因此登陸203.116.18.239 查看目錄問題 發現/test 這個目錄已經被刪除了

因此使用umount命令來卸載

 

3、解決

運行  umount -l   /test2  來卸載設備。選項 –l 並不是馬上umount,而是在該目錄空閑后再umount。

以上不行,就運行如下命令

fuser -m -v /test2

fuser -m -v -i -k   /test2  使用i參數會問你是否kill掉這個某個進程,按y就把它kill了。

 

4、其他情況

該服務器做了服務端的NFS目錄,但是由於服務端所在的服務器重啟了機器,導致客戶端讀不到服務端的目錄導致卡死。

解決辦法,在服務器重啟nfs服務

server  restart    nfs  

客戶端也再次重啟nfs

server  restart    nfs  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM