Mounting File Systems From Windows Instances
Users of Windows Server 2012 R2 and later versions can mount a file system on any available drive letter using the mount target IP address and the file system export path.
The Windows NFS client must be installed on the instance from which you want to mount the file system.
Installing the Windows NFS client may require a restart of your system.
AnonymousGid
and AnonymousUid
. On brand new file systems, write permissions are only granted to the root user. The AnonymousGid
and AnonymousUid
identity values must be configured to allow write access.
Updating the 'AnonymousGid' and 'AnonymousUid' values require registry changes to your system.
Prerequisites
- The file system must have at least one export in at least one mount target. When you create a new file system, an export for the file system is created at the same time. See Creating File Systems for more information.
- Correctly configured security rules for the mount target. See Security Rules for information about how security rules work in Oracle Cloud Infrastructure. Use the instructions in Configuring VCN Security Rules for File Storage to set up security rules correctly for your file systems.
When mounting file systems, the following mount option combination is not supported by the File Storage service:
soft
when the file system is mounted with the read/write mount option (-o rw
). This combination can cause corruption of your data.
The following mount options or mount option combinations are not recommended for use with the File Storage service:
soft
when the file system is mounted with the read-only mount option (-o ro
) and thetimeo
has been specified as less than300
seconds. This combination can cause a profusion of I/O error responses.rsize
, orwsize
. These options cause issues with performance.
When mounting file systems, Network Lock Manager (NLM) is enabled for file locking by default. The default requires no specified mount option. Typical NFS workloads function normally using the default.
Some applications might require you to specify the nolock
mount option. Refer to your application documentation for best practices regarding this mount option.
Using Windows Command Prompt
If you are using Oracle-provided Windows images, the NFS client is already installed, and the correct user identities are mapped. Skip to step 4.
-
Open Windows PowerShell and run as Administrator:
- Go to Start and click the Windows PowerShell icon.
-
In Windows PowerShell, type the following to run as Administrator:
Start-Process powershell -Verb runAs
- In the User Account Control window, click 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 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
Important
If you've set export options for your file system to require clients to connect from a privileged source port (1-1023), then you must set the UseReservedPorts registry key to 1.
For example:
Set-ItemProperty HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -Name UseReservedPorts -Value 1
For more information, see Working with NFS Export Options.
-
Close the Administrator: PowerShell window.
Open a standard Command Prompt Window:
- Click Start, then click Command Prompt.
Important
NFS file systems mounted as Administrator are not available to standard users. -
In the standard Windows Command Line (CMD) window, mount the file system by typing the following. Replace
10.x.x.x:
with the local subnet IP address assigned to your mount target,fs-export-path
with the export path you specified when associating the file system with the mount target, andX
with the drive letter of any available drive you want to map the file system to.mount 10.x.x.x:/fs-export-path X:
Tip
IP address and export path information is available in the Details page of the mount target associated with your file system. See To view details of a mount target for more information.Important
The export path is the path to the file system (relative to the mount target IP address or hostname). If you did not specify a path when you associated the file system and mount target, then "/" represents the full extent of the mount target. In that case, you must use a "!" when mounting the file system. For example:mount 10.0.0.0:/! X:
-
Write a file to the file system by typing the following. Replace
X
with the drive letter you used in step 10 andhelloworld
with your file name.X:
echo > helloworld.txt
-
Verify that you can view the file by typing the following.
dir
See Troubleshooting Windows NFS Connections for more information about common issues you might encounter.
Using Windows File Explorer
If you are using Oracle-provided Windows images, the NFS client is already installed, and the correct user identities are mapped. Skip to step 9.
-
Open Windows PowerShell and run as Administrator:
- Go to Start and click the Windows PowerShell icon.
-
In Windows PowerShell, type the following to run as Administrator:
Start-Process powershell -Verb runAs
- In the User Account Control window, click 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.- Click Windows Search.
- Enter
regedit
in the Search field and press Enter. - Click Yes to allow changes to your device.
- Click
HKEY_LOCAL_MACHINE
. Then, browse to:Software\Microsoft\ClientForNFS\CurrentVersion\Default.
-
Add a new DWORD32 registry entry for
AnonymousGid
:- Click Edit, and select New DWORD (32 bit) Value.
- In the Name field, enter
AnonymousGid
. Leave the value at0
.
-
Repeat step 5 to add a second DWORD32 registry entry named
AnonymousUid
with a value of0
.Important
If you've set export options for your file system to require clients to connect from a privileged source port (1-1023), then you must set the UseReserverdPorts registry key to 1.
For more information, see Working with NFS Export Options.
-
Open 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 click Command Prompt.
-
In the 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. Replace
10.x.x.x
with the local subnet IP address assigned to your mount target, andfs-export-path
with the export path you specified when associating the file system with the mount target.\\10.x.x.x\fs-export-path
Tip
IP address and export path information is available in the Details page of the mount target associated with your file system. See To view details of a mount target for more information.Important
The export path is the path to the file system (relative to the mount target IP address or hostname). If you did not specify a path when you associated the file system and mount target, then "\" represents the full extent of the mount target. In that case, you must use a "!" when entering the file system folder path. For example:\\10.0.0.0\!
- Click the Finish button when complete.
See Troubleshooting Windows NFS Connections for more information about common issues you might encounter.
Mounting File System Subdirectories
If your file system has an existing directory structure, you can mount any file system subdirectory. The subdirectory becomes the effective root directory at the mount point of the instance, and excludes sibling directories.
For example, suppose "FileSystem1" has an export path of /FileSystem1
and a directory structure like this:
The file system is exported from "MountTarget1" which has an IP address of 10.0.0.16
.
The following command mounts directoryA
to drive letter X:
mount 10.0.0.16:/rootdirectory/directoryA X:
Neither directoryB
or FileB
would be accessible from drive X.
Mounting a subdirectory to limit access to sibling directories is not sufficient to secure your file system. For information on security methods, see About Security.
- Choose the method you want to use to mount the file system Using Windows Command Prompt or Using Windows File Explorer.
- Follow the instructions to install the NFS client and add the registry entries for
AnonymousGid
andAnonymousUid
. - After the NFS client is installed and registry entries are added, both mounting methods describe how to enter the mount information for the file system. Depending on which method you use, edit the mounting information to append the subdirectory path to the export path:
If you're Using Windows Command Prompt, type the following command (step 4):
- Replace
10.x.x.x:
with the local subnet IP address assigned to your mount target. Replace
fs-export-path
with the export path you specified when associating the file system with the mount target.- Replace
directory-path
with the path from the root directory to subdirectory you want to mount.
mount 10.x.x.x:/fs-export-path/directory-path X:
- Replace
If you're Using Windows File Explorer, enter the following in the Folder field of the drive letter you want to map the file system to (step 11):
- Replace
10.x.x.x:
with the local subnet IP address assigned to your mount target. Replace
fs-export-path
with the export path you specified when associating the file system with the mount target.- Replace
directory-path
with the path from the root directory to subdirectory you want to mount.
\\10.x.x.x\fs-export-path\directory-path
- Replace