Physical Devices  «Prev  Next»
Lesson 9System configuration files
ObjectiveExamine the system configuration file to find where special device files are mounted.

System Configuration Files

Usually, the filesystem is assembled from its component parts when the system boots. The filesystem's structure is described in a system configuration file that tells where each special device file is to be mounted. This configuration file has a different name on the various versions of UNIX, and the format varies slightly, but it always contains the same basic information.

Special filename
  1. Special filename
  2. Mount-point
  3. Filesystem type
  4. Options
  5. Backup?
  6. Check?

Linux Machines

On Linux machines, the configuration file is called /etc/fstab. Click the View MouseOver button to see a simple /etc/fstab file. Seeing how to assemble a mount command from the information in a row of this file should be easy. In our example, the root partition is on /dev/hda1, and the /home directory resides on /dev/hda3. The swap space for the machine is on /dev/hda2. Notice that the /dev/fd0 device is configured as filesystem type msdos and has the noauto and user flags set. The noauto flag means that, although the floppy device is listed here, it must be mounted explicitly, rather than at boot time. The user flag, which is unique to Linux, means that any user, not just the superuser, can mount the floppy device.
The number in the backup column is used by the dump program to decide if a filesystem should be backed up (1 means yes, 0 means no). The number in the Check? column tells the system whether to run fsck to validate the filesystem at boot time. The root partition is always given number 1. Other filesystems to be checked get number 2.

HP-UX

On HP-UX machines, the configuration file is called /etc/checklist, but it is identical in format to the /etc/fstab file on Linux. On Solaris machines, the configuration file is called /etc/vfstab.

Solaris system configuration file

To illustrate similarities and differences, here is the corresponding file from a Solaris machine. Solaris calls the file /etc/vfstab.
/dev/dsk/c0t0d0s0   /dev/rdsk/c0t0d0s0 /         
ufs  1  no  -
/dev/dsk/c0t0d0s6   /dev/rdsk/c0t0d0s6 /usr      
ufs  1  no  -
/dev/dsk/c0t0d0s4   /dev/rdsk/c0t0d0s4 /var      
ufs  1  no  -
/dev/dsk/c0t0d0s7   /dev/rdsk/c0t0d0s7 /localopt 
ufs  2  yes –

The columns in this file list:
  1. The device special file to mount
  2. The device on which to run fsck (usually the corresponding raw device)
  3. The mount point
  4. The filesystem type
  5. A flag for fsck specifying the order in which the partition should be checked
  6. Whether to mount at boot time
  7. Any options to mount for this partition
Notice the similarities with the Linux /etc/fstab file.

AIX

AIX uses a different format. It stores information about filesystems in a file called /etc/filesystems. This file is organized in "stanzas" rather than lines.

AIX system configuration file

Here are two sample stanzas from /etc/filesystems on an AIX machine:
/home:
        dev       = /dev/hd1
        vol       = "/home"
        mount     = true
        check     = true
        free      = false
        vfs       = jfs
        log       = /dev/hd8
/usr:[
        dev       = /dev/hd2
        vfs       = jfs
        log       = /dev/hd8
        mount     = automatic
        check     = false
        type      = bootfs
        vol       = /usr
        free      = false

We can recognize much of the same information from the /etc/fstab file in this file. For example, note the mount point (/home), the device file (/dev/hd1), the filesystem type (jfs), the mount option (automatic means mount at boot time), and the check variable (used by fsck).

How the files work

Listing a filesystem in the configuration file (whatever its name on your system) has the following effects:
  1. The filesystem will be mounted at boot time (unless noauto is specified as an option).
  2. You may mount and unmount the partition without specifying both the device file and the mount point.
  3. For example, if /dev/hda1 is in /etc/fstab, then the command
mount /dev/hda1
will mount the partition in the correct place. The system will look up the right place in the fstab file (or its equivalent).
  1. The mount –a command will mount all the filesystems listed in the fstab file (or its equivalent). On Solaris, the mountall command serves the same purpose.

System Configuration Files - Exercise

Click this Exercise link below to mount a filesystem using the fstab file.
System Configuration Files - Exercise

vfstab File Solaris - Exercise Solaris:

Click this Exercise link below to examine the vfstab file.
vfstab File Solaris - Exercise
The dump utility backs up all the files within a filesystem. The dump utility has many options and arguments that allow you to back up parts of the filesystem selectively. On Solaris, the dump utility is called ufsdump. On AIX, the utility is called backup.