Why do different partitions on the same disk not have the same mount point?

An SO User
% 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:

  1. All detected devices go in the /dev folder.
  2. /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.
  3. 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 ?

Kannan Mohan

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.

edited at
0

Comments

0 comments
Login to comment

Related

Why I have several mount point with the same name?

Kafka, will different partitions have the same offset number

Why do different methods of same object have the same `id`?

Why do these two pointers that should be the same point to different data?

Why do lists with the same data have different sizes?

Why do different strings have the same ID in Python?

Why do cells with the same date have different date serial numbers?

Why do different Django Models with JSONFields have the same values?

Why do .ftl file are exactly same have different file size?

Why do interfaces and aliases of the same shape have different results?

How to mount devices with different UUID that are not present at the same time at the same mount point?

Why do Kafka partitions of the same topic contain different controller_epoch?

Can 2 partitions of the same table have different indexes in PostgrSQL?

Two nfs exports from different servers mounted on the same mount point

Why physical disk connected to the same HBA port may have different paths?

Do I have to mount new partitions in /mnt

Why is the size of a folder different when copied to a different location on the same disk?

Why do Disk utility and Gparted show different information for the same hdd(s)?

Exact files (Copied) have a different size on disk on the same drive?

Same files have different "size on disk" on new drive

ZFS mirror with two partitions on the same disk, safe?

My C drive is full, but on the same hard disk I have 2 other partitions with gigs of space

Buttons that have different scripts but do the same thing

Why do two floating-point results differ when they nominally have the same value?

Why do python variables of same value point to the same memory address?

Do different distros (but same kernel ver) have same hardware support

How to mount multiple folders to same hard disk?

Is it possible to have the same array of pointers to struct point to different types of struct?

Why are the read test results so different even with the same disk