Enable NFS connection to the Development Board in Ubuntu

Source: Internet
Author: User
The file portmaphosts is involved. denyhosts. allow involves operations (in the following order ). /etc/init. d/portmaprestart. /etc/init. d/nfs-commonrestart. /etc/init. d/nfs-kernel-serverrestart: the NFS server is not installed by default on server and clientUbuntu.

Files involved
Portmap hosts. deny hosts. allow

Involved operations (in the following order)
./Etc/init. d/portmap restart
./Etc/init. d/nfs-common restart
./Etc/init. d/nfs-kernel-server restart

Install server and client

By default, the NFS server is not installed on Ubuntu. First, install the NFS service program:
$ Sudo apt-get install nfs-kernel-server
(When nfs-kernel-server is installed, apt will automatically install nfs-common and portmap)
In this way, the host is equivalent to the NFS Server.

Similarly, if the target system is an NFS client, you must install the NFS client program. For Debian/Ubuntu systems, nfs-common must be installed.
$ Sudo apt-get install nfs-commmon
Both nfs-common and nfs-kernel-server depend on portmap!
The installation is complete, and the configuration is as follows:

Configure NFS

Configure portmap
Method 1: edit/etc/default/portmap and comment out the last line.
Method 2: $ sudo dpkg-reconfigure portmap, shocould portmap be bound to the loopback address? Select N.

Configure/etc/hosts. deny
(Prohibit any host (host) from connecting to your NFS server), add:
### NFS DAEMONS
Portmap: ALL
Lockd: ALL
Mountd: ALL
Rquotad: ALL
Statd: ALL

Configuration/etc/hosts. allow
Allow hosts you want to establish connections with your NFS server. The following steps allow any host whose IP address starts with 192.168.197 to be connected to an NFS server, or specify a specific IP address. See hosts_access (5) and hosts_options (5) on the man page ). Join:
### NFS DAEMONS
Portmap: 192.168.197.
Lockd: 192.168.197.
Rquotad: 192.168.197.
Mountd: 192.168.197.
Statd: 192.168.197.

/Etc/hosts. deny and/etc/hosts. allow sets the access to portmap. using these two configuration files is a bit similar to "mask. now/etc/hosts. deny prohibits all users from accessing portmap. then in/etc/hosts. some users are allowed to access portmap in allow.

Configure/etc/exports
The NFS mount directory and permissions are defined by the/etc/exports file.
For example, to share the IP address of 192.168.197. * In the/home/liliming/arm2410 directory in my home directory, add the following statement at the end of the file:
/Home/liliming/arm2410 192.168.197. * (rw, sync, no_root_squash)
Or:/home/liliming/arm2410 192.168.197.0/24 (rw, sync, no_root_squash)
Note that, in this case, your NFS may not be available. You can allow the IP address to share your directory. The statement is as follows:
/Home/liliming/arm2410 * (rw, sync, no_root_squash)

Now that the configuration is complete, start NFS

Start NFS

Sudo./etc/init. d/portmap restart
Sudo./etc/init. d/nfs-common restart
Sudo./etc/init. d/nfs-kernel-server restart

Test NFS

Under Ubuntu
Sudo mount localhost:/home/liliming/arm2410/mnt
Ls/mnt
Check whether the mounting is successful
Under the development board
Mount 192.168.197.75:/home/liliming/arm2410/mnt
Ls/mnt
Check whether the mounting is successful (192.168.197.75 is the IP address of Ubuntu)

Possible errors:
1. The Mount is not successful. Please try again as prompted.
Configure/etc/exports
/Home/liliming/arm2410 * (rw, sync, no_root_squash)
That is, allow access from all IP addresses.
2. The system prompts mount rpc unable to receive errno connection refused.
It indicates that your server (Ubuntu) service is not set up, and the reasons may be as follows:
A. NFS is not started. Follow the preceding steps to restart NFS.
B. Check whether the IP address in the file/etc/exports and file/etc/hosts. allow contains the IP address of your development board,
If not, write your network segment and restart NFS.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.