{"id":680,"date":"2014-08-08T10:40:16","date_gmt":"2014-08-08T13:40:16","guid":{"rendered":"http:\/\/blog.abratel.com.br\/?p=680"},"modified":"2014-08-08T10:42:37","modified_gmt":"2014-08-08T13:42:37","slug":"testing-the-nfs-mount","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=680","title":{"rendered":"Montar storage nfs e compartilhamentos Windows  no Linux"},"content":{"rendered":"<p>Setting Up the NFS Client<br \/>\n________________________________________<br \/>\nStep One\u2014Download the Required Software<br \/>\n________________________________________<br \/>\nStart off by using apt-get to install the nfs programs.<br \/>\nyum install nfs-utils nfs-utils-lib<\/p>\n<p>Step Two\u2014Mount the Directories<br \/>\n________________________________________<br \/>\nOnce the programs have been downloaded to the the client server, create the directory that will contain the NFS shared files<br \/>\nmkdir -p \/mnt\/nfs\/home<\/p>\n<p>Then go ahead and mount it<br \/>\nmount 12.34.56.789:\/home \/mnt\/nfs\/home<\/p>\n<p>You can use the df -h command to check that the directory has been mounted. You will see it last on the list.<br \/>\ndf -h<\/p>\n<p>Filesystem            Size  Used Avail Use% Mounted on<br \/>\n\/dev\/sda               20G  783M   18G   5% \/<br \/>\n12.34.56.789:\/home       20G  785M   18G   5% \/mnt\/nfs\/home<\/p>\n<p>Additionally, use the mount command to see the entire list of mounted file systems.<br \/>\nmount<\/p>\n<p>Your list should look something like this:<br \/>\n\/dev\/sda on \/ type ext4 (rw,errors=remount-ro)<br \/>\nnone on \/proc\/sys\/fs\/binfmt_misc type binfmt_misc (rw)<br \/>\nsunrpc on \/var\/lib\/nfs\/rpc_pipefs type rpc_pipefs (rw)<br \/>\nnfsd on \/proc\/fs\/nfsd type nfsd (rw)<br \/>\n12.34.56.789:\/home on \/mnt\/nfs\/home type nfs (rw,noatime,nolock,bg,nfsvers=2,intr,tcp,actimeo=1800,addr=12.34.56.789)<\/p>\n<p>Once you have successfully mounted your NFS directory, you can test that it works by creating a file on the Client and checking its availability on the Server.<\/p>\n<p>Create a file in the directory to try it out:<br \/>\ntouch \/mnt\/nfs\/home\/example<\/p>\n<p>You should then be able to find the files on the Server in the \/home.<br \/>\nls \/home<\/p>\n<p>You can ensure that the mount is always active by adding the directory to the fstab file on the client. This will ensure that the mount starts up after the server reboots.<br \/>\nvi \/etc\/fstab<\/p>\n<p>12.34.56.789:\/home  \/mnt\/nfs\/home   nfs      auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0<\/p>\n<p>You can learn more about the fstab options by typing in:<br \/>\nman nfs<\/p>\n<p>After any subsequent server reboots, you can use a single command to mount directories specified in the fstab file:<br \/>\nmount -a<\/p>\n<p>You can check the mounted directories with the two earlier commands:<br \/>\ndf -h<br \/>\nmount<\/p>\n<p>192.168.218.10:\/nfs\/backup \/mnt\/storage nfs     auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0<br \/>\n\\\\192.168.218.203\\www   \/mnt\/hmg     cifs    auto,user=backup,password=back,domain=teste   0   0<br \/>\n\\\\192.168.218.181\\www   \/mnt\/webserver  cifs    auto,user=backup,password=back,domain=teste 0   0<br \/>\n\\\\192.168.218.186\\Manager   \/mnt\/Manager  cifs    auto,user=backup,password=back,domain=teste   0   0<br \/>\n\\\\192.168.218.186\\TOP   \/mnt\/biometria  cifs    auto,user=backup,password=back,domain=teste   0   0<br \/>\n\\\\192.168.218.186\\bilhetes  \/mnt\/bilhete cifs  auto,user=backup,password=back,domain=teste   0   0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting Up the NFS Client ________________________________________ Step One\u2014Download the Required Software ________________________________________ Start off by using apt-get to install the nfs programs. yum install nfs-utils nfs-utils-lib Step Two\u2014Mount the Directories ________________________________________ Once the programs have been downloaded to the the client server, create the directory&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/680"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=680"}],"version-history":[{"count":3,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/680\/revisions"}],"predecessor-version":[{"id":683,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/680\/revisions\/683"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}