Use AutoFS on Ubuntu16.04

Source: Internet
Author: User

On Solaris, AutoFS is installed by default, and it is easy to access the remote shared directory through the/net/<nfs server>. But on Linux (for example, Fedora or Ubuntu), using AUTOFS requires you to install and configure it yourself. This article will take Ubuntu16.04 as the NFS client and briefly describe how to use AutoFS.

NFS Server:fedora    (IPv4 10.66.12.119) NFS Client:ubuntu 16.04 (IPv4 10.66.13.219)

P.S. NFS server is a physical machine, and the NFS client is a virtual machine.

1. Installing the AutoFS Package

sudo Install AutoFS

2. Configuration

2.1 Configure/etc/auto.master, add the following line

/nfs    /etc/auto.nfs

2.2 Creating/etc/auto.nfs

Ax    -fstype=nfs4    ax:/

Note: Ax is an alias for NFS server. Here, the IPV4 address for NFS server is 10.66.12.119. So, we add the following line in the/etc/hosts

10.66. 12.119    Ax

2.3 Modifying/etc/default/nfs-common

CP /etc/default/nfs-common/tmp/nfs-vi /etc/default/nfs-diff /tmp/ nfs-common/etc/default/nfs-common14c14,< need_gssd=---> #NEED_GSSD = NEED_IDMAPD =Yes> Need_gssd=no

3. Access

3.1 Restart AutoFS

sudo /etc/init.d/autofs restart[OK] restarting AutoFS (via Systemctl): Autofs.service.

3.2 Visit/nfs/ax

$Mount|grepnfs4$ CD /nfs/ Ax$ls-Ltotal8drwxr-xr-x5Root root4096Feb -  -: -HOMEDRWXR-xr-x ARoot root4096Nov5  the: *var$Mount|grepNfs4ax:/on/nfs/ax type NFS4 (rw,relatime,vers=4.0, rsize=1048576, wsize=1048576, namlen=255, hard,proto=tcp,timeo= -, retrans=2, sec=sys,clientaddr=10.66.13.219, local_lock=none,addr=10.66.12.119)

Resources

    • Autofs

Use AutoFS on Ubuntu16.04

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.