Differences
This shows you the differences between two versions of the page.
linux_wiki:auto_mount_network_shares [2016/01/04 23:12] billdozor [Install Required Packages] |
linux_wiki:auto_mount_network_shares [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Auto Mount Network Shares ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Automatically mounting network shares with autofs. This is the client configuration and assumes a working server setup with NFS or CIFS shares already. | ||
- | |||
- | **Checklist** | ||
- | * Enterprise Linux 6/7 | ||
- | * Network server with shared directory (NFS or CIFS) | ||
- | |||
- | ---- | ||
- | |||
- | ====== Install Required Packages ====== | ||
- | |||
- | **Pre-reqs: | ||
- | * Install required client package(s) depending upon if you are mounting NFS or CIFS shares. | ||
- | * Samba Client (for CIFS shares)< | ||
- | * NFS Client< | ||
- | * Also assuming that all client/ | ||
- | * NFS Shares | ||
- | * [[linux_wiki: | ||
- | \\ | ||
- | |||
- | Install autofs | ||
- | <code bash> | ||
- | yum install autofs | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Autofs Config ====== | ||
- | |||
- | ===== Map Files ===== | ||
- | |||
- | / | ||
- | * First column = name of the mount point on the local client system | ||
- | * Second column = config file that controls its mounting | ||
- | * Third column (optional) = default mount options for all mounts defined in config file | ||
- | |||
- | Example | ||
- | <code bash> | ||
- | # File: / | ||
- | |||
- | /home / | ||
- | /- / | ||
- | </ | ||
- | |||
- | * Direct Maps => Network file systems that are mounted from different servers or that don't all start with the same file system path on the same server. | ||
- | * Above example: /- / | ||
- | * Indirect Maps => Directories on the remote server that can all be mounted under the same local mount point. | ||
- | * Above example: /home / | ||
- | |||
- | ---- | ||
- | |||
- | ==== Direct Map Example ==== | ||
- | |||
- | **Note:** All direct map entries must be defined as "/ | ||
- | |||
- | <code bash> | ||
- | # File: / | ||
- | |||
- | / | ||
- | / | ||
- | / | ||
- | </ | ||
- | * First column => local mount point | ||
- | * Second column => mount options | ||
- | * Third column => remote shared directory | ||
- | |||
- | ---- | ||
- | |||
- | ==== Indirect Map Example ==== | ||
- | |||
- | **Note:** This example works best when implemented using LDAP authentication to ensure that user id's are matched up between NFS server and clients. | ||
- | |||
- | Naming local and remote directories | ||
- | <code bash> | ||
- | # File: / | ||
- | |||
- | yoda 192.168.1.151:/ | ||
- | luke 192.168.1.151:/ | ||
- | vader | ||
- | </ | ||
- | \\ | ||
- | |||
- | Naming local only (Ampersand Wildcard) | ||
- | <code bash> | ||
- | yoda 192.168.1.151:/ | ||
- | </ | ||
- | * The "&" | ||
- | \\ | ||
- | |||
- | All wild cards (Asterisk and Ampersand Wildcards) | ||
- | <code bash> | ||
- | * 192.168.1.151:/ | ||
- | </ | ||
- | * The "&" | ||
- | * " | ||
- | |||
- | ---- | ||
- | |||
- | ===== Start and Enable ===== | ||
- | |||
- | Start Auto Mounter | ||
- | * EL7<code bash> | ||
- | * EL6<code bash> | ||
- | |||
- | Enable Auto Mounter on boot | ||
- | * EL7<code bash> | ||
- | * EL6<code bash> | ||
- | |||
- | Reload Auto Mount Config (to enable changes) | ||
- | * EL7<code bash> | ||
- | * EL6<code bash> | ||
- | |||
- | ---- | ||