vim-cmd hostsvc/datastore/info <datastore name> | grep -A2 forceMountedInfo| grep -E "force|persist|mounted|}'"If the datastore is not force mounted, this command will return:
forceMountedInfo = (vim.host.ForceMountedInfo) null,If the datastore is force mounted, this command will return output similar to:
forceMountedInfo = (vim.host.ForceMountedInfo) { persist = true, mounted = true },(For a force mount which does not persist after host reboot, persist will equal false.)
esxcfg-scsidevs -m | grep -v OSDATA | awk '{print $NF}' | while read i; do echo $i; vim-cmd hostsvc/datastore/info $i| grep -A2 forceMountedInfo| grep -E "force|persist|mounted|}'"; done
esxcfg-info -a | grep "Is Force Mounted" -B13
Output will be similar to:
|----Head Extent........................................naa.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
|----Console Path......................................./vmfs/volumes/xxxxxxxx-xxxxxxxx-xxxx-xxxxxxxxxxxx
|----Block Size.........................................1048576
|----Total Blocks.......................................122624
|----Logical Disk Block Size............................512
|----Physical Disk Block Size...........................512
|----isSw512e...........................................false
|----Blocks Used........................................3500
|----Size...............................................128580583424
|----Usage..............................................3670016000
|----Lock Mode..........................................Public Vmfs5
|----Major Version......................................6
|----Minor Version......................................82
|----Is Force Mounted...................................true