I want to understand what mounting is. It is used in different contexts and situations and I can’t find resources which:
- Describe the mount concept
- Explain the actions taken by the computer/OS/utility when a mount is performed
- How and in which situations mount is used
- Which features in the Linux mount command are of frequent use and some examples
( I hear mount applied to diverse entities directories, flash drives, network card, etc )
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
As fschnitt
points out, a comprehensive answer to this would likely be a chapter
in a systems administration manual, so I’ll try just to sketch the
basic concepts. Ask new questions if you need more detail on specific
points.
In UNIX, all files in the system are organized into a single
directory tree structure (as opposed to Windows, where you have a
separate directory tree for each drive).
There is a “root” directory, which is denoted by /, which
corresponds to the top directory on the main drive/partition (in the
Windows world, this would be C:). Any other directory and file in
the system can be reached from the root, by walking down
sub-directories.
How can you make other drives/partitions visible to the system in such
a unique tree structure? You mount them: mounting a drive/partition
on a directory (e.g., /media/usb) means that the top directory on
that drive/partition becomes visible as the directory being mounted.
Example: if I insert a USB stick in Windows I get a new drive, e.g.,
F:; if in Linux I mount it on directory /media/usb, then the
top directory on the USB stick (what I would see by opening the F:
drive in Windows) will be visible in Linux as directory /media/usb.
In this case, the /media/usb directory is called a “mount point”.
Now, drives/partitions/etc. are traditionally called “(block) devices”
in the UNIX world, so you always speak of mounting a device on a
directory. By abuse of language, you can just say “mount this device”
or “unmount that directory”.
I think I’ve only covered your point 1., but this could get you
started for more specific questions.
Further reading:
* http://ultra.pr.erau.edu/~jaffem/tutorial/file_system_basics.htm
Method 2
In Unix everything is a file.
These files are organized in a tree structure, beginning at the root /.
Your filesystem or filesystems will then be mounted at the appropriate places in your / according your /etc/fstab file. This file contains information about your filesystems, which device they belong to and to which point they will get mounted to – the mountpoint.
Thats the “mount concept”.
It is not limited to disks and other blockdevices, here are some examples involving mount:
- Mount a representation of your running kernel under /proc
- Mount a special log partition (other device, “logfriendly” filesystem) under /var/log
- Install different systems and mount just one home directory
- Mount remote directories for example via NFS to your system
- Mount a image of a cd to a specific directory
Method 3
I found this resource helpful: https://help.ubuntu.com/community/Mount
Data on a computer, as you may know, is stored in binary as a series of 1s and 0s. The way these are stored on a device and their structure is called the “filesystem”. In Linux devices are referenced in /dev. Data is not actually stored on a device so you cannot access this data by going into /dev, this is because it is stored inside the filesystem on the device so you need to access these filesystems somehow. Accessing such filesystems is called “mounting” them, and in Linux (like any UNIX system) you can mount filesystems into any directory, that is, make the files stored in that filesystem accessible when you go into a certain directory. These directories are called the “mount points” of a filesystem.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0