The third column in /etc/fstab specifies the file system type of the device or partition. if it wouldn't, you'd have a hard time using your cool Linux system because all the programs you use are in / and you wouldn't be able to run them if / wasn't mounted! But how does the system know where you want to mount /dev/hda2 and /dev/hdb1? By looking at the /etc/fstab file of course. This is done automatically when your Linux system boots up. There are lines that look like this:Īs you've learned, these lines mean that /dev/hda2 will be mounted to / and /dev/hdb1 to /home. For example, have a look at the example fstab above. Some partitions and devices are also automatically mounted when your Linux system boots up. Just make sure the mount point is a directory that already exists on your system. You can freely change the default mount points listed in /etc/fstab if you're not satisfied with the defaults your distro has given you. If there is no entry for /dev/fd0 in my fstab when I issue the command above, mount gets very confused because it doesn't know where to mount the floppy. My floppy will be mounted in /media/floppy, because that's the default mount point specified in /etc/fstab. What does all this mean? If I type the following command: As you probably noticed when looking at the example fstab, I use SuSE's mount points as an example. Most distros create them under /mnt, but some (at least SuSE) under /media. Like you already learned from the Mounting tuXfile, most Linux distros create special directories for mount points. That is the directory where the device will be mounted if you don't specify any other mount point when mounting the device. The mount point specified for a device in /etc/fstab is its default mount point. They tell the mount command exactly the same things that you tell mount when you mount stuff manually: what is the device or partition, and what is the mount point. The first and second columns should be pretty straightforward. 1st and 2nd columns: Device and default mount point The first column contains the device name, the second one its mount point, third its file system type, fourth the mount options, fifth (a number) dump options, and sixth (another number) file system check options. What does all this gibberish mean? As you see, every line (or row) contains the information of one device or partition. dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0 dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0 Here's an example of the contents of /etc/fstab: But the basic structure of fstab is always the same. Of course everybody has a bit different /etc/fstab file because the partitions, devices and their properties are different on different systems.
So, in order to edit the file, you must either log in as root or use the su command to become root. However, note that you must have the root privileges before editing fstab. etc/fstab is just a plain text file, so you can open and edit it with any text editor you're familiar with. So, you can usually fix your mounting problems by editing your fstab file.
If you can't access your Windows partition from Linux, aren't able to mount your CD or write to your floppy as a normal user, or have problems with your CD-RW, you probably have a misconfigured /etc/fstab file. etc/fstab contains information of where your partitions and storage devices should be mounted and how.
The file is located under /etc, so the full path to this file is /etc/fstab. What is fstab and why it's usefulįstab is a configuration file that contains information of all the partitions and storage devices in your computer.
If you don't, I suggest reading the Mounting tuXfile before reading this one.
In this tuXfile I assume you already know how to mount file systems and partitions with the mount command. When you learn to understand the fstab file, you'll be able to edit its contents yourself, too. Learn what its contents mean and how it's used in conjunction with the mount command. There's a file called /etc/fstab in your Linux system. How to edit and understand /etc/fstab - 1.1 Author: Nana Långstedt Many other great articles can be found at Nana´s website,.