![]() |
|
ForumWed Sep 27 12:34:35 2023 UTC Help: GeneralThierry ![]() Wed Sep 27 12:30:24 2023 UTC Help: GeneralPeppe123$$$ ![]() Wed Sep 27 11:30:55 2023 UTC Help: GeneralThierry ![]() Wed Sep 27 07:31:22 2023 UTC Help: GeneralPeppe123$$$ ![]() Tue Sep 26 09:53:25 2023 UTC Help: GeneralPeppe123$$$ ![]() Mon Sep 25 20:38:46 2023 UTC Help: Generalspiky ![]() Mon Sep 25 17:08:09 2023 UTC Help: GeneralThierry ![]() Sat Sep 23 12:00:57 2023 UTC Help: Generalpupuklok ![]() Sat Sep 23 05:38:00 2023 UTC Help: Generaldevlin7 ![]() Thu Sep 21 09:33:52 2023 UTC Help: GeneralThierry ![]() |
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. |