Mounting a File system On a Windows Instance Using NFS
Prerequisites
-
The file system must be created and have at least one export in a mount target. See Creating a File System, Mount Target, and Export.
-
The mount target must have correctly configured security rules or be assigned to an NSG. See Configuring VCN Security Rules for File Storage.
-
You must know the mount target's IP address. See Obtaining the Mount Target IP Address.
-
You must be able to log into the Microsoft Windows OS on the instance with superuser or administrator privileges.
Before You Begin
The following tasks are included in this procedure, and you might want to be aware of them before you begin.
-
Installation of the Microsoft Windows NFS Client – This service must be installed on the instance from which you want to mount the file system. Installing the client often requires a restart of the instance.
-
The
AnonymousGid
andAnonymousUid
identity values must be configured to allow write access. – Access to NFS file systems requires UNIX user and group identities, which are not the same as Microsoft Windows user and group identities. By default, file systems write permissions are only granted to the root user. To enable user access to NFS shared resources, the Microsoft Windows client for NFS accesses file systems anonymously, usingAnonymousGid
andAnonymousUid
.Caution
Updating the AnonymousGid and AnonymousUid values require registry changes to your instance.
Choose one the following methods:
Using the Microsoft Windows Command Prompt
-
Log into your Microsoft Windows instance.
-
Open Microsoft Windows PowerShell and run as Administrator:
-
Go to Start and open PowerShell.
-
In PowerShell, type the following to run as Administrator:
Start-Process powershell -Verb runAs
-
In the User Account Control window, select Yes. A new Administrator: PowerShell window opens. You can close the standard PowerShell window to avoid confusing them.
-
-
In Administrator: PowerShell, get the NFS client and update the registry by typing the following:
Install-WindowsFeature -Name NFS-Client Set-ItemProperty HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -Name AnonymousUid -Value 0 Set-ItemProperty HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -Name AnonymousGid -Value 0 Stop-Service -Name NfsClnt Restart-Service -Name NfsRdr Start-Service -Name NfsClnt
-
Open a standard Command Prompt Window.
Important
NFS file systems mounted as Administrator are not available to standard users.
-
From the Command Prompt window, mount the file system.
See the cautions and notes below the example.
In the following example, replace:
-
10.x.x.x
with the mount point IP address (see Obtaining the Mount Target IP Address) -
fs-export-path
with the file system export path (see Creating a File System, Mount Target, and Export) -
X
with the drive letter of any available drive you want to map the file system to.
Example:
mount 10.x.x.x:/fs-export-path X:
-
-
Verify that you can access and write to the file system.
-
Access the file system.
In the example, replace
X
with the drive letter you used to mount the file system.X:
-
Write a file.
echo > myfile.txt
-
Verify that you can view the file.
dir
-
Using the Microsoft Windows File Explorer
-
Log into your Microsoft Windows instance.
-
Open Microsoft Windows PowerShell and run as Administrator:
-
Go to Start and open PowerShell.
-
In PowerShell, type the following to run as Administrator:
Start-Process powershell -Verb runAs
-
In the User Account Control window, select Yes. A new Administrator: PowerShell window opens. You can close the standard PowerShell window to avoid confusing them.
-
-
In Administrator: PowerShell, get the NFS client by typing the following:
Install-WindowsFeature -Name NFS-Client
-
If necessary, restart your system.
-
Open the registry editor (regedit) to map the AnonymousGid and AnonymousUid to the root user.
Caution
User identity mapping requires changes to your system registry.
-
Select Windows Search.
-
Enter
regedit
in the Search field and press Enter. -
Select Yes to allow changes to your device.
-
Select
HKEY_LOCAL_MACHINE
. Then, browse to:Software\Microsoft\ClientForNFS\CurrentVersion\Default
.
-
-
Add a new DWORD32 registry entry for
AnonymousGid
:-
Select Edit, and select New DWORD (32 bit) Value.
-
In the Name field, enter
AnonymousGid
. Leave the value at0
.
-
-
Repeat the previous step to add a second DWORD32 registry entry named
AnonymousUid
with a value of0
. -
Open Microsoft Windows Command Line (CMD) and run as Administrator:
-
Go to Start and scroll down to Apps.
-
In the Windows System section, press CTRL+Shift and select Command Prompt.
-
-
In the Microsoft Windows Command Line (CMD) window, restart the NFS Client by typing the following:
nfsadmin client stop
nfsadmin client start
-
Open File Explorer and select This PC. In the Computer tab, select Map network drive.
-
Select the Drive letter that you want to assign to the file system.
-
In the Folder field, enter the following line, replacing:
-
10.x.x.x
with the mount point IP address (see Obtaining the Mount Target IP Address) -
fs-export-path
with the file system export path (see Creating a File System, Mount Target, and Export)
Line:
\\10.x.x.x\fs-export-path
-
-
Select Finish.