The UNIX Mount Point

You have probably heard the term “mount-point” and wondered, or maybe not. You know it’s there, and files are in it, but you don’t know what it is? If this is the case then read this article…

I am assuming that you know what a file and/or a directory is, a directory is also called a folder. Well, a mount-point is simply the directory or file for which e device, normally a disk, either local or remote, is exposed to the system for interaction. Let’s take a common Linux system for example, this particular system is a CentOS, but it should not matter which system or UNIX type it is.

At the root “/” of your system we have the following files and directories:

lrwxrwxrwx    1 root root     7 Oct   6 09:26 bin -> usr/bin
dr-xr-xr-x.   6 root root  3072 Oct   6 09:37 boot
drwxr-xr-x   19 root root  3140 Oct   6 09:36 dev
drwxr-xr-x.  82 root root  4096 Oct   6 09:47 etc
drwxr-xr-x.   3 root root  4096 Nov   5  2016 home
lrwxrwxrwx    1 root root     7 Oct   6 09:26 lib -> usr/lib
lrwxrwxrwx    1 root root     9 Oct   6 09:26 lib64 -> usr/lib64
drwx------.   2 root root 16384 Apr  13  2015 lost+found
drwxr-xr-x.   3 root root  4096 Nov   5  2016 media
drwxr-xr-x.   2 root root  4096 Nov   5  2016 mnt
drwxr-xr-x.   3 root root  4096 Nov   5  2016 opt
dr-xr-xr-x  100 root root     0 Oct   6 09:36 proc
dr-xr-x---.   4 root root  4096 Oct   6 10:18 root
drwxr-xr-x   27 root root   780 Oct   6 10:18 run
lrwxrwxrwx    1 root root     8 Oct   6 09:26 sbin -> usr/sbin
drwxr-xr-x.   2 root root  4096 Nov   5  2016 srv
dr-xr-xr-x   13 root root     0 Oct   6 09:36 sys
drwxrwxrwt.  12 root root  4096 Oct   6 11:33 tmp
drwxr-xr-x.  13 root root  4096 Oct   6 09:26 usr
drwxr-xr-x.  21 root root  4096 Oct   6 09:45 var

If you wonder what I used to retrieve the list, simply type “ls -l /”. Now let’s type a different command, the “df -h” command, you should see something similar to the following:

Filesystem               Size Used Avail Use% Mounted on
/dev/mapper/vg-lv_root   18G  2.5G   14G  15% /
devtmpfs                486M     0  486M   0% /dev
tmpfs                   497M     0  497M   0% /dev/shm
tmpfs                   497M  6.8M  490M   2% /run
tmpfs                   497M     0  497M   0% /sys/fs/cgroup
/dev/sda1               477M  136M  313M  31% /boot
tmpfs                   100M     0  100M   0% /run/user/1000
/dev/mapper/vg-lv_opt    20G    1G   19G   5% /opt

Now, for simplicity, let’s concentrate on the first line “/” and the last line “/opt”. I have highlighted the 2 lines.

So, this tells us that device “/dev/mapper/vg-lv_root” is mounted on “/” (the root of the filesystem) and that device “/dev/mapper/vg-lv_opt” is mounted on “/opt”, this is a very common setup for a UNIX system.

“/” is 18G and “/opt” is 20G. So, all files residing in “/” and sub-directories with the exception on “/opt” will reside on deviceĀ “/dev/mapper/vg-lv_root” and all the files residing in “/opt” and sub-directories will reside on device “/dev/mapper/vg-lv_opt“.

This system is mainly used to segregate parts of systems so that they can be controlled and not interfere with each other. For example: if /opt fills up to 100% the system will continue to function because “/” is independent.

I hope this clears up mount-points and what/how/why they are used.

Always thanks for reading…

Leave a Reply