Search the VMware Knowledge Base (KB)
View by Article ID

Remounting a disconnected NFS datastore from the ESXi/ESX command line (1005057)

  • 43 Ratings

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

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 Deleting a datastore from the Datastore inventory results in the error: device or resource busy (1015791).

ESXi 5.x

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.

To add the datastore:

  1. 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

Note: For more information, see Managing NFS/NAS Datastores in the vSphere 5 Command Line Documentation.

ESX/ESXi 3.x and 4.x

To remove a datastore:
  1. List mounted datastores using the command:

    esxcfg-nas -l

    For example, if the NFS datastore is mounted at /nfs2, you see output similar to:

    bf_Ubuntu_nfs-2 is /nfs2 from 10.21.68.149 mounted

  2. Make a note of the NFS datastore in step 1. Run this command to delete the NFS mount:

    esxcfg-nas -d NFS_Datastore_Name

    For example:

    esxcfg-nas -d bf_Ubuntu_nfs-2                         
    NAS volume bf_Ubuntu_nfs-2 deleted.


    Note: This operation does not delete the information on the share, it only 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.
To add the datastore:
  1. Run this command to mount the NFS datastore:

    esxcfg-nas -a -o NFS_IP -s Share_mount_point_on_the_NFS DatastoreName

    For example:

    esxcfg-nas -a -o 10.21.68.149 -s /nfs2 bf_Ubuntu_nfs-2
    Connecting to NAS volume: bf_Ubuntu_nfs-2


    You see output similar to:

    bf_Ubuntu_nfs-2 created and connected.

Impact/Risks

Before performing any steps in this article, ensure that there are no objects registered on the NFS you are trying to unmount. For more information, see Deleting a datastore from the Datastore inventory results in the error: device or resource busy (1015791).

Additional Information

See Also

Update History

05/28/2010 - Merged content from KB 1010840 05/22/2013 - Added section for ESXi 5.x

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 43 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 43 Ratings
Actions
KB: