Linux note 2-7 access to the network file system

Source: Internet
Author: User
Tags command access


Seven. Accessing the network File system #*********
# #1. CIFS Network File system Access # #
1. Install the shared access client
Yum Install Samba-client-y
2. Identify shared server shared directory
Smbclient-l//172.25.254.250
3. Accessing the Share
Command access)

Smbclient//172.25.254.250/WESTOS1
Mount access)
Mount//172.25.254.250/westos/mnt-o Username=guest
4. Auto mount on Boot
Method One:
Vim/etc/fstab
172.25.254.250/westos/mnt CIFS defaults,username=guest 0 0
Method Two:
Vim/etc/rc.d/rc.local
Mount//172.25.254.250/westos/mnt-o Username=guest
# #2. NFS Network File system Access # #
1. Installing Access sharing software
Yum Install Nfs-utils-y

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/44/wKioL1gsSFSjIuYEAAAdOOtrJeY031.png "style=" float: none; "title=" 1.PNG "alt=" Wkiol1gssfsjiuyeaaadootrjey031.png "/>

2. Identify shares
SHOWMOUNT-E 172.25.254.250

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8A/48/wKiom1gsSFTQ8a_sAAB8KgYnLqg371.png "style=" float: none; "title=" 2.PNG "alt=" Wkiom1gssftq8a_saab8kgynlqg371.png "/>
3. Use shared
Mount 172.25.254.250:/nfsshare/nfs1/mnt

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8A/44/wKioL1gsSFWi1u-vAAAmkl7ieH0132.png "style=" float: none; "title=" 3.PNG "alt=" Wkiol1gssfwi1u-vaaamkl7ieh0132.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/48/wKiom1gsSFaTy3zZAADeKWI1NPY986.png "style=" float: none; "title=" 4.PNG "alt=" Wkiom1gssfaty3zzaadekwi1npy986.png "/>
4. Auto Mount
Method One:
Vim/etc/fstab
172.25.254.250:/nfsshare/nfs1/mnt NFS Defaults 0 0

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8A/45/wKioL1gsSMyR4-gjAAAqNdYORL8849.png "title=" 2.PNG " Style= "Float:none;" alt= "Wkiol1gssmyr4-gjaaaqndyorl8849.png"/>650) this.width=650; src= http://s2.51cto.com/ Wyfs02/m01/8a/48/wkiom1gssmzxrak9aaal9bfeqfy109.png "style=" Float:none; "title=" 1.PNG "alt=" Wkiom1gssmzxrak9aaal9bfeqfy109.png "/>

Method Two:
Vim/etc/rc.d/rc.local
Mount 172.25.254.250:/nfsshare/nfs1/mnt
Save after exiting execution:
chmod 755/etc/rc.d/rc.local

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/45/wKioL1gsSOGTNLOGAAA4IWO_fW8955.png "title=" 4.PNG " Style= "Float:none;" alt= "Wkiol1gssogtnlogaaa4iwo_fw8955.png"/>650) this.width=650; src= http://s5.51cto.com/ Wyfs02/m01/8a/48/wkiom1gssoddtgcqaaadc0f26tm907.png "style=" Float:none; "title=" 3.PNG "alt=" Wkiom1gssoddtgcqaaadc0f26tm907.png "/>


# # #3, AutoFS Auto Mount Service # #
1. Service function
default when using Mount Mount share when not using shares is also in Mount State
wasting Shared services resources
AutoFS can be automatically mounted when used and automatically unloaded when idle
2. Installation Services
Yum Install autofs-y
systemctl start AutoFS650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8A/48/wKiom1gsSlrwTsCSAAAcP6_bLdM949.png "style=" float: none; "title=" 1.PNG "alt=" Wkiom1gsslrwtscsaaacp6_bldm949.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8A/45/wKioL1gsSlugFuDBAAAeYlyjHyU533.png "style=" float: none; "title=" 2.PNG "alt=" Wkiol1gsslugfudbaaaeylyjhyu533.png "/>
3. Access
Cd/net/172.25.254.250/nfsshare/nfs1

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8A/45/wKioL1gsSzSB6cdSAAAjIUa6Iho530.png "style=" float: none; "title=" 1.PNG "alt=" Wkiol1gsszsb6cdsaaajiua6iho530.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8A/45/wKioL1gsSzXiyVL8AAAQNyhHI9Q303.png "style=" float: none; "title=" 2.PNG "alt=" Wkiol1gsszxiyvl8aaaqnyhhi9q303.png "/>

4. Set the Unload time
Vim/etc/autofs.conf
timeout = 3 # #闲置3秒后系统自动卸载网络设备650) this.width=650; "Src=" http://s5.51cto.com/wyfs02/M01/8A/48/ Wkiom1gsszwigth-aaaaypbrx3s841.png "style=" Float:none; "title=" 3.PNG "alt=" wkiom1gsszwigth-aaaaypbrx3s841.png "/ >

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/48/wKiom1gsSlyDDtuMAAAJwPdrK58597.png "style=" float: none; "title=" 4.PNG "alt=" Wkiom1gsslyddtumaaajwpdrk58597.png "/>
Effective after restarting service

Test:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8A/45/wKioL1gsSl3inTIPAAEh3Job7yQ828.png "title=" 5.PNG " Style= "Float:none;" alt= "Wkiol1gssl3intipaaeh3job7yq828.png"/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8A/48/wKiom1gsSl6RWX21AAC2gS9KXMs253.png "style=" float: none; "title=" 6.PNG "alt=" Wkiom1gssl6rwx21aac2gs9kxms253.png "/>
5. Implementing a custom shared mount point
Vim/etc/auto.master

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8A/45/wKioL1gsS92QRKtMAAAbD5eGfvM657.png "style=" float: none; "title=" 1.PNG "alt=" Wkiol1gss92qrktmaaabd5egfvm657.png "/>

Final custom mount point Upper directory sub-configuration file
/mnt/etc/auto.nfs

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/45/wKioL1gsS4awhVqYAAAOVmV9jhs052.png "title=" 7.PNG " Style= "Float:none;" alt= "Wkiol1gss4awhvqyaaaovmv9jhs052.png"/>
Systemctl Restart Auto

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8A/48/wKiom1gsS96BthXgAAAofl7Oc7o525.png "style=" float: none; "title=" 2.PNG "alt=" Wkiom1gss96bthxgaaaofl7oc7o525.png "/>
Vim/etc/auto.nfs

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8A/45/wKioL1gsS4ijjK_JAAAk7gu69T4582.png "style=" float: none; "title=" 11.PNG "alt=" Wkiol1gss4ijjk_jaaak7gu69t4582.png "/>
Pub1 172.25.254.250:/NFSSHARE/NFS1

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/45/wKioL1gsS4fDtc_3AAAX2cVQskA856.png "style=" float: none; "title=" 9.PNG "alt=" Wkiol1gss4fdtc_3aaax2cvqska856.png "/>
* 172.25.254.250:/nfsshare/&//Specify any shared mount

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8A/48/wKiom1gsS4eSq3XcAAAVR9biLJY532.png "title=" 10.PNG "Style=" Float:none; "alt=" Wkiom1gss4esq3xcaaavr9biljy532.png "/>

Test:


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8A/48/wKiom1gsS4mDIZ5dAABy2qyxSkE037.png "style=" float: none; "title=" 12.PNG "alt=" Wkiom1gss4mdiz5daaby2qyxske037.png "/>


Linux note 2-7 access to the network file system

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.