Contents
What do I need to know about fstab?
/etc/fstab contains information about the disks. It has the details about where the partitions and storage devices should be mounted. We usually configure automount, disk quota, mount points etc in this fstab. The above command will mount all the filesystems mentioned in the fstab.
What is the second field in fstab file?
In each fstab entry, the second field specifies the mountpoint for the filesystem: what directory in the system should be used to access its content. This should be always provided except if the block device we are referencing it’s used as swap.
When to use CIFs as a fstab field?
In case of a remote filesystem we can use, for example cifs as the value of this field if the filesystem is shared via samba or nfs if it is shared via the Network File System. In the case of our example, we know the sdb1 device is formatted with the ext4 filesystem, therefore our fstab entry becomes:
What does mount point mean in fstab file?
Device: usually the given name or UUID of the mounted device (sda1/sda2/etc). Mount Point: designates the directory where the device is/will be mounted. File System Type: nothing trick here, shows the type of filesystem in use. Options: lists any active mount options. If using multiple options they must be separated by commas.
Where do files written to mount point go?
All files written to the mount point directory end up on the file system mounted there. To unmount a file system, the umount command expects the mount point as an argument.
How to get the complete and exact list of mounted files?
The definitive list of mounted filesystems is in /proc/mounts. If you have any form of containers on your system, /proc/mounts only lists the filesystems that are in your present container. For example, in a chroot, /proc/mounts lists only the filesystems whose mount point is within the chroot.
What happens if the mount point directory is not empty?
Note: If the directory acting as mount point is not empty, the files that exists in that directory are not accessible as long as a file system is mounted there. All files written to the mount point directory end up on the file system mounted there.