Configure Network File System Service NFS

Source: Internet
Author: User

The Network File System Configuration Service NFS is used to develop applications in Embedded Linux, which is very different from the development method of applications in Windows. In Windows, you can directly use various integrated development tools on a PC to edit, compile, and run programs. However, in an embedded Linux environment, there is a lack of simple and efficient development tools, program Development must be completed on the PC and embedded Linux platform. Therefore, during program debugging and running, information needs to be exchanged between the PC and Embedded Development Board, which is usually achieved through FTP (file transfer protocol. That is, edit the source program file on the PC, use the cross-compilation tool to generate the executable file, and then download the file to the Embedded Target edition system through FTP for running, if an error occurs, go back to the PC and re-edit and compile it. Then download it to the target board and run it until the program runs correctly. However, the disadvantage of the FTP method is that you need to use FTP to download the program to the Target Board after each compilation on the PC. In this way, the program development efficiency is relatively low and online debugging cannot be performed. During the development of the portable satellite communication earth station monitoring system, NFS (Network File System) is used for application development, this method makes information exchange between PC and Embedded Target Board more efficient. Network File System (NFS) allows you to connect directories on the remote host to the local host over the Network. You can easily operate the shared directories on the local host. Therefore, you can create a Network File System to share a specific directory on the PC to the embedded development board system. In this way, you can directly operate the embedded development board on the PC, it can edit, compile, and run programs in real time and online, which greatly improves the development efficiency of applications in embedded Linux. The NFS development environment configuration under the embedded Linux development platform, including the NFS configuration of the PC and the NFS configuration of the embedded development board system. 1. configure the NFS of the PC to enter the ora7 Linux operating system on the PC as the root user, and edit the configuration file exports of the shared directory between the PC and the embedded target board, to set the shared directory and permissions, run the following command: [root @ localhost/] # cd/etc; [root @ localhostetc] # vim/etc/exports; add "/nfs * (rw, sync, no_root_squash)" to the exports file and save it. "*" indicates all clients that are connected to the PC Network (this refers to the Embedded Target Board) can all share the "/nfs" directory in the PC. "rw" indicates that the client that shares this directory has the right to read and write this directory, "no_root_squash" indicates that the client that shares this directory has the root identity of the host. The function is to set the/nfs of the PC as the shared directory. The Embedded Target Board Connected to the PC can access the shared directory/nfs in read/write mode. In the Fedora7 Linux operating system, firewall is enabled by default, which causes the NFS service to fail to work normally. to disable the firewall, you can use the lokkit command to open the interface for setting the fire period, select "Disable" and click "OK" to exit the settings page. Start the NFS service and run the following command: [root @ localhostetc] #/etc/init. d/nfsstart; then check the Linux server's iptables, ipchains, and other options and files/etc/hosts. deny,/etc/hosts. allow to ensure that the port used by NFS is not blocked and the host that allows communication is not blocked. After the configuration is complete, to verify whether the shared directory can be accessed, perform a loop test on the NFS server on the PC. The operation command is as follows: [root @ localhostetc] # mount-t nfs localhost: /nfs/mnt if the configuration is successful, you can view the content in the/mnt directory/nfs shared directory. 2. to configure NFS for the control panel of the portable satellite communication earth station monitoring system, first enable the Linux kernel running on the embedded target board system to support NFS on the PC) compile the Linux kernel into the target board. The command is as follows: [root @ localhost/] # cd/home/arm/linux-2.6.19; [root@localhostlinux-2.6.19] # make menuconfig; // select the "Fils System --->" option in the Kernel configuration menu on the startup Kernel configuration menu interface, and press the Enter key to select the "Network File System --->" option in the lower menu, press the Enter key and select "NFS system support" and "Provide NFSv3 client support" in the menu. Save and exit. Then run the following command: [root @ localhost linux-2.6.19] # make clean; // This command clears the previously generated suffix ". o "and". ko "file [root@localhostlinux-2.6.19] # make dep; // establish dependency between kernel files [root@localhostlinux-2.6.19] # make zImage; // compile a compressed kernel boot image. This will generate a kernel image file zImage in arch/arm/boot, and then download the Linux Kernel File zImage to the SDRAM of the embedded target board system, run the command [root @ localhost/] # mkdir/nfs; // create a mount point for the Linux output shared directory on the PC. [root @ localhost/] # mount-o nolock-t nfs Localhost:/nfs; // This command enables the Linux output directory "/nfs" on the PC to be mapped to the directory "/NFS" of the embedded target board system through nfs ".

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.