[HarmonyOS HiSpark AI Camera Trial Serial] How to actually mount an NFS network file system

Sequence:
  Network File System, English Network File System (NFS), is a UNIX presentation layer protocol (presentation layer protocol) developed by SUN, which enables users to access files elsewhere on the network as if they were using their own computer.
Insert picture description here
  As shown in the figure above, when our NFS server has set up the shared directory /home/sharefile, other NFS clients can mount this directory to a mount point on their own system (mount Point can be customized), for example, the directories mounted by NFS client 1 and NFS client 2 in the previous illustration are different. After the mount is successful, we only need to enter /home/data/sharefile in the NFS client 1 system, and you can see the /home/sharefile directory in the NFS server system, which is also the same in NFS client2. The above picture is from the Internet, invaded and deleted.

1. Install nfs service in ubuntu virtual machine:
  sudo apt-get install nfs-kernel-server

2. Modify the configuration file in ubuntu and add a mountable directory:
  this file is the main configuration file of NFS! However, the system does not have a default value, so if this file does not exist, you can create a new file with the same name and perform the following configuration! The configuration of the NFS file system service is also limited to this file.
  sudo vim /etc/exports

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#


/home/harmony/nfs_root *(rw,sync,no_root_squash)

3. Restart the NFS service:
  sudo /etc/init.d/nfs-kernel-server restart

PS : Ensure that the virtual machine and the development board can be pinged. You can configure the virtual machine network as follows:
  bridge the virtual machine with the PC host and the development board, and bridge the network to the network card used by the development board. This time the development board is wired Internet connection.
Insert picture description here

4. Test the network connectivity between the development board and the virtual machine:
Insert picture description here
5. Mount the network file system
  mount 192.168.1.111:/home/harmony/nfs_root /mnt nfs
Insert picture description here
  As shown in the figure above, the nfs_root directory in the virtual machine has been mounted In the mnt path to the development board, the NFS file system is successfully mounted.

Note: From the electronic enthusiast forum.
My homepage: https://bbs.elecfans.com/user/2105315/

Guess you like

Origin blog.csdn.net/qq_33475105/article/details/110948769