Mounting a Linux partition/USB device as an NFS share to an ESXi host
book
Article ID: 306524
calendar_today
Updated On: 06-17-2024
Products
VMware vSphere ESXi
Issue/Introduction
This article provides steps to mount a Linux partition/USB device as an NFS share to an ESXi host.
You may want to mount a Linux partition/USB device as an NFS share to an ESX/ESXi host to:
- Copy files from local datastore to a USB device without using the datastore browser download option.
- Clone/copy a running virtual machine to a USB device.
Environment
VMware ESXi 4.0.x Installable
VMware ESXi 4.0.x Embedded
VMware vSphere ESXi 5.1
VMware ESXi 4.1.x Installable
VMware ESX Server 3.5.x
VMware ESX 4.1.x
VMware ESXi 4.1.x Embedded
VMware ESX 4.0.x
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 5.0
VMware ESXi 3.5.x Embedded
Resolution
To export the share/USB to an ESX/ESXi host as an NFS share:
- Connect a USB drive to a Linux machine
- Ensure that the USB device is detected and mounted to that machine.
For example, run this command to mount a USB device in Linux:
mount /dev/sdX /mnt/usb
- Create a file-share in that USB device.
For Example:
/mnt/usb/fileshare
- Verify and ensure that NFS services are running on the Linux machine.
Note: You can use this command to start the services:
apt-get install nfs-kernel-server
- Open the /etc/exports file in the Linux machine using a text editor.
- Add a line similar to:
/mnt/usb/fileshare IP_address (rw,sync,no_root_squash,no_subtree_check)
Where IP_address is the IP address of the host.
- Save and close the file.
- Run this command and ensure that you do not see any warnings/errors:
exportfs -a
- Connect to the ESX/ESXi server using the vSphere Client.
- Click the Configuration tab.
- Click Storage.
-
Click Add Storage.
-
Select Network File System and click Next.
-
Enter these information:
-
Server – IP address of the Linux machine
-
Folder – NFS share path
For example, /mnt/usb/fileshare
-
Name – Any label of your choice
-
Click Next.
-
Click Finish.
You should now be able to see the USB device as a datastore under Configuration > Storage > Datastores.
Feedback
Was this article helpful?
thumb_up
Yes
thumb_down
No