Linux - Mounting File Systems (CDROM, NFS, SMB, ...)

1 - About

All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree. Conversely, the umount command will detach it again. In order to access any file system, it is first necessary to mount it. By mounting a file system, you direct Red Hat Linux to make:

available to the system. (To know more, see this article: Linux - Adding storage depends of LVM).

In order to mount any file system, two pieces of information must be specified:

  • A device file name representing the desired disk drive and partition or the logical volume
  • A directory under which the mounted file system will be made available (otherwise known as a mount point)

3 - How to

3.1 - Create a Mount Point

When you want to create a mount point to map a drive in Linux, a folder must be always created first.

mkdir /myMountFolder/MyMountPoint

When you create the directory with the root user, it will become a system-wide location.

3.2 - See What is Mounted

In addition to mounting and unmounting disk space, it is possible to see what is mounted. There are several different ways of doing this:

  • Viewing /etc/mtab
  • Viewing /proc/mounts
  • Issuing the df command

3.3 - Mount File Systems Automatically

3.4 - Unmount / umount

umount /mountPointDir/

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap