Swap and autofs
Sign in to read this lesson
Two RHCSA topics — adding swap (a partition, LV or file) and mounting network directories automatically only when needed with autofs. The second is especially important — users' home directories on NFS are attached exactly this way.
What you will learn
- Creating swap:
mkswap /dev/sdb3, activating itswapon, permanently — fstab:UUID=... none swap defaults 0 0. - Checking:
swapon --show,free -h; swap can also be created on LVM (lvcreate+mkswap) or in a file. - autofs mounts a directory automatically when it is accessed and unmounts it when unused.
- Master map
/etc/auto.master.d/*.autofs:/shares /etc/auto.shares; the map file:docs -rw,sync srv-db01:/srv/docs. - Home directories with a wildcard:
* -rw srv-db01:/home/&— each user's directory is attached on demand.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.