Understanding the /etc/fstab file
The /etc/fstab
file is a very critical file on your Linux system. As I mentioned in the last section, you can edit this file to call out additional volumes you would like automatically mount at boot time. However, the main purpose of this file is also to mount your main filesystem as well, so if you make a mistake while editing it, your server will not boot. Definitely be careful.
When your system boots, it looks at this file to determine where the root filesystem is. In addition, the location of your swap area is also read from this file and mounted at boot time as well. Your system will also read any other mount points listed in this file, one per line, and mounts them. Basically, just about any kind of storage you can think of can be added to this file and automatically mounted. Even network shares from Windows servers can be added here.
For an example, here is the content of /etc/fstab
on one of my servers:
# / was on /dev/sda1 during installation UUID...