In Linux, there are a couple of file-sharing protocols used to share storage and files across a network. The most widely used ones are Samba and NFS.
Samba is a popular open-source application suite that works in a client-server architecture. It offers cross-platform compatibility enabling seamless file sharing across Linux, Windows, and macOS operating systems. A file share hosted on a Linux system can be accessed from diverse platforms, thus fostering collaboration.
Another widely used file-sharing protocol is NFS, short for Network File Share. Just like Samba, it works on a client-server model and allows a user to share directories and files across a network with multiple remote client users.
In this guide, we will check out how to install the NFS server and client on RHEL-based distributions such as Fedora, CentOS Stream, Rocky Linux, and AlmaLinux.
NFS Services
Currently, there are 3 versions of NFS, the latest one being NFSv4 which includes features such as the ability to work over the internet and across a firewall. In addition, there is NFSv3 and NFSv2 which is the oldest protocol.
The NFS service is made up of the NFS Server and client. The NFS server comprises the following key files:
- nfs-server – This allows client systems to access the NFS-shared files.
- rpcbind – converts RPC programs to universal addresses.
- nfs-idmap – Carries out the translation of the user and group IDs to names and user and group names into IDs.
- portmap – This is a server that converts RPC program numbers to IP port numbers.
- nfslock – In case of an NFS server crash, the nfslock starts the required RPC processes.
NFS Configuration Services
Here are some of the key configuration files for NFS:
- /etc/exports – The main configuration file, which stipulates the filesystems or directories to be exported and accessed by remote users.
- /etc/fstab – This is a file that contains entries of mounted partitions. In NFS, the file contains entries of NFS share directories or filesystems which are permanently mounted and can persist a reboot.
- /etc/sysconfig/nfs – It defines the ports needed during the running of RPC services.
NFS Server and Client Setup
To set up NFS shares, we’ll need at least two Linux/Unix machines. Here in this tutorial, I’ll be using two servers.
- NFS Server – RHEL 9 with IP 10.128.15.213
- NFS Client – RHEL 9 with IP 10.128.15.214
Install NFS on Server and Client
To start off, you need to log into both nodes (NFS server and client) and install the NFS services. First, update the package information as shown. The following dnf command will also upgrade all the exciting packages to their latest versions.
$ sudo dnf update
Once the update is complete, proceed and install the requisite NFS services.
$ sudo dnf install rpcbind nfs-utils -y
The next step is to enable the NFS services as shown.
$ sudo systemctl enable nfs-server $ sudo systemctl enable rpcbind
Be sure to also start the NFS services.
$ sudo systemctl enable nfs-server $ sudo systemctl enable rpcbind
It’s crucial to verify that all the NFS services are running.
$ sudo systemctl status nfs-server $ sudo systemctl status rpcbind
Be sure to also configure the firewall in order to allow inbound NFS services as follows.
$ sudo firewall-cmd --permanent --add-service={nfs,rpc-bind,mountd} $ sudo firewall-cmd --reload
Create an NFS Share Directory
With all the NFS services installed and running as expected, it’s time to create the NFS share directory, which is the directory that will contain files that will be accessed by NFS clients in the network.
In this case, we will create an NFS share directory called my_nfsshare in our home directory.
$ mkdir -p /home/tecmint/my_nfsshare
Next, assign directory permissions. For demonstration purposes, we will assign global permissions that will accord NFS clients read, write, and execute permissions.
$ sudo chmod 777 -R /home/tecmint/my_nfsshare
Export an NFS Share Directory
The next step is to export the NFS share directory. In order to achieve this, we need to make an entry in the /etc/exports file. Therefore, access the file using your preferred text editor. In this case, we will use the Vim editor.
$ sudo vim /etc/exports
Add the following entry. Be sure to replace the server-ip with your NFS server’s IP address.
/home/tecmint/my_nfsshare server-ip/24(rw,no_root_squash)
Finally export the NFS share directory or filesystem.
$ sudo exportfs -rv
Run the following command to view the NFS shares.
$ showmount -e localhost
Configure NFS Client
The remaining phase of this exercise is to configure the NFS client in order to access the shared directory. First, confirm that you can view the export list or NFS shares on the NFS server.
# showmount -e 10.128.15.213
The next step is to mount the NFS share from the server to the client. To do this, we first need to create a mount directory. In this case, we will create a directory called nfs_backup.
# mkdir nfs_backup
Thereafter, we will mount the NFS share to the mount directory that we have just created in the root home directory
# mount -t nfs 10.128.15.213:/home/tecmint/my_nfsshare ~/nfs_backup
To persist the NFS share, edit the /etc/fstab file.
# vim /etc/fstab
Then add the following entry.
10.128.15.213:/home/tecmint/my_nfsshare /root/nfs_backup nfs defaults 0 0
Save and exit the configuration file.
Testing NFS Setup
The last step is to verify if the NFS setup is working as expected. We will create a few files on the server and verify their availability on the NFS client side.
On the server side, we will create the files in the NFS share directory.
$ sudo touch my_nfsshare/file{1..4}.txt
To verify that the files have been created, we will execute the ls command:
$ ls -l my_nfsshare/
Back to the client side, verify that the files are available in the mount directory without any service refresh or restart of any services as seen in the following output.
$ ls -l nfs_backup/
Removing NFS Mount
If you no longer need the mounted directory on your system, you can unmount them from the client side using the following umount command:
$ umount ~/nfs_backup
NFS Share Commands
Some more important commands for NFS.
- showmount -e – Shows the available shares on your local machine
- showmount -e ip-address – Lists the available shares at the remote server
- showmount -d – Lists all the sub-directories
- exportfs -v – Displays a list of shared files and options on a server
- exportfs -a – Exports all shares listed in /etc/exports, or given name
- exportfs -u – Unexports all shares listed in /etc/exports, or given name
- exportfs -r – Refresh the server’s list after modifying /etc/exports
Conclusion
This wraps up our guide on how to install the NFS server and client on RedHat-based distributions. We have installed the NFS services on the server, created an NFS share directory, and finally mounted the share directory on the client. Lastly, we verified the NFS setup by accessing the file created on the server from the client side.
Found some missing files in the fedora 33 servers /etc the exports file has to be created, also I cruised thru usr/systemd.conf files, some needed a user added as only root can access some of them. Redhat has removed the “rsh” login while Debian has it, with rsh I can connect eth0 to the dell idrac port, type rsh 192.168.0.? And can log in gives tons of cli commands that the web-based idrac doesn’t seem to have, not sure there’s a difference in formats.
Debian for some reason does not include netstat if config and FTP? Also, fedora7 and 8 had rwhod, whois, telnet, FTP, apache web server. The fefora33 server I’m using lacks these old tools and I’m not sure if I’m getting past the firewall other than pinging my idrac on my dell server!
Unfortunately, I have to go online to ad nfs files to make it work in the fedora33 server. I noticed you used init.d but redhat and its subsidiary ones all use the system.d in their configuration, so init.d might not work on a redhat/fedora/centos box!
I have one doubt, why he did not add some services to the firewall without adding? it is possible.
below are some of the services – nfs-server, rpcbind mounted,
can some confirm
Useful content.
I had difficulty getting the server to reboot, the solution for me was to change the /etc/fstab on the nfsclient to the following:
nfsserver:/var/nfsshare/work /opt/work nfs defaults,_netdev,x-systemd.after=nfs-server.service 0 0
Awesome article…
Absolutely brilliant article…
Did you miss create sub directory
/mnt/nfsshare
to map nfs file system on?This is one of the easiest installation. But this is not as simple as this is mentioned in the blog. Here the consideration is taken when the Firewall is stopped.
Which specific ports to be allowed for NFS server to work properly. Only allowing NFS service is firewall is not working. It keeps on giving error of portmapper and something like that.
I am doing it on CentOS 7, NFS server does not work independently so allowing NFS port is not making any difference
Thank you for the article. I think you need to add the line “run exportfs -a command” after creating a entry in /etc/exports file without running that command shares wont be accessible from clients.
Hi,
I have mounted directory from windows server to Linux server. When I run
mount -a
on Linux server, it gives error:I want to know the root cause for this. I know this can be solved by unmounting that directory and mounting again but what is the root cause?
This information is spread out in so many places across the web, so thank you for this concise write-up.
I got this up and running except I’m unable to permanently mount the export directory so that my client automatically loads it. I did something bad to fstab and my computer (R Pi) would not boot. Had no choice but to reformat it.
Got it to work fine by manually mounting, so I know I’m close…thanks for any pointers!
First, I thank you for your lessons, they’re one of the best.
In preparation for the LFCS exam, knowing that some commands are deprecated and some files changed, for example:
These are not available in latest Centos 7.
Does one has a choice of the version of Linux machine to use in the exam? As I am new to Linux, I am only conversant with latest commands.
Regards,
Chiadi
@Leonard,
Thanks for informing us, but I don’t think there is a choice, because CentOS 7 is one of the new standards for this LFCS exam.
Thanks for your response.
Excellent summary of the topic. Thank you!
clnt_create: RPC: Program not registered (how to solve)
Thank you so much for sharing article and easy to understand and helpful.
Hi Tarunika,
Thanks for such a nice article on NFS server and client. It will help the readers to resolve NFS related issue.
Best Regards
Zafar
Hi ,
Thank you for sharing this article, very helpful
Hi ,
Thank you for sharing this article, very helpful ,
when we are mounting with rw permissions in client side, can we restrict root/normal user to delete this nfs shared folders from client side.
My Export config in server side
Mounting with below command
please advise.
Thanks.
@Sivakrishna,
Yes you can restrict any folder using chattr (change file attributes on Linux file system) command as explained in this article – https://www.tecmint.com/chattr-command-examples/
mount -v -t nfs 192.168.10.11:/home/camila /root/temp
mount.nfs: timeout set for Mon Jan 8 23:05:38 2018
mount.nfs: trying text-based options ‘vers=4.2,addr= 192.168.10.11,clientaddr= 192.168.10.12’
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options ‘vers=4.1,addr= 192.168.10.11,clientaddr= 192.168.10.12’
mount.nfs: mount(2): Input/output error
mount.nfs: mount system call failed
journalctl | tail -1
Jan 08 23:06:30 kali kernel: NFS: nfs4_discover_server_trunking unhandled error -22. Exiting with error EIO
Useful information.. thank you very much
@Shraddha,
Thanks for finding this article so useful, if any questions do ask us..:)
Hi its very fine with your site, but, you missed one command after,
On CentOS 6.x i got error “unable to register (RQUOTAPROG, RQUOTAVERS, udp)”, “Connection refused”.
I had to start & enable rpcbind service:
service rpcbind start;chkconfig rpcbind on
I am trying to execute this on Centos 7 and can’t find nfs-utils-lib using yum. Any advice?
@Bridgette,
Try nfs-utils.
That works! Thank you.
Really a very help instructive article.
I have mounted a directory of one system on another.
Now I am not able to create file/folder from that client system into this mount point.
How can I create file or folder from that client system into the mount point i.e. into the shared directory of the server?
@Rupesh,
Please check that you’ve given rw permission on the NFS server mount point..
Thanks Ravi for the quick suggestion.
rw permission was already given.
However the root_squash applied on the server shared directory was denying the permission to create files in it from the client machine.
Using no_root_squash solved the issue.
when I use showmount command there is a port map failure in client side. How to rectify this. Please share the answers
@Gayathri,
Make sure portmap that the portmap service is running..
This article shows to share with 1 nfs client, in case I have 1000+ clients to share the same directory ? Please help
@Mustaque,
Same procedure, manually mount the nfs share on client machines, or if you have good scripting skills you can automate it..
But Really so usefull and clearly explained by you people ,thanks for this posting and tecmint
Hi Ravi,
Will please add firewall rules to respect to nfs in this will be more usefull
Very useful explanation was awesome
Very clearly explained..
Thank you so much..for your Help
commands must be running on the server if you are building a network file system?
Which of the Commands must be running on the server if you are building a network file system?
@Sriram,
Please follow the instructions carefully, as we’ve already mentioned which commands should be run on Server and Client..
Hi this really worked but one thing is missing we need to start the nfs service on both the node with the below command.
Once this status is OK then we can see the mount points in nfs client..
@Saeed,
Thanks for sharing the tip, we will include in the write up, so that others will not face any issues..
i got acess denied by the server while mount …..
How to resolve this ..?
Please restart the rpcbind/portmap, nfs service in server side and check firewall (stop firewall and try then add respective ports in firewall, make firewall on )
very very very clearly explained..
thank you so much..keep up the good work
@Anupriya,
Thanks for finding it most useful, and also thanks for liking our work.
can u plese explain about the no_root_squash and root_quash with some real time example… im little bit confused with it
By default, NFS shares change the root user to the nfsnobody user, an unprivileged user account. In this way, all root-created files are owned by nfsnobody, which prevents uploading of programs with the setuid bit set.
If no_root_squash is used, remote root users are able to change any file on the shared file system and leave trojaned applications for other users to inadvertently execute.
Hello,
Would this work to mount an entire raid from one Red Hat Server to an Ubuntu server? How can I mount the entire raid volume? Thanks!
what should be the entry of fstab for mounting the nfs share directory using user name and password
@Sanjeev,
To mount nfs share with username and password in Linux, you should add following entry in your fstab file.
And don’t forget to change above values as per your requirements.
hi
i want to know about mount command
@Bin,
To know more about mount command, I suggest you to read man pages by doing:
I’m learning Linux.
I have created users in /home/export directory server side, exported and shared to particular ip address..
On client side I have mounted that directory to home directory and I got error i.e,
No such file or directory on /etc/fstab
1. is this possible to share the user’s in NFS?
2. if s please let me know solution for above process?
@Irfan,
You can’t mount to /home directory, you can only mount all external drives under /mnt directory, try mounting NFS share directory to /mnt and then see..
I am using Linux Mint 17.3
When I enter the command:
—————————————————————————–
$ sudo apt-get install nfs-utils nfs-utils-lib
—————————————————————————–
I get:
—————————————————————————–
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package nfs-utils
E: Unable to locate package nfs-utils-lib
—————————————————————————–
@Keith,
Sorry for trouble, it seems in Linux Mint 17.3, you should follow these commands to install NFS.
We will update this article with new instructions to support newer version of Ubuntu and Mint distributions.
Thanks a lot Tarunika precise and concise explanation, very much appreciated
is it possible to use CentOS-6 as NFS server and CentOS-7 as NFS client. I tried like this. But i got the following error.
mount.nfs: access denied by server while mounting 192.168.1.73:/mnt/nfs_1
at the same time when i mounting NFS shares in a CentOS-6 version client it is fine and it is successfully mounted. But getting problem while mounting in CentOS-7 client.
@Nagababu,
It seems you’ve to play with iptables, have you opened port 2049 on firewall? or else stop the iptables and give a try..
Got it….Both nfs server(centos 6) and client(centos 7) i’m using are in same VMWare. But while using one of my servers having centos 7 as nfs client., it was mounted successfully. Seems there is something to set in network in vmware.
Thanks.
How can i specify size to the nfs shared directory. After mounting nfs shared directory in client system and using df -h command., it is displaying entire nfs server filesystem size as nfs shared directory. So how to specify some particular size to the nfs shared directory in nfs server. Is it possible.
@Nagabab
Could you please share the screenshot or output of the df -h command so that we can better understand your problem and also it seems that you’ve added the entire filesystem in /etc/exports file, better just place the shared directory name.
i just added the shared directory in /etc/exports in nfs server. here is the output of df -h -F nfs in client system
nfs server : 192.168.1.73
nfs client : 192.168.1.36
[root@localhost nfs_mount]# df -h -F nfs
Filesystem Size Used Avail Use% Mounted on
192.168.1.73:/mnt/nfs_1 28G 7.8G 19G 31% /home/temp/nfs_mount
Here is the /etc/exports file contents in nfs server
/mnt/nfs_1 192.168.1.36(rw,sync,no_root_squash)
Nfs server is a centos in vmware. It has 30 GB of total size.
@Nagababu,
wh
Thanks for sharing the NFS configuration, it seems that nfs share under /mnt filesystem and you’re looking for directory size, so here instead using df command, try using du command which shows disk usage of directory..
Hi Tarunika,
Thanks for the step by step writeup.
I have a issue after mounting shared nfs directory on the client.
The owner and group of /mnt/nfsshare changes to 1002
drwxrwxr-x 103 1002 1002 4.0K Jan 19 12:08 nfsshare
Tried changing it as root but operation is not permitted. What thing am I missing?
@Shantanu,
Are you trying to change the permission of a mounted nfs share on client machine using root user? if yes, that’s not possible, because the device is just mounted on the client machine with given rights in export file, so only the creator of share directory will have access to modify the permission..
Sap,
The uid & gid seen on the client would normally be the same as seen from the server. The difference might be that the user accounts on each of the hosts doesn’t match one anothers’ uid/gid.
For nfs, it’s important for the user accounts sharing their data via nfs to be identically configured.
These yum commands have worked for me for several months. Sometime between when I last ran them in December and when I ran them yesterday, they suddenly broke. Now when I use:
yum -y install nfs-utils-lib
I get an error message saying: No package nfs-utils-lib is available.
Any idea why this is happening or how to fix it?
@Taylor,
I’ve just tried to install nfs-utils-lib package using yum command on my CentOS 6 and 7 servers and the package is available to install. May I know on which CentOS based distribution you’re trying to install? could you post the whole output of yum command?
Great Tutorial!
But my question is, how can i give a specific user access to a specific NFS folder?
@David,
NFS shares aren’t user specific.
we are looking for quantum tape drive mount in RHEL6.5 anyone help us
@Hanmaiah,
Sorry no idea about quantum tape drive, mount I think you can use mount command to mount the tape drive with the help of its device name, which you can get by fdisk or lsblk command.
Hi, great post. This helped me a lot. I’ll appreciate if you would explain what is the best file-system choice when shared resource is mounting on client in their different contexts. I’ll appreciate that. Thanks in advance!!!
Hi all,
Can we have a tutorial on “Mounting NFS Share using Autofs”???
Even we can use ‘_netdev’ instead of ‘defaults’ in fstab configuration, to avoid Boot Time Delay.
Example:
192.168.0.100:/nfsshare /mnt nfs defaults 0 0
May replaced with
192.168.0.100:/nfsshare /mnt nfs _netdev 0 0
Regards,
Shouvik
@Shouvik,
Here are the tutorials you looking for that show how to mount NFS/Samba Network shares under Linux using autofs..
https://www.tecmint.com/configure-nfs-server/
https://www.tecmint.com/mount-filesystem-in-linux
Hi, thanks for the wiki, only keep in mind that in the last version of Ubuntu, nfs-utils and nfs-utils-lib are no longer available.
that was useful!
Thanks.
There is a typo in the /etc/fstab configuration section
192.168.0.100:/nfsshare /mnt nfs defauls 0 0
should be
192.168.0.100:/nfsshare /mnt nfs defaults 0 0
@Michale,
Thanks for pointing out that typo, corrected in the write up….
Difference Between NFS and Samba???
This website Really very help full to me to configure the NFS server & Client. Thanks
Hi, i am configured squid proxy (Transparent proxy)on centos server ,but never show https request log in /var/log/squid
OK, needing to do a silly RSYNC across two Centos 6.5 servers has seemed to be more problematic with NFS than it used to be with Ubuntu. Security over convenience, I suppose.
Server:
#sudo yum install nfs* -y
#sudo nano /etc/exports
add your export, in my case:
/mnt/data 192.168.2.0/24(rw,sync,no_root_squash,no_subtree_check)
#sudo nano /etc/sysconfig/iptables
(add the following below the “*filter*, make sure to adjust IP)
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 2049 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 32803 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 32769 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p tcp –dport 662 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state –state NEW -p udp –dport 662 -j ACCEPT
#sudo service iptables restart
#sudo service nfs restart
Centos client:
#sudo yum install nfs* -y
make sure you can ping the shares
On Fedora 19, had to use the firewall GUI to set these to “public”, then everything worked:
mountd
nfs
rpc-bind
Should have said “set these to ‘public’ on the server”.
If you want NFS service to start automatically as well as rpc bind this is what you need to do.
Below is equivelent to “chkconfig servicename on”
sudo systemctl enable nfs-server
sudo systemctl enable rpcbind
This is what you need to do if you are getting access denied
1 – Update /etc/exports as this (remove IP add *)
/nfsshare *(rw,fsid=0,insecure,no_subtree_check,async)
2 – Set this values in configuration file /etc/sysconfig/nfs
LOCKD_TCPPORT=32803 – This is uncommented so just add the value
LOCKD_UDPPORT=32769 – This is uncommented so just add the value
MOUNTD_PORT=892 – You need to add this line anwyhere
RQUOTAD_PORT=875 – You need to add this line anwyhere
STATD_PORT=662 – You need to add this line anwyhere
STATD_OUTGOING_PORT=2020 – You need to add this line anwyhere
Wonderful tutorial. Really learned a lot!
Thanks team its done in Ist attempt.
Great !!!
Nice tutorial….This doc cleared all of my queries. good to see these tutorials from tecmint.
Quick and easy one.. Superb Tarunika :)
lovely, tutorial , after reading your tutorial ,I desire to make friendship with you .
When wanting to mount the shared folder to the client, it hangs and does nothing, it could be?
hi ,
in the above /etc/fstab screenshot mounting point is not mentioned correctly please check it .. :)
Hey :)
Really great tutorial ! Thanks a lot !
Everything looks fine, on the server, the services are launched OK, but I have a “permission denied” on the client side, even if the showmount -e gives the good informations…
Would you have a suggestion ?
Thx in advance ;)
check shared(exported) directory. there may be ro permission. change it rw. you will not get that error.
Thank you.
How to share the new mount point by NFS without restarting service at server side ?
(Asked in interview)
i think by using exportfs -a command in server side
there is something wrong with me
when i write the command to mount the server
#mount -t nfs 192.168.122.52:/mnt/nfsshare /mnt/nfsshare
this error appear
mount.nfs: access denied by server while mounting 192.168.122.52:/mnt/nfsshare
Hello Siva,
I have one external HDD, i format it in ntfs filesystem by installing fuse-ntfs-3g*.rpm package and fuse module. I have mount it in Cento OS by
#mount -t ntfs-3g -o force.
But the when i want to configure nfs like this.. [say mount_point : /mnt ]in Cento OS
#vim /etc/exports
/mnt *(rw,sync,no_root_squash)
:wq
But when I am trying to mount from remote machine.
[in remote machine]
#mount -t nfs :/mnt
Then one error message has come like this…
#mount :/mnt failed reason given by server:permission denied.
Please give me one solutions..
Faruk
Clear instructions! Very helpful! God Bless you!
Really helpful guide.Now remove confusion about nfs server and client.
Hello Siva,
Please check if you are able to telnet the port 111 from the client to host, if no then check the rcbind service on host.
Regards
Haffizuddin S
hai,
recently i try to mount my files using nfs .. i have 2 pcs which are packed with ubuntu 13.10.. from 1 system i used as sever (192.168.1.69) and another one as 192.168.1.121(client)
i followed the procedure as u said above to install nfs on server
for client i installed nfs-common package..
my problem was i configure properly at the server side .. but the client side when i try to execute this line $showmount -e 192.168.1.69
i got the following error report
“rpc mount export: RPC: Timed out “”
i’m not able to understand the problem from where it is.. either from server or from client side..
tell me is there any other way to find out where the problem comes from??
help me out how to resolve this issue!!!
thanks in advance !!
first check the communication to the two systems
server : required packets nfs -tools and nfs-utilities
vi /etc/exports
shareparth *(rw)
:wq!
service nfs start
service rpcbind start
service nfslock start
exportfs -a
showmount -e client
client :
showmount -e server
mount -t nfs server:/path mountpoint
vi /etc/fstab -permanent mount
If you are using NFS-version4 with ext4 file system then you can direct mount
in /net
For Example:-
[root@linux ~]# cd /net/192.168.11.100
[root@linux 192.168.11.100]# ls
nfsshare <———– your shared directory
[root@linux 192.168.11.100]# pwd
/net/192.168.11.100
[root@linux 192.168.11.100]#
Here you can find you shared directory
For mounting…
mount -t nfs 192.168.0.100:/nfsshare /mnt/nfsshare
OR
mount -t nfs 192.168.0.101:/nfsshare /mnt/nfsshare
???
Which one is correct??
sorry..i got it
very help to me this tutorial.
thanks somuch
You misspelt “defaults” in the fstab section. It should read
192.168.0.100:/nfsshare /mnt nfs defaults 0 0
Hi,
Really great post i was struggling with NFS on RHEL6 from last three days, and only two tutorials helped me out one is this and other is
Configure NFS on RHEL 6
From your tutorials i was able to setup NFS. My system have IPTABLES & SELinux configured which blocked NFS client connection but with the help of second tutorial i was able to fix that.
Hello
Running in my Pc Fedora 19
It’s already installed:
#yum install nfs-utils nfs-utils-lib
#yum install portmap
I have a problem, when i try to start the service give me:
[root@Pc4 init.d]# /etc/init.d/nfs start
bash: /etc/init.d/nfs: No such file or directory
What happen?
very nice step by step explain
thank you
I am running Ubuntu 10.04 LTS. I have typed apt-get install nfs-utils nfs-utils-lib but it gave error: E: Couldn’t find package nfs-utils
How to fix this?
You should try installing.
thanks!
sometimes nfs service not starts in that case you have to start nfslock and rpcbind services i come to know about this after reading this tutorial
http://www.techcryption.com/NetworkFileSystemTut
tomorrow; like your work admin
sory for bad english :)
Hi,
If any one happened to come across the error
====
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
====
make sure that /etc/init.d/rpcbind is running
if not please start the service and then restart the portmap
Is your portmap and rpcbind is running? Please check them
service rpcbind restart
service portmap restart
service nfs restart
No way I ever run something as insecure as NFS v3.
While it’s easy to create an /etc/exports file (linear for N machines), it is a real annoyance to create /etc/fstab entries and mount points (quadratic for N machines). Why doesn’t anyone ever talk about using autofs for this, so that stuff just gets automounted in /net/machine/whatever-got-exported ?
Good article, but I don’t understand why nearly all articles overlook this.
Great tutorial, realy helps!