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.

Warning

Installing the Windows NFS client may require a restart of your system.
Access to NFS file systems requires UNIX-style user and group identities, which are not the same as Windows user and group identities. To enable users to access NFS shared resources, Windows client for NFS accesses file systems anonymously, using 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.
Warning

Updating the 'AnonymousGid' and 'AnonymousUid' values require registry changes to your system.
After you have installed the NFS client and correctly mapped user identities, you can mount the file system to any available drive letter using the command line or Map network drive. You can access your file system through the chosen drive letter to write files.

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

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 the timeo has been specified as less than 300 seconds. This combination can cause a profusion of I/O error responses.
  • rsize, or wsize. These options cause issues with performance.
Note

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

To mount a file system from Windows Server 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.

  1. Open Windows PowerShell and run as Administrator:

    1. Go to Start and click the Windows PowerShell icon.
    2. In Windows PowerShell, type the following to run as Administrator:

      Start-Process powershell -Verb runAs
    3. 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.
  2. 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.

  3. Close the Administrator: PowerShell window. Open a standard Command Prompt Window:

    1. Click Start, then click Command Prompt.
    Important

    NFS file systems mounted as Administrator are not available to standard users.
  4. 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, and X 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:
  5. Write a file to the file system by typing the following. Replace X with the drive letter you used in step 10 and helloworld with your file name.

    X:
    echo > helloworld.txt
  6. 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

To mount a file system from Windows Server 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.

  1. Open Windows PowerShell and run as Administrator:

    1. Go to Start and click the Windows PowerShell icon.
    2. In Windows PowerShell, type the following to run as Administrator:

      Start-Process powershell -Verb runAs
    3. 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.
  2. In Administrator: PowerShell, get the NFS client by typing the following:

    Install-WindowsFeature -Name NFS-Client
  3. If necessary, restart your system.
  4. Open the registry editor (regedit) to map the AnonymousGid and AnonymousUid to the root user.

    Warning

    User identity mapping requires changes to your system registry.
    1. Click Windows Search.
    2. Enter regedit in the Search field and press Enter.
    3. Click Yes to allow changes to your device.
    4. Click HKEY_LOCAL_MACHINE. Then, browse to: Software\Microsoft\ClientForNFS\CurrentVersion\Default.
  5. Add a new DWORD32 registry entry for AnonymousGid:

    1. Click Edit, and select New DWORD (32 bit) Value.
    2. In the Name field, enter AnonymousGid. Leave the value at 0.
  6. Repeat step 5 to add a second DWORD32 registry entry named AnonymousUid with a value of 0.

    This image shows the registry and the new anonymousUid and anonymousGid entries.

    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.

  7. Open Windows Command Line (CMD) and run as Administrator:

    1. Go to Start and scroll down to Apps.
    2. In the Windows System section, press Ctrl+Shift and click Command Prompt.
  8. In the Windows Command Line (CMD) window, restart the NFS Client by typing the following:

    nfsadmin client stop
    nfsadmin client start
  9. Open File Explorer and select This PC. In the Computer tab, select Map network drive.

  10. Select the Drive letter that you want to assign to the file system.
  11. In the Folder field, enter the following. Replace 10.x.x.x with the local subnet IP address assigned to your mount target, and fs-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\!
  12. 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:

This diagram shows an example directory structure and mount point.

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.

Warning

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.
To mount a file system subdirectory
  1. Choose the method you want to use to mount the file system Using Windows Command Prompt or Using Windows File Explorer.
  2. Follow the instructions to install the NFS client and add the registry entries for AnonymousGid and AnonymousUid.
  3. 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:
    1. 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:
    2. 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