If I create the following mount:
mount -o user=root,pass=test123 //samba1/testshare /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5
I can view it by running 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)
Is there a way I can check if the mount is ready/not busy after I create it?
For example, if I try to create the mount again, I get an error message saying the device or resource is busy (rather than a more accurate 'mount already created' message):
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)
I'm trying to find a way to distinguish between:
- A mount that has already been created and is ready
- A mount that has already been created and is not ready
Would this be suitable:
lsof -n | grep /mnt/d928a47b-9ee0-40cd-a356-fa382a7ea8e5
// If non-empty result == mount is not ready/busy?