How to install NFS (Network File System) server in Linux Mint?

The Network File System (NFS) protocol was developed by Sun Microsystems in 19841. NFS builds over Open Network Computing Remote Procedure Call, commonly called SUN ONC.

Step 1: Install NFS server and associated applications on the Linux Mint desktop.

Issue the command: #sudo apt-get install nfs-kernel-server nfs-common portmap

Step 2: Configure the NFS Server.

NFS exports from a server are controlled by the file /etc/exports. Each line begins with the absolute path of a directory to be exported, followed by a space-seperated list of allowed clients.

For example: To export the /var/nfs directory so that it can be accessed by any client, please insert the below line into /etc/export.
/var/nfs * (ro,async,subtree_check)

Note: Allowing any client to access your box can be potentially harmful. Please reconsider your decision before doing so.

To allow access to machines with a particular set of IP addresses, please insert the below line in /etc/export.
/var/nfs 192.168.1.1/24 (ro,async,subtree_check)

Other options that can specified along with the IP address include:

ro:

The directory is shared read only; the client machine will not be able to write it. This is the default.

rw:

The client machine will have read and write access to the directory.

no_root_squash:

If no_root_squash is specified, then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications. You should not specify this option without a good reason.

no_subtree_check:

If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.

sync

By default, all but the most recent version (version 1.11) of the exportfs command will use async behavior, telling a client machine that a file write is complete – that is, has been written to stable storage – when NFS has finished handing the write over to the filesystem. This behavior may cause data corruption if the server reboots, and the sync option prevents this.

References


1.  “Design and Implementation of the Sun Network Filesystem“. USENIX. 1985.

2. RFC 3530 – NFS Version 4 Protocol Specification.

3. Linux NFS Overview, FAQ and How-To documents.

Disclaimer


All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

a user on a client computer to access files over a network in a manner similar to how local storage is accessed
Reblog this post [with Zemanta]

How to obtain hostname from IP address in Linux?

Today, I fell in need of identifying the host name (also termed as ‘DNS name‘) based on the IP address for one of my Linux Box. My first try was using 'ping -a' command. But that failed to satisfy my requirement.

Domain names, arranged in a tree, cut into zon...
Image via Wikipedia

If you ever come across the situation where 'ping -a' does not provide you with the host name of the box, then you can try any of the below mentioned methods to satisfy the requirement.

Method 1: Using the 'host' command

One of the simplest way to retrieve host name from IP address is employing the 'host' command provided by GNU/Linux.
Syntax for the host command: $>host <ip-address> <nameserver>
Example:

testhost:~ # host 209.85.231.104
104.231.85.209.in-addr.arpa domain name pointer maa03s01-in-f104.google.com.
testhost:~ #

Method 2: Using the 'nslookup' command

nslookup is a command used to query the Internet Domain Name servers.

Example:
nslookup 209.85.231.104
Server:  72.163.128.140
Address: 72.163.128.140#53


Non-authoritative answer:
104.231.85.209.in-addr.arpa    name = maa03s01-in-f104.google.com.


Authoritative answers can be found from:
231.85.209.in-addr.arpa    nameserver = ns1.google.com.
231.85.209.in-addr.arpa    nameserver = ns3.google.com.
231.85.209.in-addr.arpa    nameserver = ns4.google.com.
231.85.209.in-addr.arpa    nameserver = ns2.google.com.
ns3.google.com    internet address = 216.239.36.10
ns4.google.com    internet address = 216.239.38.10
ns2.google.com    internet address = 216.239.34.10
ns1.google.com    internet address = 216.239.32.10

Method 3: Using the 'dig' command
As per the Linux man pagedig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried.

Disclaimer

All data and information provided on this site is for informational purposes only. sks8.wordpress.com or skumar.co.nr makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. Any trademarks, if at all displayed on this blog belong to their respective owners.

Reblog this post [with Zemanta]