Table of Contents
This objective covers most points seen in LPI 101. Configuring automount is a new feature where special attention has to be paid to the syntax.
When adding new filesystems to the existing root filesystem the key file
involved is /etc/fstab which assigns a mount point,
a mount order and global options per device.
Table 3.1. /etc/fstab options
ro or
rw | Read only or read write |
noauto | Do not respond to mount -a.
Used for external devices CDROMs ... |
noexec | Executables cannot be started from the device |
nosuid | Ignore SUID bit throughout the filesystem |
nodev | Special device files such as block or character devices are ignored |
noatime | Do not update atimes (performance gain) |
owner | The device can be mounted only by it's owner |
user | Implies noexec,
nosuid and
nodev. A single user's name is
added to mtab so that other users may not
unmount the devices |
users | Same as user but the device
may be unmounted by any other user |
mount will also keep track of mounted operations by
updating /etc/mtab.
The content of this file is similar to another table held by the kernel in
/proc/mounts.
When the system boots all local filesytems are mounted from the
rc.sysinit script. The mount
command will mount every thing in /etc/fstab that has
not yet been mounted and that is not encrypted or networked:
mount -a -t nonfs,smbfs,ncpfs -o no_netdev,noloop,noencrypted
When shutting down, all filesystem are unmounted by the
halt script by scanning the
/proc/mounts file with the help of some
awk commands!
At boot time, swap partitions are activated in
/etc/rc.d/rc.sysinit
swapon -a
Similarly when the system shuts down swap is turned off in the halt rc-script:
SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`
[ -n "$SWAPS" ] "" runcmd "Turning off swap: " swapoff $SWAPS
Example 3.2. Making a swap partition of 16MB
Make a new partition (e.g /dev/hda16) of
type swap (82) and size 16MB. Reboot.
Make a swap filesystem on the devices
mkswap /dev/hda16
Add the following to /etc/fstab
/dev/hda16 swap swap pri=-1 0 0
Make the swap partition available with
swapon -a
Notice that if two swap partition are defined the kernel will
automatically access them in stripedmode, provided they have been mounted
with the same priority determined by the pri=
option in /etc/fstab