Introduction
In this article, we will explore the what, who, where, when, why, and how of Network File System (NFS) as Storage Server functionality on the Windows Server 2019 platform, so let's get started.
Overview
NFS enables multiple clients to access and share files over a network, providing a centralized storage solution that enhances collaboration and data management.
What
NFS is a network file system protocol developed by Sun Microsystems that allows file sharing across a network. It enables users to access files and directories located on remote servers as if they were locally available.
Who
NFS is used by organizations, enterprises, and educational institutions that require centralized and shared storage solutions. It is typically managed by IT professionals and system administrators.
Where
NFS can be implemented in various environments, including corporate networks, data centers, and academic institutions. It is widely used in Unix and Linux systems, but can also be configured on Windows and macOS.
When
NFS is used when there is a need to share files and directories among multiple users and systems over a network. It is especially useful in environments that require collaborative access to data and centralized storage management.
Why
Using NFS offers several advantages and some disadvantages:
Pros | Cons |
---|---|
Enables centralized storage management. | Performance can be affected by network issues. |
Facilitates file sharing and collaboration. | Security concerns if not properly configured. |
Reduces storage costs by consolidating resources. | Compatibility issues with different operating systems. |
Scalable and flexible for growing storage needs. | Requires network bandwidth and can experience latency. |
How
Setting up NFS involves several steps:
Install NFS Server Software | Use your operating system’s package manager to install NFS server software (e.g., `apt-get install nfs-kernel-server` on Ubuntu). |
Configure NFS Exports | Edit the `/etc/exports` file to define which directories to share and the access permissions. |
Start and Enable NFS Service | Start the NFS server service and enable it to start on boot (e.g., `systemctl start nfs-kernel-server` and `systemctl enable nfs-kernel-server`). |
Mount NFS Shares | On client machines, use the `mount` command to mount the NFS shares (e.g., `mount -t nfs server:/path/to/share /mnt`). |
Consequences
Implementing NFS has both positive and negative consequences:
Positive |
|
Negative |
|
Conclusion
NFS is a powerful protocol for file sharing and centralized storage management. It provides significant benefits such as enhanced collaboration, cost reduction, and scalability. However, it requires careful configuration and network management to avoid performance and security issues. Overall, NFS is a valuable tool for organizations looking to streamline their data management and improve collaborative workflows.
Install NFS Server
Install NFS Server to share files and folders.
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and Install NFS Server.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# install NFS Server with admin tools
PS C:\Users\Administrator> Install-WindowsFeature FS-NFS-Service -IncludeManagementTools
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Yes SuccessRest... ...
WARNING: You must restart this server to finish the installation process.
# restart computer to apply changes
PS C:\Users\Administrator> Restart-Computer -Force
Using Graphical User Interface (GUI)
Step [2]Run Server Manager and Click [Add roles and features].
Step [3]Click [Next] button.
Step [4]Select [Role-based or feature-based installation].
Step [5]Select a Host which you'd like to add services.
Step [6]Check a box [Server for NFS].
Step [7]Addtional features are required to add NFS Server. Click [Add Features] button and proceed Next.
Step [8]Click [Next] button.
Step [9]Click [Install] button.
Step [10]After finishing Installation, click [Close] button.
Configure NFS Shared Folder
Configure NFS Shared Folder. For example on here, create a shared folder with Host based access permission.
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and Configure NFS Server.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# create NFS Shared Folder
PS C:\Users\Administrator> mkdir C:\NFSshare
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019/03/28 19:22 NFSshare
# set NFS Share
PS C:\Users\Administrator> New-NfsShare -Name "NFSshare01" `
-Path "C:\NFSshare" `
-EnableUnmappedAccess $True `
-Authentication Sys
Name Availability Path
---- ------------ ----
NFSshare01 Standard (not clustered) C:\NFSshare
# grant Read/Write access permission to a Host 10.0.0.110
PS C:\Users\Administrator> Grant-NfsSharePermission -Name "NFSshare01" `
-ClientName "10.0.0.110" `
-ClientType "host" `
-Permission "readwrite" `
-AllowRootAccess $True
# confirm settings
PS C:\Users\Administrator> Get-NfsShare -Name "NFSshare01"
Name Availability Path
---- ------------ ----
NFSshare01 Standard (not clustered) C:\NFSshare
PS C:\Users\Administrator> Get-NfsSharePermission -Name "NFSshare01"
Name ClientName Permission AllowRootAccess
---- ---------- ---------- ---------------
NFSshare01 10.0.0.110 READ, WRITE True
NFSshare01 All Machines DENY ACCESS False
Using Graphical User Interface (GUI)
Step [2]Run Server Manager and Click [File and Storage Services].
Step [3]Select [Shares] on the left pane and click [TASKS] - [New Share...].
Step [4]On this example, select [NFS Share - Quick].
Step [5]On this example, Configure a specific folder as shared one, so check a box [Type a custom path] and input the path for specific folder you'd like to set as shared folder.
Step [6]Input Share Name, Local and Remote Share Path.
Step [7]Specify authentication methods. On this example, set like follows.
Step [8]Set the Share permissions. Click [Add...] button.
Step [9]Specify the Hosts you'd like to grant access permissions.
Step [10]Confirm settings and Click [Next] button.
Step [11]Specify permissions to control access.
Step [12]Confirm selections and it's no ploblem, Click [Create] button.
Step [13]After finishing creating, Click [Close] button.
Step [14]NFS shared folder has been just configured.
Install NFS Client
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and Install NFS Client.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# install NFS Client
PS C:\Users\Administrator> Install-WindowsFeature NFS-Client
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {NFS Client}
Using Graphical User Interface (GUI)
Step [2]Run Server Manager and Click [Add roles and features].
Step [3]Click [Next] button.
Step [4]Select [Role-based or feature-based installation].
Step [5]Select a Host which you'd like to add services.
Step [6]Click [Next] button.
Step [7]Check a box [Client for NFS] and go Next.
Step [8]Click [Install] button.
Step [9]After finishing Installation, click [Close] button.
Connection from NFS Client
This is How to connect to NFS Server from NFS Client. On this example, connect to the NFS Share like this configuration from a Client.
Step [1]Run PowerShell with Admin Privilege on the NFS Client that you set access permission to connect on NFS Server settings. It's possbile to mount NFS Share with the command [C:\Windows\system32\mount.exe] that is installed by NFS Client installation, or also possible to use PowerShell Cmdlet [New-PSDrive] command. On PowerShell by default, [mount] command is set Alias to [New-PSDrive] command, so if use [mount] command, specify full name of the filename [mount.exe].
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# mount with [mount.exe] on Z drive
# syntax is the same with [mount] command on Linux
PS C:\Users\Administrator> mount.exe 10.0.0.101:/nfsshare Z:\
Z: is now successfully connected to 10.0.0.101:/nfsshare
The command completed successfully.
PS C:\Users\Administrator> Get-PSDrive Z
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Z 14.56 64.91 FileSystem \\10.0.0.101\nfsshare
# unmount
PS C:\Users\Administrator> umount.exe Z:\
Disconnecting Z: \\10.0.0.101\nfsshare
The command completed successfully.
# mount with [New-PSDrive] on Z drive
PS C:\Users\Administrator> New-PSDrive -Name Z -PSProvider FileSystem -Root "\\10.0.0.101\nfsshare"
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Z FileSystem \\10.0.0.101\nfsshare
# unmount
PS C:\Users\Administrator> Remove-PSDrive Z
- Get link
- X
- Other Apps
Comments
Post a Comment
Thank you for your comment! We appreciate your feedback, feel free to check out more of our articles.
Best regards, Bizantum Blog Team.