{"id":3490,"date":"2012-07-04T23:41:05","date_gmt":"2012-07-04T15:41:05","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3490"},"modified":"2023-04-28T09:49:02","modified_gmt":"2023-04-28T09:49:02","slug":"how-to-configure-nfs-client-on-linux","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-nfs-client-on-linux\/","title":{"rendered":"How to Configure NFS Client on Linux"},"content":{"rendered":"<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/07\/nfs-server-150x150.jpg\" alt=\"nfs\" title=\"nfs\" width=\"150\" height=\"150\" class=\"alignleft size-thumbnail wp-image-3497 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/07\/nfs-server-150x150.jpg 150w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/07\/nfs-server-100x100.jpg 100w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/07\/nfs-server.jpg 225w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/>Network File System or NFS, is a server-client protocol for sharing files between computers on network. NFS server will enables it&#8217;s client to mount a file system on a remote server as if it were local to your own system. In this example, i will configure a nfs client on linux. <\/p>\n<p><strong>Prerequisites :<\/strong><br \/>\n<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-linux-nfs-server-on-centos-6-2\/\" rel=\"nofollow\">How to Configure Linux NFS Server on CentOS 6.2<\/a><\/p>\n<p><strong>NFS Server<\/strong> = centos62.ehowstuff.local<br \/>\n<strong>NFS Server Ip Address<\/strong> = 192.168.1.44<\/p>\n<p>1. Install NFS client packages : <\/p>\n<pre>\n[root@NFS-Client ~]# yum install nfs-utils -y\n<\/pre>\n<p>Examples :<\/p>\n<pre>\n[root@NFS-Client ~]# yum install nfs-utils -y\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * Webmin: download.webmin.com\n * base: mirror.oscc.org.my\n * epel: mirrors.ispros.com.bd\n * extras: mirror.oscc.org.my\n * rpmforge: mirror.oscc.org.my\n * updates: mirror.oscc.org.my\nCentOS5.8-Repository                                                         | 1.3 kB     00:00\nrpmforge\/primary_db                                                          | 7.1 MB     01:07\nupdates                                                                      | 1.9 kB     00:00\nupdates\/primary_db                                                           | 503 kB     00:04\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package nfs-utils.i386 1:1.0.9-60.el5 set to be updated\n--> Processing Dependency: portmap >= 4.0 for package: nfs-utils\n--> Processing Dependency: libgssapi.so.2(libgssapi_CITI_2) for package: nfs-utils\n--> Processing Dependency: librpcsecgss.so.2 for package: nfs-utils\n--> Processing Dependency: libevent-1.4.so.2 for package: nfs-utils\n--> Processing Dependency: libgssapi.so.2 for package: nfs-utils\n--> Processing Dependency: nfs-utils-lib for package: nfs-utils\n--> Processing Dependency: libnfsidmap.so.0 for package: nfs-utils\n--> Processing Dependency: libgssapi for package: nfs-utils\n--> Processing Dependency: libevent for package: nfs-utils\n--> Running transaction check\n---> Package libevent.i386 0:1.4.13-1 set to be updated\n---> Package libgssapi.i386 0:0.10-2 set to be updated\n---> Package nfs-utils-lib.i386 0:1.0.8-7.9.el5 set to be updated\n---> Package portmap.i386 0:4.0-65.2.2.1 set to be updated\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                Arch          Version                   Repository                     Size\n====================================================================================================\nInstalling:\n nfs-utils              i386          1:1.0.9-60.el5            CentOS5.8-Repository          401 k\nInstalling for dependencies:\n libevent               i386          1.4.13-1                  base                          112 k\n libgssapi              i386          0.10-2                    base                           22 k\n nfs-utils-lib          i386          1.0.8-7.9.el5             base                           64 k\n portmap                i386          4.0-65.2.2.1              base                           37 k\n\nTransaction Summary\n====================================================================================================\nInstall       5 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 636 k\nDownloading Packages:\n(1\/5): libgssapi-0.10-2.i386.rpm                                             |  22 kB     00:00\n(2\/5): portmap-4.0-65.2.2.1.i386.rpm                                         |  37 kB     00:00\n(3\/5): nfs-utils-lib-1.0.8-7.9.el5.i386.rpm                                  |  64 kB     00:00\n(4\/5): libevent-1.4.13-1.i386.rpm                                            | 112 kB     00:01\n----------------------------------------------------------------------------------------------------\nTotal                                                               287 kB\/s | 636 kB     00:02\nRunning rpm_check_debug\nRunning Transaction Test\nFinished Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing     : libgssapi                                                                    1\/5\n  Installing     : portmap                                                                      2\/5\n  Installing     : libevent                                                                     3\/5\n  Installing     : nfs-utils-lib                                                                4\/5\n  Installing     : nfs-utils                                                                    5\/5\n\nInstalled:\n  nfs-utils.i386 1:1.0.9-60.el5\n\nDependency Installed:\n  libevent.i386 0:1.4.13-1        libgssapi.i386 0:0.10-2     nfs-utils-lib.i386 0:1.0.8-7.9.el5\n  portmap.i386 0:4.0-65.2.2.1\n\nComplete!\n<\/pre>\n<p>2. Start NFS services :<\/p>\n<pre>\n[root@NFS-Client ~]# service portmap start\nStarting portmap:                                          [  OK  ]\n<\/pre>\n<pre>\n[root@NFS-Client ~]# \/etc\/rc.d\/init.d\/rpcidmapd start\nStarting RPC idmapd:                                       [  OK  ]\n<\/pre>\n<pre>\n[root@NFS-Client ~]# \/etc\/rc.d\/init.d\/nfslock start\nStarting NFS statd:                                        [  OK  ]\n<\/pre>\n<pre>\n[root@NFS-Client ~]# \/etc\/rc.d\/init.d\/netfs start\nMounting other filesystems:                                [  OK  ]\n<\/pre>\n<p>3. Make NFS services autostart at boot :<\/p>\n<pre>\n[root@NFS-Client ~]# chkconfig portmap on\n[root@NFS-Client ~]# chkconfig rpcidmapd on\n[root@NFS-Client ~]# chkconfig nfslock on\n[root@NFS-Client ~]# chkconfig netfs on\n<\/pre>\n<p>4. create a mount point, by making a directory. Crete \/shared folder as a mount point :<\/p>\n<pre>\n[root@NFS-Client ~]# mkdir \/shared\n<\/pre>\n<p>5. Mount this \/sharedfolder from NFS server on \/shared mount point :<\/p>\n<pre>\n[root@NFS-Client ~]# mount -t nfs centos62.ehowstuff.local:\/sharedfolder \/shared\n<\/pre>\n<pre>\n[root@NFS-Client ~]# df\nFilesystem           1K-blocks      Used Available Use% Mounted on\n\/dev\/sda3             11064148   1639860   8853180  16% \/\n\/dev\/sda1               101086     11653     84214  13% \/boot\ntmpfs                   517336         0    517336   0% \/dev\/shm\n\/dev\/hdc               3831642   3831642         0 100% \/mnt\ncentos62.ehowstuff.local:\/sharedfolder\n                      12941696   4879104   7405184  40% \/shared\n<\/pre>\n<p>6. Open \/etc\/fstab file. Make entry for nfs shared directory and define \/shared to mount point :<\/p>\n<pre>\n[root@NFS-Client ~]# vi \/etc\/fstab\n<\/pre>\n<pre>\nLABEL=\/                 \/                       ext3    defaults        1 1\nLABEL=\/boot             \/boot                   ext3    defaults        1 2\ntmpfs                   \/dev\/shm                tmpfs   defaults        0 0\ndevpts                  \/dev\/pts                devpts  gid=5,mode=620  0 0\nsysfs                   \/sys                    sysfs   defaults        0 0\nproc                    \/proc                   proc    defaults        0 0\nLABEL=SWAP-sda2         swap                    swap    defaults        0 0\ncentos62.ehowstuff.local:\/sharedfolder \/shared  nfs     defaults        0 0\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Network File System or NFS, is a server-client protocol for sharing files between computers on network. NFS server will enables it&#8217;s client to mount a file system on a remote&#8230;<\/p>\n","protected":false},"author":6,"featured_media":3497,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,1013],"tags":[1244,1253,1536,1604],"class_list":["post-3490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-nfs-server","tag-centos","tag-centos-6-2","tag-linux","tag-nfs-server"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=3490"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/3497"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}