[Linux] 用 umount -l 強制卸載已經不存在的 Windows shared folder mount

[Linux] 用 umount -l 強制卸載已經不存在的 Windows shared folder mount

今天又遇到了 umount 失敗的狀況…

問題的發生點是在之前先在 Linux 上 mount 了一個 Windows 的 shared folder,

但後來 Windows 電腦關機了,於是想去 ls 已掛載的目錄時會卡住,

下 umount 也會失敗:

testuser@localhost ~ $ umount mnt_windows
umount: /tmp/mnt_windows: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

 

查了一下,原來 umount 有個 -l 的選項 (lazy unmount),

通常用這個指令就可以成功卸載了:

umount -l mnt_windows

 

參考資料:stackoverflow: How do you force a CIFS connection to unmount

 

(本頁面已被瀏覽過 1,229 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料