How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix

In this article how we can have shared disks between Microsoft Windows Server and Unix through the protocol NFS. We will see step by step how to create a Microsoft Windows NFS Server and how to mount the disks on Unix (RedHat / Oracle Linux 8). In Oracle databases shared disks are necessary in clustering processes such as for installation Oracle Real Application Clusters (RAC) and very useful in Export / Import processes between systems.

The installation

On Windows Server (NFS Server)

For the installation we will use the example of the operating system Microsoft Windows Server 2019 Standard Edition.

As a first step we select on the screen Server Manager, Add roles and features.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
01

Then in the window that will appear at Installation Type we choose Role-based or feature-based installation.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
02

Then we choose Select a server from the server pool and choose our server.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
03

In the next tab with Server Roles we select it Server for NFS located below the File and Storage Services, File and iSCSI Services.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
04

During the installation process it will ask us if we want it to restart and we will choose to do so.

When the server opens again, go to its screen Server Manager, File and Storage Services and Shares. There we click on the option To create a file share, start the New Share Wizard.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
05

With the Wizard open, we choose NFS Share – Quick.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
06

On the next screen we define if we want to do Share entire disk or specific folder. For example I have shared a folder named NFS.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
07

Then we define the name it will have Share and shows us the Remote path to share with which we will be able to mount it on Unix systems.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
08

Then we choose the way it will do authentication. For this particular case we choose No server authentication (AUTH_SYS), Enable unmapped user access, Allow Unmapped user access by UID/GID .

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
09

On the next screen selecting Add… we will add the machines that will have access and the right that they will have.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
10

After we choose Add…, we define at Host the name of the machine, as Share permissions Read / Write and Allow root access.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
11

Now we will see that it has been created NFS Share in the Server Manager and we can from the TASKS to repeat the process to add more if desired.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
12

Finally we make sure that it does not cut us Windows Defender Firewall. In this case I turned it off.

How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
13

On Unix machines

Now we should go to each Unix machine (which in our case is Oracle Linux 8) and do mount the NFS Share.

First we connect with root user:

su root

We create the folder in which the File System will be mounted:

mkdir -p /oracle/nfs

To be sure that we will not cut our rights to the NFS Server, go to the exports file:

vi /etc/exports

And we add the following entry for each mount share:

/oracle/nfs         *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Then we restart the service:

chkconfig nfs on
service nfs restart

Then we go to the fstab file to add the nfs shares we want to mount:

vi /etc/fstab

The only thing we will have to configure from the following. is the first parameter with the Remote path to share (image 08) and the name of the folder we created to mount the File System:

win-nfs:/nfs /oracle/nfs  nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
14

Then we mount it NFS Share with the following command with the name of the folder we set to mount:

mount /oracle/nfs

Finally, define the user we want to be the owner of this folder and the rights he will have (the folder):

chown -R oracle:oinstall /oracle/nfs
chmod -R 775 /oracle/nfs

To see that the disk has been mounted, execute the following:

df

And to see the owner and the rights of the folder that has been mounted in the File System, we run the following:

ls -la
How do we set up a Windows Server as an NFS Server to have shared NFS disks on Unix
15

If we want to add other NFS Shares we repeat the process.

Sources:

Share it

Leave a reply