![]() |
|
ForumMon Mar 27 12:18:18 2023 UTC Help: Installationteniie2 ![]() Wed Mar 22 21:50:59 2023 UTC Help: GeneralThierry ![]() Mon Mar 20 22:49:30 2023 UTC Help: GeneralThierry ![]() Sat Mar 18 17:50:53 2023 UTC Help: GeneralDj ![]() Sat Mar 18 16:20:49 2023 UTC Help: Generalvikrang ![]() Sun Mar 12 22:33:33 2023 UTC Help: ProgrammingThierry ![]() Thu Mar 9 17:29:47 2023 UTC Help: ProgrammingFerran ![]() Thu Mar 9 11:49:10 2023 UTC Help: Installationteniie2 ![]() Tue Mar 7 07:15:07 2023 UTC Help: ProgrammingThierry ![]() Mon Mar 6 17:37:51 2023 UTC Documentation: Tips and TricksFerran ![]() |
Mon Oct 2 17:08:03 2017 UTC Setup NFS serverContentsIntroductionNFS means Network File System. It permit you to share files between machines. The only condition is, all machines NEED TO support the NFS service. Fortunately all the distributions support it. Packages to installTo setup a NFS server it's quite simple. You need to install, configure and start it. Let's install all those packages: On the serverget nfs-utils nfs-utils.service On the client(s)get nfs-utils ConfigurationThey are only 2 files to configure: One on the server, one on each client: In our example, it's the /home/tnut/documents folder we want to share: Server configurationWe need to do it in root: su - We create the /etc/exports file like this: cat > /etc/exports << EOF /home/tnut/documents 192.168.1.0/24(rw,no_root_squash,subtree_check,anonuid=99,anongid=99) EOF We want to share the /home/tnut/documents and make it accessible from all other machines having an IP adress between 192.168.1.1 et 192.168.1.254. Configuration on the server is already done, lets move on to the client(s) Client(s) configurationcat >> /etc/fstab << EOF 192.168.1.20:/home/tnut/documents /home/tnut/documents nfs auto,rw,vers=3,_netdev,rsize=8192,wsize=8192 0 0 EOF In this example, the NFS server is at the adress 192.168.1.20 Starting all the servicesWe need to start the service on the server by reboot it or by typing: On the server/etc/rc.d/init.d/rpcbind start /etc/rc.d/init.d/netfs start /etc/rc.d/init.d/nfs-server start On the client(s)/etc/rc.d/init.d/rpcbind start /etc/rc.d/init.d/netfs start If you prefer, you can reboot the server and client(s) Test the serviceAll the services are now configured, they should be no error message when starting them. On the serverThe NFS server is a client as well so it's absolute possible to test the service on the server. On the server, we create a "temporary" folder: In root: mkdir /root/bidon And now the mounting test (still on the server): mount -o vers=3 192.168.1.20:/home/tnut/documents /root/bidon No errors should show up. The mount is done. We can check it by looking it's content: ls -l /root/bidon .... My letters Pictures MP3 ... ... The NFS server setup has been successfully tested. We can unmount the folder now. umount /root/bidon Once umounted, the folder can be removed without any error: rm -d /root/bidon We can now proceed to the client tests On a clientThe test is exactly the same, this time we test the folder which will be automatically mounted when the client is started: mount -o vers=3 192.168.1.20:/home/tnut/documents /home/tnut/documents No errors should show up. The mount is done. We can check it by looking it's content: ls -l /home/tnut/documents .... My letters Pictures MP3 ... ... ConclusionCongratulations, your NFS server is now working fine. |