AIX 5L Configuring TCP/IP (Unit 13) – Automounter and NFS Commands

NFS – Network File Systems (How to share data on a network)
Automounter is part of NIS

Unit Objectives
———————–
Describe automatci mounting of file systems
Configure master map
Create automount map files
Execute NFS commands

Automounter Overview
———————————
Used for automatic and transparent mounting and unmounting of NFS File Systems
Based on AutoFS facility (kernel extention that listens for request)
Uses automounter map files to find the mount directories and mount arguments
Map can be text files or NIS maps
automount command
automound daemon
Client-side server

Automounter Benefits
——————————–
Reduces system administration of /etc/filesystems file particularly if NIS maps are used
No pre-mounting of directories not currently needed thus reducing possibility of client hang due to down server
Distributes client workload for NFS read-only file systems
Provides method for single-system image for clients

Master Map File
————————
/etc/auto_master (contains a list of directories that will be monitored)
-mount-point map-name [mount-options]

Example
# cat /etc/auto_master
/publishing /etc/auto.pub (parent directory being monitored and file with mount info)

Automount Map File
——————————–
Example – AutomountMapName file
# cat /etc/auto.pub

Local Subdirectory Server:Exported directory
————————— ————————————-
inventory sys3:/books
subscription sys4:/magazine
review sys9:/article

automount Command
——————————–
Create mount point
Example: # mkdir /publishing
Note: We must create the parent directory but not the subdirectories.

Execute automount command
– Loads autofs kernel extension (listens for activity under the parent directory)
– Read the master map
– Passes information from master map to autofs
– Starts automountd if not started already
– Terminates

Syntax /usr/sbin/automount -v -t -i
AutoFS maintains internal table

-i is the timeout interval (auto unmounts after timeout period expires)

Automounter Started
——————————–
# automount -v (-v means verbose, tells us what is happening)
automount /publishing/mounted

# mount (although not actually mounted it is displayed as listening to the directory)
/etc/auto.pub /publishing autofs date rw,ignore

Note: Although not actually mounted it is displayed as mounted because autofs is listening to the directory as if it was mounted.

Invoking the Remote Mount
—————————————–
$ cd /publishing/inventory
$ ls
heidi
moby
hamlet

Client (sys1)
/etc/auto.pub
/publishing/inventory

Server (sys3)
/books/heidi
/books/moby
/books/hamlet

Remote Mount Table Entry
—————————————
# mount (although not actually mounted it is displayed as listening to the directory)
node mounted mount over vfs date options
——— ——————- —————————— ——— ——– ————–
/etc/auto.pub /publishing autofs date rw,ignore
sys3 sys3:/books /publishing/inventory nfs date rw

NFS or RPC Commands
————————————
Command Descriptions Daemon
————— —————————————————– —————–
showmount Displays what clients have mounted rpc.mountd
rpcinfo Displays what portmap has listed portmap
on Remote command extecution rexd
rup Displays host uptime information rstatd
rusers Shows remote users rusersd
rwall Sends message to network users rwalld
spray Sends a stream of packets sprayd
nfsstat Displays status of NFS and RPC calls

/etc/inetd.conf
———————-
# vi /etc/inetd.conf (daemons started on demand)
Registers these RPC daemons to portmap daemon with information listed in this file. The portmap daemon dynamically launches these daemons on demand.

What a Server Is Exporting
—————————————-
# showmount -e sys4 (-e means to show those file systems that are exported)
export list for sys4:
/home/records -access=sys3, sys5
/budgets (everyone)

# showmount -a sys4 (-a means to show all of the currently mounted files systems)
sys3:/home/records
sys7:/budgets

Note: The showmount command talks to the showmount daemon.

rpcinfo (query the portmap daemon)
—————————————————-
# rpcinfo -p sys4
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 604 mountd

# rpcinfo -u sys4 nfs 2
program 100003 version 2 ready and waiting

# rpcinfo -b autofs 1 (broadcast requesting what systems run autofs)
9.19.98.4 sys4
9.19.98.5 sys5

Unit Summary
———————
Automatic mounting of file systems is performed using automount command, AutoFS facility, and automountd
The master map associates a directory with a map
Automount map files are used to locate mapping for directories
NFS has many subserver commands

Exercise 12 – Automounter and NFS Commands
———————————————————————–
Automounter is a client-side facility.

Server: sys3
mkdir /sys3books
mkdir /sys3articles
vi /sys3books/heidi
a sweet girl
save
vi /sys3articles/news
we are having an election
save

ls /sys3articles

smitty nfs
Network File Systems
Add a Directory to Export List
/sys3books
execute
/sys3articles
execute
/usr/samples
read-only
execute

exportfs

Client: sys2
vi /etc/auto_master
/publishing /etc/auto.pub
save
mkdir /publishing
vi /etc/auto.pub
inventory sys3:/sys3books
review sys3:/sys3articles
save
automount -v
lssrc -s automountd
lssrc -g autofs

su – team2
ls /publishing
cd /publishing
cd /inventory
ls
cat heidi
cd ..
cd review
ls
cat news

mount (displays the automounted file systems)

RPC Commands
cd
pwd
mount
mount sys3:/home/team2/sys3dir /home/mntpt
Talk to the port daemon
rpcinfo -p | more (defaults to talking to the current system)
hostname
cat /etc/hosts
su – root
hostname sys2
Ctrl-D
hostname

set -o vi
/rpc (recall last rpc command)

rpcinfo -p | more
rpcinfo -p sys3

Talk to the mountd daemon
showmount -e sys3 (displays exported file systems, not neccesarily mounted)
showmount -a sys3 (actually mounted file systems)

mount
rusers sys3
Not working because daemons not running

Server sys3
vi /etc/inetd.conf
/ruser
remove comment from rusersd
remove comment from rstatd
save

refresh -s inetd

Client sys2
rusers sys3
rup sys3

Cleanup
mount
unmount allr

Leave a Reply

Your email address will not be published. Required fields are marked *

*