<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nfs server installation and configuration guide Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/nfs-server-installation-and-configuration-guide/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 09 Mar 2020 09:25:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Configure NFS Server on Ubuntu 18.04</title>
		<link>https://www.osradar.com/how-to-configure-nfs-server-on-ubuntu-18-04/</link>
					<comments>https://www.osradar.com/how-to-configure-nfs-server-on-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Mon, 09 Mar 2020 09:25:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[configure NFS server]]></category>
		<category><![CDATA[how to configure nfs server on ubuntu 18.04]]></category>
		<category><![CDATA[nfs server configuration]]></category>
		<category><![CDATA[nfs server installation and configuration guide]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18544</guid>

					<description><![CDATA[<p>Today, we are going to learn that how to install &#38; configure NFS Server on Ubuntu 18.04. NFS Server is the abbreviation of Network File System. NFS is distributed file system protocol that provides the facility of remote storage &#38; retrieve data &#38; files within shared network. It enables the client machine to connect to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-nfs-server-on-ubuntu-18-04/">How To Configure NFS Server on Ubuntu 18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today, we are going to learn that how to install &amp; configure NFS Server on Ubuntu 18.04. NFS Server is the abbreviation of Network File System. NFS is distributed file system protocol that provides the facility of remote storage &amp; retrieve data &amp; files within shared network. It enables the client machine to connect to the remote servers in the same way as they are connected locally. <br>As said earlier that NFS is a client &amp; server file system. So, we require an application on the network machine &amp; NFS storage need to be mounted so that we can access directories &amp; files.<br>The figure below will clear your concept that how NFS Server &amp; NFS Client connected with the Network.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="973" height="345" src="https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-and-nfs-client.png" alt="" class="wp-image-18804" srcset="https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-and-nfs-client.png 973w, https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-and-nfs-client-300x106.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-and-nfs-client-768x272.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-and-nfs-client-696x247.png 696w" sizes="(max-width: 973px) 100vw, 973px" /></figure></div>



<p>The main advantage of using NFS shared storage is that system admin can consolidate resources into one centralized server on the network. So, client can access the storage with read &amp; write privileges easily but restricted to the underlying block storage.</p>



<h2><strong>Supported Versions of NFS </strong></h2>



<p>Here are the some supported version of NFS.</p>



<h3><strong>NFSv3 (NFS version 3)</strong></h3>



<ul><li>Support for safe asynchronous writes and is more robust at error handling than the previous NFSv2</li><li> Has support for 64-bit file sizes and offsets, allowing clients to access more than 2 GB of file data.</li></ul>



<h3><strong>NFSv4 (NFS version 4)</strong></h3>



<ul><li>It works with firewalls &amp; on the internet.</li><li>It doesn&#8217;t require rpcbind services.</li><li>NFSv4 supports ACLs (Access Control Lists)</li><li>It is helpful in stateful operations.</li></ul>



<p>So, let&#8217;s move towards the installation of NFS Server on our Ubuntu System. Just follow the below steps.</p>



<h3><strong>Step 1: Update your system</strong></h3>



<p>As usaul we do, update &amp; upgrade your system</p>



<pre class="wp-block-verse">sudo apt update &amp;&amp; sudo apt upgrade</pre>



<h3><strong>Step 2: Set up Hostname for NFS Server</strong></h3>



<p>Run the following command to set up a static host-name for NFS server. Make sure that you&#8217;ve static IP also.</p>



<pre class="wp-block-verse">sudo hostnamectl set-hostname nfs-server.osradar.com --static</pre>



<h3><strong>Step 3: How To Install NFS Server on Ubuntu 18.04</strong></h3>



<p>To install NFS Server on Ubuntu, simply type the below command</p>



<pre class="wp-block-verse">sudo apt -y install nfs-kernel-server</pre>



<h3><strong>Step 4: Start &amp; Enable NFS Services</strong></h3>



<p>Then after the installation of NFS start &amp; enable the nfs-server services so that they can be started on boot.</p>



<pre class="wp-block-verse">sudo systemctl enable --now nfs-server</pre>



<p>Make sure that the services are active by typing</p>



<p>sudo systemctl status nfs-server</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="736" height="272" src="https://www.osradar.com/wp-content/uploads/2020/03/how-to-set-up-nfs-server-.png" alt="" class="wp-image-18798" srcset="https://www.osradar.com/wp-content/uploads/2020/03/how-to-set-up-nfs-server-.png 736w, https://www.osradar.com/wp-content/uploads/2020/03/how-to-set-up-nfs-server--300x111.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/how-to-set-up-nfs-server--696x257.png 696w" sizes="(max-width: 736px) 100vw, 736px" /></figure></div>



<h3><strong>Step 5: Exporting NFS Shares</strong></h3>



<p>To export NFS, follow the one of the below two methods.</p>



<p>First one is to manaully edit the <strong>/etc/exports</strong> config file</p>



<p>The second one is by using the <strong>exportfs utility</strong> on the command line.</p>



<p>Configuration file <strong>/etc/exports</strong> is responsible to control the file systems that are export to the remote hosts &amp; specific options. Here we see the some syntax rules followed by NFS exports file.</p>



<ul><li>Empty lines are ignored.</li><li>(#) Hash sign is used to comment a line so that it will not run.</li><li>Wrap larger lines by  backslash (\).</li><li>Every exported file has its own line.</li><li>Space is used to separate the list of authorized hosts that are placed after an exported file system.</li></ul>



<h3><strong>Step 6: How To Prepare NFS Storage Path </strong></h3>



<p>To use file system you&#8217;ll need to do the partition of your disk. So, run the below command. I recommend you to attach a secondary disk for this purpose.</p>



<pre class="wp-block-verse">lsblk | grep sda</pre>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="734" height="135" src="https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-disk-.png" alt="" class="wp-image-18799" srcset="https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-disk-.png 734w, https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-disk--300x55.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/nfs-server-disk--696x128.png 696w" sizes="(max-width: 734px) 100vw, 734px" /></figure></div>



<pre class="wp-block-verse">sudo parted -s -a optimal -- /dev/sda mklabel gpt<br>sudo parted -s -a optimal -- /dev/sda mkpart primary 0% 100%<br>sudo parted -s -- /dev/sda align-check optimal 1<br>sudo mkfs.xfs /dev/sda1</pre>



<p>Now, mount this to the <strong>/data</strong> directory by</p>



<pre class="wp-block-verse">sudo mkdir /data<br>echo "/dev/sdb1 /data xfs defaults 0 0" | sudo tee -a /etc/fstab<br>sudo mount -a</pre>



<p>Then check the setting to confirm</p>



<pre class="wp-block-verse">$ df -hT | grep /data<br> /dev/sda1             xfs        40G  176M   40G   1% /data</pre>



<p>Now, create the directory on <strong>/data/nfshare</strong> which will be exported to the client.</p>



<pre class="wp-block-verse">sudo mkdir /data/nfshare</pre>



<h3><strong>Step 7: Configure NFS Exports</strong></h3>



<p>Edit the <strong>/etc/exports</strong> file to configure NFS share. Follow the below syntax to modify the file.</p>



<pre class="wp-block-verse">export host(options)</pre>



<p>You can also specify the multiple hosts by choosing each option for each host like the given syntax</p>



<pre class="wp-block-verse">export host1(options1) export host2(options2) export host3(options3)</pre>



<ul><li><strong>export</strong>=directory that is being exported.</li><li><strong>host</strong>=host or user to which the export shared</li><li><strong>options</strong>= what options you can choose.</li></ul>



<p>In this guide, I&#8217;m going to show that how I can allow read and write permissions to the remote hosts. By allowing them permissions they can easily make changes to the shared data on the file system. Look at the below example</p>



<pre class="wp-block-verse">/data/nfshare        104.27.130.185/24(rw,no_root_squash)</pre>



<p>To remove the restriction to the specific network use &#8220;*&#8221; instead. Note that it is not more secure but is good for local or private networks.</p>



<pre class="wp-block-verse">/data/nfshare        *(rw,no_root_squash)</pre>



<p><strong>no_root_squash</strong> will enable the remote users to have root privileges. It is mostly required for the installation of VM on NFS share. </p>



<p>You can also read the manual about exports by hitting man exports.</p>



<pre class="wp-block-verse">man exports</pre>



<p>After make changes to the settings just type the <strong>exportfs </strong>utility to selectively export the directories without starting services again.</p>



<pre class="wp-block-verse">sudo exportfs -rav</pre>



<ul><li><strong>r </strong>is used to cause all directoried listed in /etc/exports to export them by making a new export list in /etc/lib/nfs/xtab</li><li><strong> a</strong> is used to export or unexport the all directories. It&#8217;ll check the other options before its operation.</li><li><strong> v </strong>is used to display the current progresss.</li></ul>



<p>You also have the option to restart NFS services rather than using<strong> exportfs</strong> command.</p>



<pre class="wp-block-verse">sudo systemctl restart nfs-server</pre>



<h3><strong>Step 8: Mount NFS Shares on Client Machines</strong></h3>



<p>As we&#8217;ve finish installing the NFS Server along with configuration. So, in our next guide we will cover the remaining progress that how to mount NFS shares on a client system. Here client can be any host, remote system or a VM on the same server or even the server itself.</p>



<p>So visit the below link to proceed further</p>



<p><a href="https://www.osradar.com/?p=18543">How To Configure NFS Client on Ubuntu 18.04</a></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-nfs-server-on-ubuntu-18-04/">How To Configure NFS Server on Ubuntu 18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-configure-nfs-server-on-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
