R.A. Epigonos et al.

[linux] umountのときにdevice is busyと言われたらumount -l

umountする際にdevice is busyと言われることがある。多くの場合それはマウントされたディレクトリの下にあるファイルを編集していたり、どこかのシェルがこのディレクトリをカレントとしていたりすることが原因なのだけど、そうでもないことがある。

例えば以下。fugaマシンであるディレクトリいかにブロックデバイスをマウントし、これをnfs経由でhogeマシン上にマウント、hogeマシン上からアンマウントして、fugaマシン上からもアンマウントしようとしたら、device is busyと言われた。

fuga:~# mount /home/******/sdb1
hoge:~# mount /home/********************/sdb1/
hoge:~# umount /home/********************/sdb1/
fuga:~# umount /home/******/sdb1
umount: /home/******/sdb1: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

こんな場合はfugaマシン上でumount -lするとアンマウントに成功する。

fuga:~# umount -l /home/******/sdb1

umount -f よりも賢くアンマウントしてくれるようだ。manpageによれば以下。

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

リファレンス

  1. Device or resource busy のマウントポイントをアンマウントする方法 - coblog
  2. umount を実行したら "device is busy" と怒られたときの対応 - tomoyamkungの日記
  3. umount device is busy - Google 検索
  4. Manpage of UMOUNT
  5. umount manpage - Google 検索

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2009-10-20T20:58:13+09:00
  2. Modified: 2009-10-20T20:58:13+09:00
  3. Generated: 2023-08-27T23:09:16+09:00