% cat /etc/fstab
/dev/sda1 / ext2 defaults 1 1
/dev/sda2 /usr/local ext2 defaults 1 1
/dev/sda4 /home ext2 defaults 1 1
/dev/sdb1 swap swap defaults 0 0
/dev/sdb3 /export ext2 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
/dev/fd0 /mnt ext2 defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 ro 0 0
This is a random example that I got from a website while trying to understand mounting of devices. Being someone from a Windows background, I have a hard time trying to understand the concept of mount points.
Here is my understanding, please correct me where wrong:
/dev
folder./sda1
is the first partition of the SCSI drive and is mounted on the root because legend has it that one drive has to be mounted on the root.swap
needs no mount point.What I don’t understand is why the other sda
partitions have different mount points. Shouldn't they all go to /mnt
?
To understand how unix filesystem is organized, you need to understand Filesystem hierarchy standard.
Generally to install a linux machine you need to have atleast 2 partitions /
and swap
. In case if you dont have process that dose lot of swapping the you can also omit swap
.
The /
is said to be the root of the filesystem and swap
is used for memory swapping. Other directories such as /boot
, /home
, /usr
, /var
, /tmp
, etc can be placed either in different partitions or along with partition where /
is placed.
One has to decide this layout based on his specific requirements. For example, A database server needs to have a huge /var
in a separate partition, /tmp
needs to be kept separately if the server/service writes too many temporary data, to avoid filling up /
partition. The choice of having different directories in different partition is based on the scenario and what kind of filesystem will suite their need.
/dev
is a mounted with a virtual filesystem called sysfs
. The /dev
directory contains all devices that are detected by the kernel. The files in /dev
are created and removed based on hardware removal/insertion and this is controlled by udev
daemon.
/mnt
is the space where temporary mounted filesystems are placed.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments