Windows NFS: Back Up to Linux Easily (Guide & Performance)

by Anika Shah - Technology
0 comments

Mounting NFS Shares on Windows: A Comprehensive Guide

Windows has historically been less accommodating to Linux-centric networking protocols. However, mounting Network File System (NFS) shares – a protocol Linux servers have relied on for decades – is now achievable on Windows, offering performance benefits and streamlined file sharing, particularly in mixed operating system environments. This guide details how to enable and utilize NFS on Windows 10 and 11.

Why Use NFS on Windows?

While Server Message Block (SMB) is the native file-sharing protocol for Windows, NFS offers advantages in specific scenarios. On Linux file servers, NFS can outperform SMB, especially with backup-style transfers and workloads involving numerous small files. If you already manage Linux machines, NFS integrates more seamlessly with their native file-sharing capabilities than SMB, which requires installing and configuring Samba. NFS permissions also align directly with Linux’s user and group model, simplifying permission management across operating systems. However, SMB remains the preferred choice for predominantly Windows networks or for users of Windows Home editions.

Enabling the NFS Client on Windows

Windows Pro, Enterprise, and Education editions include a built-in NFS client that requires manual activation. There are two methods to enable it:

  • Using the GUI: Navigate to Control Panel > Programs and Features > Turn Windows features on or off. Locate “Services for NFS” and check the box next to “Client for NFS.” Click OK, and a reboot may be required.
  • Using PowerShell: Open PowerShell as an administrator and execute the following command: Enable-WindowsOptionalFeature -FeatureName ServicesForNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart

The NFS client is not available on Windows Home editions. Users of Windows Home may explore open-source alternatives like ms-nfs41-client, though these are not covered in this guide.

Mounting an NFS Share

Once the NFS client is enabled, mounting a share is straightforward. After connecting to the share, you can map it to a network drive, accessing it like any other network location through Windows Explorer or a terminal. To access the share directly, type the server’s address in the Windows Explorer navigation bar, such as \192.168.1.47.

Addressing Write Access Issues

You may encounter read-only access issues when mounting an NFS share. This often occurs since Windows maps your user to “nobody” on the NFS server, which typically has limited permissions. To resolve this, you can modify the Windows Registry:

  1. Open Registry Editor and navigate to HKEY_LOCAL_MACHINESOFTWAREMicrosoftClientForNFSCurrentVersionDefault.
  2. Create two new DWORD (32-bit) values: AnonymousUid and AnonymousGid.
  3. Set these values to match the User ID (UID) and Group ID (GID) of the user who owns the NFS export directory on the Linux server. Use the id username command on the Linux server to determine these values.
  4. Reboot your computer for the changes to take effect.

Backing Up with NFS

NFS is well-suited for backup solutions. Tools like Restic are designed for efficient, incremental backups with built-in compression and encryption, making them ideal for use with NFS shares. Backups can be automated using Windows Task Scheduler.

NFS Versions and Security

Windows’ NFS client supports NFS versions 2 and 3. If your server is configured for NFS version 4 only, you’ll need to enable version 3 as well, or consider an alternative approach. NFSv3 does not support encryption in transit, making it best suited for trusted networks. For backups over untrusted networks, consider NFSv4 with Kerberos or tunneling traffic through a VPN.

The setup process is relatively simple, and once configured, backups and file transfers occur seamlessly. For those already utilizing Linux servers, NFS provides a direct and efficient path for integrating Windows machines into their storage infrastructure.

Related Posts

Leave a Comment