Automatic and manual mounting of NFS network file systems

Source: Internet
Author: User
Used to mount the shared folder of the nfs server to the client between linux and linux or between linux and unix, and use the protocol RPC (Remote Process Scheduling) www.2cto. comNFS uses rpc1. when the nfs and rpc services on the server are started, many processes will be formed: mountd, n...
Used between linux and linux or between linux and unix
Mount the shared folder of the nfs server to the client and use the RPC protocol (remote process scheduling)
Www.2cto.com
NFS rpc
1. when the nfs and rpc services on the server are started, many processes are formed: mountd, nfs, nlockmgr, and status.
2. the client has rpc. mountd, rpciod, nlockmgr, and status Processes.
3. the client needs to mount the server file and send a request connection using the portmapper of the rpc. mountd process item server.
4. after receiving the request, the server-side portmapper responds to the client and informs the client which port is used to connect to the server.
5. the client uses rpc. mountd to request mountd from the server.
6. after mounting, the client uses the process rpciod to call the nfs process on the server side to perform disk I/O operations.
7. both ends call the nlockmgr lock mechanism. when the server is writing a document, access from the client is prohibited.
8. to maintain the connection, both ends use the status process.
Www.2cto.com
View local nfs
[Root @ localhost ~] # Rpm-qa | grep nfs
Nfs-utils-lib-1.0.8-7.6.el5
Nfs-utils-1.0.9-42.el5
[Root @ localhost ~] # Start service nfs start
View your processes: [root @ localhost ~] # Create a folder using mkdir/public
[Root @ localhost ~] # Cd/public
[Root @ localhost public] # touch fi.txt
[Root @ localhost ~] # Vi/etc/exports edit [root @ localhost ~] # Service nfs restart

Open another linux virtual machine at 192.168.145.200
[Root @ localhost ~] # Rpcinfo-p 192.168.145.100
[Root @ localhost ~] # Showmount-e 192.168.145.100 View shared files on 145.100
Export list for 192.168.145.100:
/Public *
[Root @ localhost ~] #
Mount the shared file on 192.168.145.100 to your/mnt/public/instance.
[Root @ localhost ~] # Mount 192.168.145.100:/public/mnt/public on the client (192.168.145.200) for automatic mounting;
[Root @ localhost ~] # Vi/etc/fstab
Add the following content
192.168.145.100:/public/mnt/public nfs ULTS ults, soft, intr 0 0
[Root @ localhost public] # pwd
/Mnt/public because it is in the Mount directory/mnt/public/, it cannot be uninstalled.
You can do this:
[Root @ localhost public] # fuser-v/mnt/public

USER PID ACCESS COMMAND
/Mnt/public: root 4602 .. c .. bash

[Root @ localhost public] # fuser-kv/mnt/public
After knocking, jump out directly, and then go in and execute the command to find that the following control time mounting is implemented:
[Root @ localhost ~] # Umount/mnt/public
Go to/etc/fstab and delete the added content.
You can use the command chkconfig-list | grep auto to edit the/etc/auto. master File to view the help documentation [root @ localhost ~]. # Cd/etc
[Root @ localhost etc] # ls auto *
Autofs_ldap_auth.conf auto. master auto. misc auto.net auto. smb
[Root @ localhost etc] # cp auto. misc auto. nf
[Root @ localhost etc] # vi auto. nfs Edit
Add the following content: [root @ localhost etc] # service autofs restart service
Stopping automount: [OK]
Starting automount: [OK]
[Root @ localhost etc] #
Check mounting: Wait a minute and you will find that the Mount is missing:
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.