Remounting a disconnected NFS datastore from the ESXi command line
search cancel

Remounting a disconnected NFS datastore from the ESXi command line

book

Article ID: 344470

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • You cannot unmount an NFS datastore because:
    • The NFS datastore has running or registered objects.
    • The NFS share has been disconnected from the host.
       
  • In VMware Infrastructure Client or vSphere Client, you see an error:

    Unmount Filesystem Busy


Environment

VMware ESXi 4.0.x Embedded
VMware ESX 4.0.x
VMware ESXi 4.0.x Installable
VMware ESXi 4.1.x Installable
VMware ESX 4.1.x
VMware ESX Server 3.5.x
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 8.0.x
VMware vSphere ESXi 6.7
VMware ESXi 4.1.x Embedded
VMware ESXi 3.5.x Embedded
VMware vSphere ESXi 5.0
VMware ESX Server 3.0.x
VMware vSphere ESXi 5.1
VMware vSphere ESXi 7.0.0
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.5
VMware vSphere ESXi 5.5

Cause

This issue can occur if the NFS server is removed without removing the NFS datastore. Re-adding the NFS server does not refresh the datastore mount.

Resolution

To resolve this issue, remove and re-add the datastore via the command line.
 
Caution: Before performing any steps in this resolution, ensure that there are no objects registered on the NFS you are trying to unmount. For more information, see: 

ESXi 6.x and later

To remove a datastore:
  1. To list the mounted datastores on the host:

    esxcli storage nfs list
     
  2. Make a note of the NFS datastore from step 1. Run this command to delete the NFS mount:

    esxcli storage nfs remove -v NFS_Datastore_Name

    Note: This operation does not delete the information on the share, it unmounts the share from the host. If the NFS datastore is being used by either a virtual machine or a third party script, you may see this error:

    Error performing operation: NFS Error: Unable to Unmount filesystem: Busy.
           If you see this error, refer to the Caution section above

To add the datastore:

Run this command to mount the NFS datastore:

esxcli storage nfs add -H NFS_IP|NFS_HOSTNAME -s Share_mount_point_on_the_NFS -v DatastoreName

Additional Information


从 ESXi/ESX 命令行重新挂载已断开连接的 NFS 数据存储
切断された NFS データストアの ESXi/ESX コマンド ラインからの再マウント