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

How to set and mount between linux systems through nfs network file system

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to mount between linux systems through the nfs network file system". In the daily operation, I believe that many people have doubts about how to mount between linux systems through the nfs network file system. Xiaobian consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question of "how to mount between linux systems through the nfs network file system". Next, please follow the editor to study!

Introduction to NFS

NFS is the abbreviation of Network File System, that is, network file system. Network file system is one of the file systems supported by FreeBSD, also known as NFS. NFS allows a system to share directories and files with others on the network. By using NFS, users and programs can access files on remote systems as if they were local files.

Benefits of NFS

Here are the most obvious benefits of NFS:

1. Local workstations use less disk space because the usual data can be stored on a machine and accessible over the network.

two。 Users do not have to have a home directory on every machine on the network. The Home directory can be placed on a NFS server and is available everywhere on the network.

3. Storage devices such as floppy drives, CDROM, and Zip (which refers to disk drives and disks with high storage density) can be used by other machines on the network. This reduces the number of removable media devices on the entire network.

Linux server 192.168.190.199 server

Linux server 192.168.190.208 client

192.168.190.199 (server) configuration operation:

1. Installation service

Check to see if the nfs,portmap service is installed

If nfs is not installed, portmap uses yum search

< 包名>

Install the appropriate package

two。 Configuration / etc/exports

Configure in the / etc/exports file

The configuration parameters are as follows

[shared directory] [hostname 1 or IP1 (parameter 1, parameter 2)] [hostname 2 or IP2 (parameter 3, parameter 4)]

Here are some common parameters for NFS sharing:

Ro read-only access

Rw read-write access

Sync all data is written to the share on request

Async NFS can request before writing data.

Secure NFS is sent over a secure TCP/IP port below 1024

Insecure NFS is sent over more than 1024 ports

Wdelay if multiple users want to write to the NFS directory, write in groups (default)

No_wdelay if more than one user wants to write to the NFS directory, it is written immediately, and this setting is not required when using async.

Hide does not share its subdirectories in the NFS shared directory

A subdirectory of the no_hide shared NFS directory

Subtree_check forces NFS to check the permissions of the parent directory when sharing a subdirectory such as / usr/bin (default)

No_subtree_check is relative to the above, and the permissions of the parent directory are not checked

The UID and GID of all_squash shared files map the anonymous user anonymous, which is suitable for public directories.

No_all_squash retains UID and GID of shared files (default)

All requests from root_squash root users are mapped to the same permissions as anonymous users (default)

No_root_squas root users have full administrative access to the root directory

Anonuid=xxx specifies the UID of anonymous users in the NFS server / etc/passwd file

Anongid=xxx specifies the GID of anonymous users in the NFS server / etc/passwd file

Such as:

The copy code is as follows:

/ home/share208 192.168.190.208 (rw,sync) * (ro) http://www.iis7.com/a/lm/ftp/ configuration description: read and write permissions are given to 192.168.102.15, and other machines only have read-only permissions.

NFS service

Start the NFS service

The copy code is as follows:

/ etc/init.d/portmap start

/ etc/init.d/nfs start

Stop the NFS service

The copy code is as follows:

/ etc/init.d/nfs stop

/ etc/init.d/portmap stop

Restart the NFS service

The copy code is as follows:

/ etc/init.d/nfs restart

/ etc/init.d/portmap restart

Check the status of portmap and nfs services

The copy code is as follows:

/ etc/init.d/portmap status

/ etc/init.d/nfs status

Set the NFS service to start automatically

For practical Linux systems, it is not realistic to start nfs services manually after each boot, and the system should be set to start portmap and nfs services automatically at specified running levels (usually 3 and 5).

At this point, the study on "how to set mount between linux systems through the nfs network file system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

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

12
Report