Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

解決 umount: /home device is busy 錯誤的標準流程

編輯:Linux 教學

嘗試卸載 /home 掛載點時遇到 umount: /home: device is busy 是經典場景——總有進程正在存取該檔案系統。解決步驟只需兩招:找出佔用進程 → 終止進程 → 重試卸載。

操作步驟

1. 使用 fuser 定位佔用進程

fuser -m /home

輸出範例:

/home: 10278c 10279c 10280c 10281c 10282c 10295 10365 18222c

數字即為 PID,後綴 c 表示該進程將該目錄作為當前工作目錄。

2. 終止相關進程

kill -9 10278 10279 10280 ...

或一次性處理:

fuser -km /home

-k 參數會自動發送 SIGKILL 信號給所有佔用進程。

3. 重試卸載

umount /home

替代方案:lsof

若系統未安裝 fuser,可用 lsof:

lsof +D /home   # 遞歸列出所有開啟該目錄下檔案的進程
kill -9 $(lsof -t +D /home)

注意事項

  • 終止進程前確認業務影響,避免誤殺關鍵服務
  • 若為 NFS 掛載,可能需先在客戶端處理
  • 懶人卸載 umount -l /home 可延遲釋放,但建議先清理進程

總結

fuser -km /mount_point 是最快捷的標準解法,掌握此指令組合即可從容應對「裝置忙碌」錯誤。

Copyright © Windows教程網 All Rights Reserved