Linux NFS Auto Mount AutoFS configuration

Source: Internet
Author: User

One, based on the Linux NFS file system automatic mount mode,

Two Linux servers in the pre-preparation environment:

    1. Prepare an NFS server side (System environment CENTOS6.5,IP address 192.168.100.100)

    2. Preparing the NFS client to mount the NFS server (System Environment CENTOS6.5,IP address 192.168.100.101)

Implement:

  1. Server-side installation NFS is now guaranteed to be properly accessed, and we can install it here with the Yum tool

    [email protected] ~]# Yum install nfs-utils rpcbind-y

  2. Share the/data/share/directory by modifying the NFS configuration

    [Email protected] ~]# Mkdir/data/share

    [Email protected] ~]# Vim/etc/exports
    ######### #shared data for BBS by Oldboy at 20160825
    #/data/share 192.168.100.0/24 (rw,sync,hide)
    /data/share 192.168.100.0/24 (Rw,sync,anonuid=555,anongid=555,all_squash)

  3. Check if NFS is working

    [Email protected] ~]# showmount-e 192.168.100.100
    Export list for 192.168.100.100:
    /data/share 192.168.100.0/24

  4. Client installs NFS client and AutoFS and initiates related services

    [email protected] ~]# Yum install rpcbind nfs-utils-y

    [email protected] ~]# Yum install autofs-y

    [[email protected] ~]#/etc/init.d/rpcbind start

    [[email protected] ~]#/etc/init.d/autofs start

  5. Configure Client Auto-mount (AUTOFS) NFS server-side shared directory

        /mnt    /etc/auto.misc  timeout=60#/mnt for Mount point   /etc/auto.misc for Mount action

[email protected] ~]# Vim/etc/auto.misc

# a Automounter map and it has the following format
# key [-mount-options-separated-by-comma] Location
# Details May is found in the AutoFS (5) manpage

Cd-fstype=iso9660,ro,nosuid,nodev:/dev/cdrom

# The following entries is samples to pique your imagination
#linux-ro,soft,intr Ftp.example.org:/pub/linux
#boot-fstype=ext2:/dev/hda1
#floppy-fstype=auto:/dev/fd0
#floppy-fstype=ext2:/dev/fd0
#e2floppy-fstype=ext2:/dev/fd0
#jaz-fstype=ext2:/DEV/SDC1
#removable-fstype=ext2:/DEV/HDD
Nfsdata-fstype=nfs 192.168.100.100:/data/share

6. Restart the AutoFS service and check that the auto mount file is active

[Email protected] ~]#/etc/init.d/autofs restart

[Email protected] ~]# Cd/mnt/nfsdata
[Email protected] nfsdata]# ls-l
Total 0
-rw-r--r--1 oldgirl oldgirl 0 00:14 Andy
-rw-r--r--1 oldgirl oldgirl 0 00:10 Oldboy
-rw-rw-r--1 oldgirl oldgirl 0 00:10 Oldgirl
[Email protected] nfsdata]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/vg_muban-moban_root 38G 1.9G 34G 6%/
Tmpfs 491M 0 491M 0%/dev/shm
/DEV/SDA1 194M 29M 155M 16%/boot
192.168.100.100:/data/share 38G 1.9G 34G 6%/mnt/nfsdata


Linux NFS Auto Mount AutoFS configuration

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.