8.2. Creating the /etc/fstab file

In order for certain programs to be able to determine where certain partitions are supposed to be mounted by default, the /etc/fstab file is used. Create a new file /etc/fstab containing the following:

cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# location of filesystem        mount point     fs-type         options

/dev/*LFS-partition device*     /               *fs-type*       defaults 1 1
/dev/*swap-partition device*    swap            swap            defaults 0 0
proc                            /proc           proc            defaults 0 0

# End /etc/fstab
EOF

*LFS-partition device*, *swap-partition device* and *fs-type* have to be replaced with the appropriate values (/dev/hda2, /dev/hda5 and reiserfs for example).

When adding a reiserfs partition, the 1 1 at the end of the line should be replaced with 0 0.

For more information on the various fields which are in the fstab file, see man 5 fstab.

There are other lines which you may consider adding to your fstab file. One example is the line which you must have if you are using devpts:

devpts         /dev/pts        devpts   gid=4,mode=620  0 0

Another example is a line to use if you intend to use USB devices:

usbdevfs               /proc/bus/usb   usbdevfs defaults        0 0

Both of these options will only work if you have the relevant support compiled into your kernel.