8.2. Creating the /etc/fstab file

The /etc/fstab file is used by some programs to determine where partitions are to be mounted by default, which file systems must be checked and in which order. Create a new file systems table like this:

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

# filesystem  mount-point  fs-type  options         dump  fsck-order

/dev/xxx      /            fff      defaults        1     1
/dev/yyy      swap         swap     pri=1           0     0
proc          /proc        proc     defaults        0     0
devpts        /dev/pts     devpts   gid=4,mode=620  0     0
shm           /dev/shm     tmpfs    defaults        0     0

# End /etc/fstab
EOF

Of course, replace xxx, yyy and fff with the values appropriate for your system -- for example hda2, hda5 and reiserfs. For all the details on the six fields in this table, see man 5 fstab.

When using a reiserfs partition, the 1 1 at the end of the line should be replaced with 0 0, as such a partition does not need to be dumped or checked

The /dev/shm mount point for tmpfs is included to allow enabling POSIX shared memory. Your kernel must have the required support built into it for this to work -- more about this in the next section. Please note that currently very little software actually uses POSIX shared memory. Therefore you can consider the /dev/shm mount point optional. For more information, see Documentation/filesystems/tmpfs.txt in the kernel source tree.

There are other lines which you may consider adding to your fstab file. One example is a line to use if you intend to use USB devices:

usbfs       /proc/bus/usb  usbfs    defaults    0     0

This option will of course only work if you have the relevant support compiled into your kernel.

Hosting by: Hurra Communications Ltd.
Generated: 2007-01-26 17:57:39