Nfs is successfully mounted to ubuntu in the Virtual Machine and the YAFFS2 file system is installed for arm11.

Source: Internet
Author: User

In order to mount nfs successfully in Ubuntu, many problems were encountered. After mounting is successful today, I feel that many of these problems can be avoided. However, from another perspective, you may be exercising your abilities.

Let's talk about the main steps first, and then let's talk about the key points for successful mounting. If your mounting is unsuccessful, it is likely that these key points are not well done.

The first step is to burn uboot and kernel for the Development Board.

1. format the SD card in FAT32 format. Solidify the startup code into the SD card.

Possible problems: 1 volume erro and so on.

Solution: Re-unplug the SD card. In some cases, try another SD card.

2. Download uboot to nandflash and set uboot parameters. Note that the serial port and baud rate must be set correctly.

Possible problems: 1. arning: oemmultibinnotify: Invalid bin region Descriptor (s ).
Don't support raw image

Solution: in this case, select {
Tagshow (Event)
} "> USB port --> uboot". Select uboot instead of transmit.
2. Unable to write uboot into nandflash

Solution: Press ENTER until OK appears. (This is generally because nand erase is not clean and must wait until OK appears. If it does not appear, it indicates that it is not erased)

3. Burn the Kernel.

The possible problems are generally the same as above 2. Pay attention to the points I mentioned.

4. Installing the root file system is also an important step. If you want to install the yaffs2 file, it will also involve mounting the file to NFS.

Suppose we want to install the yaffs2 file.

First step: Install NFS

Install the NFS service software on the host (I am using ubuntu in the virtual machine), because Debian/Ubuntu is not installed by default.

1. Install port er portmap (optional)
$ Sudo apt-get install portmap

2. Enter the following command at the terminal prompt to install the NFS server:
$ Sudo apt-get install nfs-kernel-server

3. Install the NFS client (optional)
$ Sudo apt-get install nfs-common

Note:Both nfs-kernel-server and nfs-common depend on portmap. In addition, it is suggested in some documents that apt-get should be used to manually install NFS client nfs-common and port er portmap. However, this is not necessary, this is because apt automatically installs nfs-kernel-server.

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, install nfs-common (step 1 ).

Step 2: Configure NFS

1. Configure portmap
Method 1: edit/etc/default/portmap and remove "-I 127.0.0.1;
Method 2: $ sudo dpkg-reconfigure portmap. the "Configuring portmap" Software Package setting interface appears. Do you want to shocould portmap be bound to the loopback address? Select "No )".

Step 3: create a 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 (change the File Permission. Otherwise, problems may occur later)

$ Chmod 777 root (change the File Permission. Otherwise, problems may occur later)

Step 4: configure the shared directory and the yaffs2 File

Modify the content of the/etc/exports file on the host and add a line:/home/localhost/arm6410/root * (rw, sync, no_root_squash)
$ Sudo vim/home/localhost/arm6410/root * (rw, sync, no_root_squash)

Note: When the uboot startup parameter is set later, the directory name must be the same as this.

Where:
/Home/localhost/arm6410/root indicates the NFS shared directory, which can be mounted as the root file system of the Development Board through NFS;
* Indicates that all clients can mount the directory. Of course, you can also specify a specific IP address, such as 192.168.x.x;
Rw indicates that the Client Connected to this directory has the permission to read and write the directory;
Sync indicates that all data is written to the shared data upon request, that is, data is synchronized to the memory and hard disk;
No_root_squash indicates that the Client Connected to this directory is allowed to have the root identity of the host;

After the file sharing directory is configured, place the yaffs2 file in the shared directory and decompress it.

Step 5: Start the NFS service

After completing the preceding configuration, you must first start the portmap and NFS services, and the portmap service must be started before the NFS service.
$ Sudo/etc/init. d/portmap start
$ Sudo/etc/init. d/nfs-kernel-server start

Others may be used:

Stop NFS service
When stopping the NFS service, you must stop the NFS service before stopping the portmap service. If other services in the system need to use the portmap service, you can stop the portmap service.
$ Sudo/etc/init. d/nfs-kernel-server stop
$ Sudo/etc/init. d/portmap stop

Restart the portmap and NFS services.
$ Sudo/etc/init. d/portmap restart
$ Sudo/etc/init. d/nfs-kernel-server restart

Check portmap and NFS service status
$ Sudo/etc/init. d/portmap status

$ Sudo/etc/init. d/nfs-kernel-server status

Step 6: configure the target board and host (my host is ubuntu) IP

The two IP addresses must be in the same CIDR block. Otherwise, many problems may occur, such as Root-NFS: Server returned {
Tagshow (event)
} "> Error-5 while mounting/forlinx/root is caused by this problem.

Hypothesis:

Host IP Address: 192.168.1.20
Target Board IP Address: 192.168.1.10

You can view the IP address of the target board by using printenv after setting the uboot environment variable.

This step has two options: 1 is to change the Host IP address, which is relatively simple. (You can change it back to the Internet in the future)

$ Sudo vim etc/network/interfaces

Then set:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1

Save and restart

Sudo/etc/init. d/networking restart

2. Change the target board IP address. The premise is that you can enter the Development Board environment. Generally, you have installed a file system similar to cramfs, but you want to use the yaffs2 file system.

Go to the Development Board environment, enter the/etc/init. d/directory, and you will see an RCS file. The IP address is modified in this file.
# Vim/etc/init. d/RCS

Add:

/Sbin/ifconfig eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.1 up

: WQ save and exit

(// You can also run the command to change # ifconfig eth0 202.118.212.168 netmask limit 255.255.0)
After modification, restart the Development Board.

Step 7: Set startup parameters on the Development Board
Set startup parameters through U-boot
When u-boot is started, set the startup parameters at the command prompt as follows:
Setenv bootargs "root =/dev/nfs nfsroot = 192.168.1.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 = fig, 115200"
Where:

192.168.1.20 is the Host IP address.

/Home/localhost/arm6410/root is the shared directory

192.168.1.10 is the IP address of the Development Board.

Console = ttysac0, 115200 is the console parameter.

Save parameter: saveenv

Part 8: Burn the yaffs2 File

In the uboot command after the restart, nand erase x is also the area to be written.

Then restart the Development Board and enter writeyaffs on the terminal. (different development board commands are required. Note that)

This is basically done, And the yaffs2 file system has been compiled.

Last step: Set startup parameters

Restart the Development Board and configure the yaffs2 file as the root file system.

Enter the following parameters in the uboot command line:

Setenv bootargs "root =/dev/mtdblock2 rootfstype = yaffs2 console = ttysac0. 115200"

Saveenv

NFS is mounted and the yaffs2 file is successfully configured!

 

 

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.