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

Using NFS to realize file sharing among different system platforms (Linux and Linux, Linux and Unix)

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

NFS server-side settings

[root@rhel5 ~] # mkdir / mnt/cdrom

[root@rhel5 ~] # mount / dev/cdrom / mnt/cdrom

[root@rhel5 Server] # rpm-ivh nfs-utils-1.0.9-42.el5.i386.rpm

[root@rhel5 Server] # rpm-ivh nfs-utils-lib-1.0.8-7.6.el5.i386.rpm / / three packages to be installed

[root@rhel5 Server] # rpm-ql nfs-utils | less

The configuration file for Nfs is / etc/exports. Let's edit it.

[root@rhel5 ~] # mkdir / share / / create a shared directory

[root@rhel5 ~] # echo "i am share" > / share/share1.txt / / create a file

[root@rhel5 /] # ll-d share / / View the details of the shared directory

Drwxr-xr-x 2 root root 4096 Apr 15 08:23 share

[root@rhel5 /] # chmod other share / / change the local permissions of the shared directory other user to writable

NFS client settings 1. Manual, power-on automatic mount

[root@mail ~] # mkdir / mnt/share / / establish a nfs shared directory mount point on the nfs client

/ / implement manual mount

/ / switch to a shared directory to view and create files

/ / the configuration file of nfs is changed to the following way to achieve permission restrictions.

/ / add boot auto mount (there are two ways)

Method 1: add the boot item

/ / re-execute the boot entry

Method 2: add auto-mount items by default (/ etc/fstab)

/ / reload the default mount item of the system

2. Realization of remote automatic mounting and unloading of nfs

/ / implement the packages to be installed

[root@mail Server] # rpm-ivh autofs-5.0.1-0.rc2.131.el5.i386.rpm / / install

/ / the configuration file of autofs is / etc/auto.master, edit the configuration file

[root@mail ~] # cp / etc/auto.misc / etc/auto.nfs / / create the auto.nfs file required for the configuration file, and edit

/ / when you start the service (service autofs start) after all the configurations are completed, it often occurs that the previous mount cannot be uninstalled. The solution is as follows

/ / the automatic mount and uninstall test of nfs is shown in the following two pictures

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: 256

*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