{"id":2035,"date":"2016-10-09T10:23:33","date_gmt":"2016-10-09T18:23:33","guid":{"rendered":"http:\/\/systemsolver.com\/StatlerBlog\/?p=2035"},"modified":"2016-10-09T10:23:33","modified_gmt":"2016-10-09T18:23:33","slug":"linux-nfs-network-file-server","status":"publish","type":"post","link":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/2016\/10\/09\/linux-nfs-network-file-server\/","title":{"rendered":"Linux NFS network file server"},"content":{"rendered":"<p>Check out this guy&#8217;s mount\/umount script for network availability:<br \/>\n<a href=\"https:\/\/www.fanninger.at\/thomas\/blog\/mount-a-nfs-share-with-systemd\">https:\/\/www.fanninger.at\/thomas\/blog\/mount-a-nfs-share-with-systemd<\/a><\/p>\n<p>Also check out RedHat regarding autofs<br \/>\n<a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/3\/html\/System_Administration_Guide\/s1-nfs-mount.html\">https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/3\/html\/System_Administration_Guide\/s1-nfs-mount.html<\/a><\/p>\n<p>Mostly from: <a href=\"https:\/\/ubuntuforums.org\/showthread.php?t=1272450\">https:\/\/ubuntuforums.org\/showthread.php?t=1272450<\/a><\/p>\n<p style=\"padding-left: 30px;\">Install<\/p>\n<p style=\"padding-left: 60px;\"><code>sudo apt install nfs-kernel-server<\/code><\/p>\n<p style=\"padding-left: 30px;\">Setup folders to serve,<\/p>\n<p style=\"padding-left: 60px;\"><code>gksudo gedit \/etc\/exports<\/code><\/p>\n<p style=\"padding-left: 60px;\">#{path to share} {network number}\/{netmask}{access(rw) or (ro)}<\/p>\n<p style=\"padding-left: 60px;\"># to make &#8220;\/home&#8221; available for everyone in the network<\/p>\n<p style=\"padding-left: 60px;\"><code>\/home 192.168.0.0\/255.255.255.0(rw)<\/code><\/p>\n<p style=\"padding-left: 60px;\"># save the file and restart the NFS server<\/p>\n<p style=\"padding-left: 60px;\"><code>sudo \/etc\/init.d\/nfs-kernel-server restart<\/code><\/p>\n<p style=\"padding-left: 60px;\">or with systemd<\/p>\n<p style=\"padding-left: 60px;\"><code>sudo systemctl restart nfs<\/code><\/p>\n<p style=\"padding-left: 30px;\">In my case to share folders with NFS<\/p>\n<p style=\"padding-left: 60px;\"><code>gksudo gedit \/etc\/exports<\/code><\/p>\n<p style=\"padding-left: 60px;\">\/media\/Closed 10.141.229.0\/255.255.255.0(rw)<\/p>\n<p style=\"padding-left: 60px;\">\/media\/Office-Files 10.141.229.0\/255.255.255.0(rw)<\/p>\n<p style=\"padding-left: 30px;\">Setup computer to mount the files<\/p>\n<p style=\"padding-left: 60px;\"># sudo mount {server ip}:{share name} {path you want it mounted to}<\/p>\n<p style=\"padding-left: 60px;\"><code>sudo mount 10.141.229.10:\/media\/Closed \/mnt\/Closed<\/code><\/p>\n<p style=\"padding-left: 60px;\"># for \/etc\/fstab ??? from https:\/\/bbs.archlinux.org\/viewtopic.php?id=158200<\/p>\n<p style=\"padding-left: 60px;\">This worked:<\/p>\n<p style=\"padding-left: 60px;\">10.141.229.10:\/media\/Closed \/mnt\/closed nfs4 noauto,users,x-systemd.device-timeout=7s,timeo=14,intr 0 0<\/p>\n<p style=\"padding-left: 60px;\">10.141.229.10:\/media\/Office-Files \/mnt\/office_files nfs4 noauto,users,x-systemd.device-timeout=7s,timeo=14,intr 0 0<\/p>\n<p style=\"padding-left: 60px;\">after editing fstab use the following to reload the mount devices<\/p>\n<p style=\"padding-left: 60px;\">sudo systemctl daemon-reload<br \/>\nsudo systemctl restart remote-fs.target<\/p>\n<p style=\"padding-left: 60px;\">the following didn&#8217;t work:<\/p>\n<p style=\"padding-left: 60px;\"><code>10.141.229.10:\/Closed \/mnt\/Closed\u00a0 \/mnt\/Closed nfs4 noauto,users,x-systemd.device-timeout=7s,rsize=8192,wsize=8192,timeo=14,intr 0 0<\/code><\/p>\n<p style=\"padding-left: 60px;\">or<\/p>\n<p style=\"padding-left: 60px;\">10.141.229.10:<code>\/media<\/code>\/Closed \/mnt\/Closed nfs4 username=administrator,password=pass 0 0<\/p>\n<p style=\"padding-left: 60px;\">or<\/p>\n<p style=\"padding-left: 60px;\"><code> 10.141.229.10:\/media\/Closed \/mnt\/Closed nfs4\u00a0 username=xxxxx,password=xxxx,noauto,users,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0<\/code><\/p>\n<p style=\"padding-left: 60px;\">or from <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-an-nfs-mount-on-ubuntu-16-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-an-nfs-mount-on-ubuntu-16-04<\/a><\/p>\n<p style=\"padding-left: 60px;\"><code>auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check out this guy&#8217;s mount\/umount script for network availability: https:\/\/www.fanninger.at\/thomas\/blog\/mount-a-nfs-share-with-systemd Also check out RedHat regarding autofs https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/3\/html\/System_Administration_Guide\/s1-nfs-mount.html Mostly from: https:\/\/ubuntuforums.org\/showthread.php?t=1272450 Install sudo apt install nfs-kernel-server Setup folders to serve, gksudo gedit \/etc\/exports #{path to share} {network number}\/{netmask}{access(rw) or (ro)} # to make &#8220;\/home&#8221; available for everyone in the network \/home 192.168.0.0\/255.255.255.0(rw) # save the file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2035","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/2035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/comments?post=2035"}],"version-history":[{"count":0,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/2035\/revisions"}],"wp:attachment":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/media?parent=2035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/categories?post=2035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/tags?post=2035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}