Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mount the network file system in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Linux mount network file system, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Preface

Say a few words before you share your notes. First of all, thank you for your attention and support! Recently, there have been fewer original notes, because I have recently returned to work, and the editor needs to work during the day and recharge himself at night. Only when there is input can there be output, so that more study notes can be output. So there are fewer articles in the recent paragraph.

Introduction to NFS

NFS (Network File System), the network file system, enables users to access files elsewhere on the network as if they were using their own computer. It works by using a client / server architecture:

Server programs provide access to the file system to other computers, a process called output. When the NFS client program accesses the shared file system, it "transfers" them from the NFS server.

Files are usually transferred in blocks. In our embedded Linux, the main application of NFS is to share the files on the host (such as the executable file of the target board) to the target board, so that the target board can easily run the program.

The experimental block diagram of this note is as follows:

NFS is mounted on the development board

1. Configure the NFS shared directory to be accessible

You need to modify the / etc/exports in the host to add the following sentence to the exports file:

Swipe left and right to see all the code >

/ home/book/nfs_share * (rw,nohide,insecure,no_subtree_check,async,no_root_squash)

There are two parts of content, which are separated by spaces. The first part of the content / home/book/nfs_share is the development host directory that we want to share. The second part is about some configuration parameters:

*: this is a wildcard, which means that anyone can access the directory. You can also specify which client can access it. For example, our development board IP is 192.168.1.111:

If we change the * number to our development board IP, we can make this shared directory accessible only to our development board. Description of other parameters:

After saving the file, enter the following command to update the exports configuration:

Sudo exportfs-arv

Then put a compiled hello executable into the shared directory:

2. The development board mounts the shared directory

Enter the command in the serial port terminal of the development board:

Swipe left and right to see all the code >

Mount-t nfs-o nolock,vers=4 192.168.1.104:/home/book/nfs_share / mnt

Vers=4 means to use version 4 of the NFS file system. 192.168.1.104 is the Ubuntu host IP. / home/book/nfs_share is a shared directory. / mnt is the local mount point.

The experiment was successful, and the development board successfully ran the hello program in the shared directory.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report