How to mount a NFS share using CLI

Just a quick post how to mount a NFS share using the ESXi CLI.

You all probably know that when it comes to storage protocols, NFS is often used with NAS storage devices. You can mount a NFS share with the vSphere client. But when mouting a NFS share through the vSphere client fails, it’s handy to try it through the CLI. When mounting a NFS share through the CLI you get more info when the mount fails or successes.

So how can you mount a NFS share using the CLI?

Show all active mounts: esxcfg-nas -l

Delete a NFS share: esxcfg-nas -d [datastorename]

Add a NFS share: esxcfg-nas -a –host [nfsserver dns/ip] –share [share name] [datastorename] –readonly

The option –readonly is optional.

Before you mount a NFS share, make sure you know the full path of the share. It’s possible that you have provided a NFS share name like “VMDatastore1” but that the full export name is /nfs/VMDatastore1. This can be vendor specific.
Share names are case sensitive.

About Michael
Michael Wilmsen is a VMware training/consultant (no specific order) with more than 15 years in the IT industry. Main focus is VMware vSphere, Horizon View and Site Recovery Manager with a deepdive to performance. Michael is VCDX 210, VCAP 4/5 certified, has been rewarded with the vExpert title from 2011, is a PernixPro, Nutanix Tech Champion and a Nutanix Platform Professional.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

You must be logged in to post a comment.