Hello, everyone.
In this demo, I'm going to show you how to configure remote file systems with NFS.
NFS or network file system is also known as a client and server file system.
And if this is a distributed file system protocol that allows users to share remote directories over
a network.
As you can see here on the screen, I'm using Tmax is a terminal multiplexer and I have two machines
on the left side.
I have the server machine and on the right side I do have the client machine.
Right now I'm going to start configuring the server machine first.
Then I'm going to configure the client machine.
The first step.
I need to install the NFS packages so I'm going to run the command m install nfs utils hit enter.
I already have the packages installed on the system in case if you don't have it then you have to install
it.
I'll run the command yum install and this is the name of the NFS packages.
The next step I need to start the NFS service so I'm going to run the command.
First.
I'm going to run the command system Ctl status, then NFS server that.
Surface.
It's inactive.
Now I'm going to start the surface system.
Ctl start NFS Server.
You don't have to type that surface.
You can just type the NFS server hit enter.
Perfect.
Now I'm going to check the status.
It's active in case if the NFS.
Surface.
Disable, then what you need.
You need to run the command systemctl enable then dash dash.
Now then NFS dash server hit enter.
Then you're going to enable the service.
Now the next step I'm going to check the LS block.
I'm going to check the blocks here.
I'm going to use this hard disk.
In order to make a mount point so I don't have a mount point for this device or hard disk.
So I'm going to create a directory and I'm going to call this one storage dash server.
Hit enter.
Perfect.
Right now.
Before I'm going to write or to do the permanent or persistent Mount Point, I need to check the file
system type.
It's already ZFS.
So in case if you want to make the file system type for this device so you can run the command Mkfs
dash T so and then ZFS, then dev dash slash std perfect.
It's already have the.
ZFS file system type.
Right now, let's move on.
Now I'm going to do the permanent or persistent Mount Point, so I'm going to add the mount point and
the configuration file, the slash Etsy slash fstab hit enter here at the end.
I'm going to add a new line.
The mount device dev slash SDB, then the mount point slash storage dash server, then the type, the
file system type ZFS then defaults.
Then zero zero.
Perfect, Skip.
Then I'm going to save the file.
Tail dash n the last line.
I just would like to show the last line and.
Uh, the slash ATC slash stab.
Perfect.
Now I'm going to do the Mount Dash.
A mount?
Then I'm going to grip by grip.
Slash, slash, hit enter.
This is the mount point for this device.
Perfect.
LZ, block.
As you can see over here, this is the mount point for this device.
The next step I need to modify the slash ATC slash exports.
So in this file I need to give the exported file system read or write permissions in order to allow
remote machines to make changes to the directory.
The mount point that we did, the slash storage dash server shared on the file system.
Then also I have to type the no underscore root underscore squash option in order to enable remote users
to have the root privileges.
So I'm going to modify and add.
First, I'm going to add the Mount Point storage.
Then dash.
Server, then I'm going to type the star in between the brackets.
I'm going to type the right.
And read permissions, then comma, then no underscore root.
This is the this is the option that I mentioned about that I need to enable remote users to have root
privileges then squash.
Perfect.
So if I don't like to write the start, I can write the IP address if I would like.
But in this case I'm just going to use the start.
It means that any IP address that has the access point after we're going to configure the client to
access this.
Directory does the slash storage dash server.
Now I'm going to save the file.
And X force.
Perfect.
The next step, I'm going to run the command export FS.
Export is perfect.
Then I'm going to use the option dash r av.
So the dash a.
Let's start with the first is the re-export, all the directories, then the export, all the directories
and here in order the V in order to show what's going on with the file.
So I'm going to hit enter perfect.
As we can see here, this is the exporting right now.
We're going to do the exporting to this directory.
Now, the next step, if I would like to display the current export list, I need to run the command
export FS, then dash s hit enter, as we can see over here.
This is the current export list.
Now the next step there is an extra this is an extra step if I would like to do so.
If I would like to show amount information for the NFS server, I can run the command show mount then
dash E in order to show the NFS servers export list.
Hit enter.
Just wait for a few seconds.
As we can see right here on the screen, this is the export list for the server.
The last step.
I need to add the NFS surface to the firewall.
D in order to allow traffic to the necessary NFS surfaces.
So I'm going to run the command fire wall.
Dash cmd, then dash dash.
Permanent.
Then dash dash, add dash surface then nfs hit enter.
Okay.
Succeed.
It's all good.
Now we're going to run the command firewall.
CMD, then Dash, dash, reload.
If I would like to run the command.
Dash, dash, dash.
All.
As you can see over here, we have the NFS.
Also, there is another command here.
The service hit enter.
As you can see, this is we added the NFS.
Surface to the firewall in order to allow traffic to the necessary NFS surfaces.
I'm going to show the IP address right now for this machine.
The server machine show in s 33.
This is the IP address here.
Perfect.
And there's also another command.
If I would like to use the F config then in FS 33 hit enter.
This is the IP address also here.
Now I'm going to move on to.
To the client machine.
I need to configure the NFS on the client machine.
The first step I need to install the packages and install the NFS dash utils.
Okay.
Perfect.
I already have the package installed on the client machine.
Now the next step I need to check systemctl status NFS dash server.
Okay.
That's perfect.
Hit enter.
Now I need to.
It's inactive, it's dead.
So I need to enable it.
System Ctl.
Enable dash dash.
Now then.
NFS server dot service.
Hit.
Enter.
Perfect.
Let me check the status.
Active.
Good.
Now the next step.
I'm going to create a directory for the Mount Point Make directory.
I'm going to call this one storage dash client.
You can see the differences here is I this is the client and I already made or created a directory on
the server side or the server machine slash storage dash server hit enter.
Perfect.
Now the next step, I'm going to do a permanent or persistent mount Point, so I'm going to go to the
slash etsy slash fstab.
If.
Step.
Enter.
I'm going to create an ad, So as I said, here is the IP address.
So I'm going to this is the mount device.
So I'm going to start with the IP address.
172 dot 16 .8.131.
Then I have to add colon, then slash storage dash server.
So the IP address calling, then the name of the mount point, the directory.
Next I'm going to type the mountpoint on the client machine.
So storage.
Dash client next.
Now is the filesystem type and NFS.
So for this one, the client side, we have to type the filesystem type NFS, then defaults.
Zero zero.
Done.
I'm going to save the file.
Right now I'm going to do the Mount Dash A.
Now I'm going to run the command mount, then the pipe grip, then slash storage dash server.
As you can see over here, this is the mount.
Device on the server machine.
Now I'm going to do a CD slash storage dash client.
LS Dash L We don't have any file or directory, so I'm going to create a text file.
And also I'm going to create another text file and LS Dash L As we can see here, over here we have
two text files.
Now I'm going back to the server machine.
CD slash storage dash server ls l As we can see over here, we have these two text files.
I'm going to make a directory here, make directory d i r hit enter.
LS dash l hit enter.
Here is the directory.
Now I'm going to move back to the client machine.
LS l As you can see over here, we created the directory on the server machine and we can see it on
the client machine.
Thus concludes our session.
Thank you and see you in the next lesson.