マウントが準備されているか(使用していない)確認するには?

マウントが準備されているか(使用していない)確認するには?

次のインストールを作成する場合:

mount -o user=root,pass=test123 //samba1/testshare /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5

以下を実行して表示できますmount

mount
...
//samba1/testshare on /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5 type cifs (rw,relatime,vers=3.1.1,cache=strict,username=root,uid=0,noforceuid,gid=0,noforcegid,addr=172.17.0.2,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,user=root)

インストールを作成したら、インストールが準備されているかどうかを確認する方法はありますか?

たとえば、マウントを再生成しようとすると、デバイスまたはリソースが使用中であるというエラーメッセージが表示されます(より正確な「マウント生成済み」メッセージの代わりに)。

mount -o user=root,pass=test123 //samba1/testshare /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5
mount error(16): Device or resource busy
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

私は以下を区別する方法を見つけようとしています。

  • マウントを作成して準備しました。
  • マウントが作成されましたが、準備ができていません。

これは適切ですか?

lsof -n | grep /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5 
// If non-empty result == mount is not ready/busy?

答え1

lsof -n /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5 

または

fuser -um /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5 

fuser--killオプションもあります

関連情報