The principle of installing nfs on 1 nfs is to mount the file system shared by remote hosts to the local machine through the network. NFS server is not installed on Ubuntu10.04 by default. First install the NFS service program: # sudoapt-getinstallnfs-kernel-server (when nfs-kernel-server is installed, apt will automatically install nfs-common and portmap) so that the host is equivalent to NFS
1 NFS Installation
Nfs is used to mount the file system shared by remote hosts to the local machine through the network. By default, the NFS server is not installed on Ubuntu 10.04. 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.
2. Configure NFS for the host
2.1 modify the configuration file/etc/exports.
Open the exports file with # vim/etc/exports on the terminal.
If you have not configured this file, it should be empty. Write in the start part
/Home * (rw, sync, no_root_squash)
/Home -- directory shared with the client;
* -- Allows any user to use the IP address;
(Rw, sync, no_root_squash) -- rw, the client mounting this directory has the Read and Write rights to this directory;
Sync ,......;
No_root_squash: the client that mounts this directory has the root privilege of the host;
I set the root directory of the host to the shared directory/* (rw, sync, no_root_squash)
OK, save, and exit.
After the modification is complete, enter: # exportfs-rv to make the configuration file take effect.
2.2 configure the host's IP address
Configure the IP address of the host machine, and enter # ifconfig in the command line to view the IP address of the local machine. If no IP address is set, use the command # ifconfig eth0 192.168.0.18 to set the IP address. The IP address can be set according to the actual situation. After setting is complete, use ifconfig to check whether the setting is successful again.
2.3 start the NFS service of the host
After installing the NFS service, you can use #/etc/init. d/nfs-kernel-server restart (/etc/init. d/nfs-kernel-server start) to re-enable the Network File System Service, so that subsequent development boards can be mounted. You can also stop it by #/etc/init. d/nfs-kernel-server stop.
3 mount the target board
Power your target machine. After the Linux operating system on the target board is up, enable minicom on the Ubuntu operating system on the PC and send shell commands to the target board through the serial port.
Like a host operation, first check whether the IP address of the target board (client) is the same as the IP address of the host, otherwise, run the preceding command to check and set the local IP address.
After the IP address is set, ping the IP address to check whether the network card and network cable are correctly connected.
If you enter # ping 192.168.0.18 (Host IP address) in minicom to successfully connect, information will be printed continuously.
Mount ON THE DEVELOPMENT BOARD
# Mount-t nfs-o nolock 192.168.0.18: // mnt
The following is the shared directory mounted by the client;/mnt is the mounted directory of the Development Board.
OK.
Pass
# Cd/mnt
# Ls
You can find that the root directory of the host is mounted to the mnt directory of the Development Board.
If you want to cancel the hang, use the command # umount/mnt.