Mounting NFS in ubuntu (arm6410 Development Board)

Source: Internet
Author: User

After several days of hard work, I have encountered problems with mounting NFS file systems on the forum.

After the mounting was successful last night, I will share with you how I mounted it successfully and some problems and precautions. I hope it will be helpful to those who have not been mounted successfully, and I hope more people can share their successes with others to promote common progress.
Before mounting, check whether the following hardware devices are connected:
1. Power Cord insertion
2. Connect the Development Board com0 and PC with a serial line
3. USB cable connection Development Board and PC
4. Plug in the network cable!
The most easy to ignore is that the network cable is not plugged in, leading to problems like this that have never been solved.
Rpcbind: Server x. x not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
Root-NFS: server returned error-5 while mounting/home/glorin/sharetmp/filesys
To address this problem, note that except for the above network cable, the Host IP address (My Ubuntu IP address in the Virtual Machine) is not the same as the IP address of the Development Board.

CIDR blocks.
Solution: Change the Host IP Address

How to change the Host IP Address:
$ Sudo Vim/etc/Network/interfaces
Then set:
Auto Lo
Iface lo Inet loopback
Auto eth0
Iface eth0 Inet static
Address 192.168.1.20 (reference)
Netmask 255.255.255.0
Gateway 192.168.1.1 (reference)
After modification, restart the Network Configuration:
Sudo/etc/init. d/networking restart
Make sure the settings are correct. For Ubuntu users, modify/etc/NetworkManager/nm-system-settings.conf
[Main]
Plugins = ifupdown, Keyfile
[Ifupdown]
Managed = false
Change managed = ture to false.
Run sudo/etc/init. d/network-manager restart and reconfigure it. (For DNS, set sudo/etc/resolv. conf)
So far, the Host IP address is set.
Note: The above addresses are for reference only. Please set them based on your actual situation.

Now, mount NFS.
1. Set the shared directory
For example, we use/home/localhost/arm6410/root as the NFS shared object.
$ Sudo mkdir arm6410
$ CD arm6410
$ Sudo mkdir Root
$ Chmod 777 arm6410
$ Chmod 777 Root
Note: shared directories are different from those of Alibaba Cloud. I think many people may have problems here. This involves the working directory and the system root directory. Remember that we open the terminal, however

The Created directory is in/home/XXX. You can see XXX in the home of the root file system.

2. Set IP
For more information about settings, see.

3. Configure and start the NFS service

Install NFS

Create a new terminal on the VM and run the following commands in sequence:
Sudo apt-get install portmap
Sudo apt-get install nfs-kernel-server
Sudo gedit/etc/exports

In the pop-up text editor, edit the exports file and add the following in the last line:
/Home/localhost/arm6410/root * (rw, sync, no_root_squash)

 

Start NFS service

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

To test whether the NFS service is enabled on the host, assume that the IP address of the host has been set to 192.168.1.20.
Sudo mount-t nfs 192.168.1.20:/home/localhost/arm6410/root/mnt
Run the following command: ls/mnt to view the mounting content (or check whether the arm6410/root directory can be viewed in the mnt directory)
Unmount sudo umount/mnt

4. Set and save startup parameters on the Development Board
Run the following command on the u-boot command line to set the u-boot startup parameters:
Setenv bootargs "root =/dev/nfs nfsroot = 192.168.0.20:/home/localhost/arm6410/root ip = 192.168.1.10: 192.168.1.20: 192.168.1.1: 255.255.255.0: arm6410: eth0: off console = ttySAC0, 115200"
Saveenv
Restart the Development Board. After the Linux kernel is started, the NFS file system is automatically mounted. Also note the shared directory.
After the preceding steps are completed, run the yaffs2 file and follow the instructions in the manual.

5. If the problem persists, it indicates the network setting or NFS configuration is incorrect.

Solution:

Network problems:

Run the command on the host and run the command-> cmd-> ping 192.168.1.20 to check whether the ping is successful. You cannot modify the IP address on your own.

Then in the linux System of the virtual machine, my ubuntu is connected to the serial port of the Development Board and the virtual machine, and ping 192.168.1.10 (that is, the IP address of the Development Board) in minicom)

Check whether the ping is successful. You cannot change the IP address.

If all of the above can be pinged, it indicates that the network settings are correct.

NFS configuration problems:

This is generally a firewall problem. Disable the linux firewall.

1) takes effect after restart
Enable: chkconfig iptables on
Close: chkconfig iptables off

2) takes effect immediately and becomes invalid after restart
Enable: service iptables start
Disable: service iptables stop

You can use the preceding command to enable or disable other services in Linux.

When the firewall is enabled, make the following settings to enable the relevant ports,
Modify the/etc/sysconfig/iptables file and add the following content:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT

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.