{"id":17,"date":"2011-12-10T04:17:19","date_gmt":"2011-12-10T04:17:19","guid":{"rendered":"http:\/\/droidtutorials.net\/?p=17"},"modified":"2011-12-10T04:17:19","modified_gmt":"2011-12-10T04:17:19","slug":"ubuntu-nfs-quick-and-simple","status":"publish","type":"post","link":"http:\/\/www.zacherickson.com\/blog\/ubuntu-nfs-quick-and-simple\/","title":{"rendered":"Ubuntu &#8211; NFS quick and simple"},"content":{"rendered":"<p>I found a few tutorials which went into depth on various aspects of NFS (Linux file sharing) and finally used this method. There is no security and I currently have clients set to manually mount shared drives after reboot. I may work on that later.<\/p>\n<p><strong>On the Server:<\/strong><br \/>\ninstall NFS files from a terminal:<br \/>\n<em>sudo apt-get install nfs-kernel-server nfs-common portmap<\/em><\/p>\n<p>You can create a folder to house your shares or use an existing one.<br \/>\ncreate an export file which will define what folders will be shared using your favorite editor edit \/etc\/exports (using sudo). I have added a few lines like these:<\/p>\n<p>\/exports 192.168.1.1\/24(rw,no_root_squash,async)<br \/>\n\/exports\/anotherfolder 192.168.1.1\/24(rw,no_root_squash,no_subtree_check,async)<\/p>\n<p>The first part (\/exports) is the location of the folder can be anything.<\/p>\n<p>The second part (192.168.1.1\/24) is the ip addresses allowed to access this can be a single address or a subnet like this example.<\/p>\n<p>The third part ((rw,no_root_squash,no_subtree_check,async)) defines the permissions. \u00a0These are read\/write.<\/p>\n<p>Last you have to edit <em>\/etc\/default\/nfs-common<\/em> change the following lines to reflect these settings:<\/p>\n<p><em># Do you want to start the idmapd daemon? It is only needed for NFSv4.<\/em><br \/>\n<em>NEED_IDMAPD=yes<\/em><br \/>\n<em># Do you want to start the gssd daemon? It is required for Kerberos mounts.<\/em><br \/>\n<em>NEED_GSSD=no<\/em><\/p>\n<p>After editing this file you have to restart the nfs using:<\/p>\n<p><em>sudo exportfs -a<\/em><\/p>\n<p><strong>On the Client:<\/strong><\/p>\n<p>Install the\u00a0necessary\u00a0files:<\/p>\n<p><em>sudo apt-get install nfs-common portmap<\/em><\/p>\n<p>On the client you have to edit <em>\/etc\/default\/nfs-common<\/em> to match the server:<\/p>\n<p><em># Do you want to start the idmapd daemon? It is only needed for NFSv4.<\/em><br \/>\n<em>NEED_IDMAPD=yes<\/em><br \/>\n<em># Do you want to start the gssd daemon? It is required for Kerberos mounts.<\/em><br \/>\n<em>NEED_GSSD=no<\/em><\/p>\n<p>Next create a folder where you want to have the shared file exist:<\/p>\n<p><em>mkdir ~\/sharedfiles<\/em><\/p>\n<p>now simply mount the shared drive to the directory (let&#8217;s assume that the server ip is 192.168.1.10):<\/p>\n<p><em>sudo mount 192.168.1.10:\/export\/anotherfolder ~\/sharedfiles<\/em><\/p>\n<p>That should do it.<\/p>\n<p>Next I&#8217;ll try and figure out how to remount these files after reboot on the client. \u00a0You will have to re-run the mount command above if you reboot your client.<\/p>\n<p>Other Links:<\/p>\n<p><a href=\"http:\/\/www.ubuntugeek.com\/nfs-server-and-client-configuration-in-ubuntu.html\">http:\/\/www.ubuntugeek.com\/nfs-server-and-client-configuration-in-ubuntu.html<\/a><\/p>\n<p><a href=\"https:\/\/help.ubuntu.com\/community\/NFSv4Howto\">https:\/\/help.ubuntu.com\/community\/NFSv4Howto<\/a><\/p>\n<p>http:\/\/www.ubuntugeek.com\/mount-network-file-systems-nfssamba-in-ubuntu.html<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I found a few tutorials which went into depth on various aspects of NFS (Linux file sharing) and finally used this method. There is no security and I currently have clients set to manually mount shared drives after reboot. I &hellip; <a href=\"http:\/\/www.zacherickson.com\/blog\/ubuntu-nfs-quick-and-simple\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-ubuntu-2"],"_links":{"self":[{"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":0,"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zacherickson.com\/blog\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}