CINXE.COM
Mounting definition by The Linux Information Project
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns= "http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="belug1.css" /> <title>Mounting definition by The Linux Information Project</title></head> <body bgcolor="#ffffff"> <a href="index.html">LINFO</a> <br /><center><h1>Mounting Definition</h1></center><br /> <table width="100%"><tbody><tr><td width="10%"></td><td width="80%"> <br /> <p> <i>Mounting</i> is the attaching of an additional <a href="filesystem.html"><i>filesystem</i></a> to the <i>currently accessible filesystem</i> of a computer. </p> <p> A filesystem is a hierarchy of directories (also referred to as a <a href="directory_tree.html"><i>directory tree</i></a>) that is used to organize files on a computer or <a href="storage.html">storage</a> media (e.g., a CDROM or floppy disk). On computers running <a href="linuxdef.html">Linux</a> or other <a href="unix-like.html">Unix-like</a> <a href="operating_systems_list.html">operating systems</a>, the directories start with the <a href="root_directory.html"><i>root directory</i></a>, which is the directory that contains all other directories and files on the system and which is designated by a forward slash ( / ). The currently accessible filesystem is the filesystem that can be accessed on a computer at a given time. </p> <p> In order to gain access to files on a storage <i>device</i>, the user must first inform the operating system where in the directory tree to mount the device. A device in a mounting context can be a <a href="partition.html"><i>partition</i></a> (i.e., a logically independent section) on a hard disk drive (HDD), a CDROM, a floppy disk, a USB (universal serial bus) key drive, a tape drive, or any other external media. For example, to access the files on a CDROM, the user must inform the system to make the filesystem on the CDROM appear in some directory, typically <i>/mnt/cdrom</i> (which exists for this very purpose). </p> <p> The <a href="mount_point.html"><i>mount point</i></a> is the directory (usually an empty one) in the currently accessible filesystem to which a additional filesystem is mounted. It becomes the root directory of the added directory tree, and that tree becomes accessible from the directory to which it is mounted (i.e., its mount point). Any original contents of a directory that is used as a mount point become invisible and inaccessible while the filesystem is still mounted. </p> <p> The <a href="mnt.html"><i>/mnt</i></a> directory exists by default on all Unix-like systems. It, or usually its subdirectories (such as <i>/mnt/floppy</i> and <i>/mnt/usb</i>), are intended specifically for use as mount points for removable media such as CDROMs, USB key drives and floppy disks. </p> <p> On some operating systems, everything is mounted automatically by default so that users are never even aware that there is any such thing as mounting. Linux and other Unix-like systems can likewise be configured so that everything is mounted by default, as a major feature of such systems is that they are highly configurable. However, they are not usually set up this way, for both safety and security reasons. Moreover, only the <a href="root.html">root user</a> (i.e., administrative user) is generally permitted by default to mount devices and filesystems on such systems, likewise as safety and security measures. </p> <p> In the simplest case, such as on some personal computers, the entire filesystem on a computer running a Unix-like operating system resides on just a single partition, as is typical for Microsoft Windows systems. More commonly, it is spread across several partitions, possibly on different physical disks or even across a <a href="network.html">network</a>. Thus, for example, the system may have one partition for the root directory, a second for the <i>/usr</i> directory, a third for the <a href="home.html"><i>/home</i></a> directory and a fourth for use as <a href="swap_space.html"><i>swap space</i></a>. (Swap space is a part of HDD that is used for <a href="virtual_memory.html"><i>virtual memory</i></a>, which is the simulation of additional main <a href="memory.html">memory</a>). </p> <p> The only partition that can be accessed immediately after a computer <a href="boot.html"><i>boots</i></a> (i.e., starts up) is the <i>root partition</i>, which contains the root directory, and usually at least a few other directories as well. The other partitions must be attached to this root filesystem in order for an entire, multiple-partition filesystem to be accessible. Thus, about midway through the boot process, the operating system makes these non-root partitions accessible by mounting them on to specified directories in the root partition. </p> <p> Systems can be set up so that external storage devices can be mounted automatically upon insertion. This is convenient and is usually satisfactory for home computers. However, it can cause security problems, and thus it is usually not (or, at least, should not be) permitted for networked computers in businesses and other organizations. Rather, such devices must be mounted manually after insertion, and such manual mounting can only be performed by the root account. </p> <p> Mounting can often be performed manually by the root user by merely using the <i>mount</i> command followed by the name of the device to be mounted and its mounting destination (but in some cases it is also necessary to specify the type of filesystem). For example, to mount the eighth partition on the first HDD, which is designated by <i>/dev/hda8</i>, using a directory named <i>/dir8</i> as the mount point, the following could be used: </p> <blockquote> <p> <code>mount /dev/hda8 /dir8</code> </p> </blockquote> <p> Removing the connection between the mounted device and the rest of the filesystem is referred to as <i>unmounting</i>. It is performed by running the <i>umount</i> (with no letter <i>n</i> after the first <i>u</i>) command, likewise followed by the name of the device to be unmounted and its mount point. For example, to unmount the eighth partition from the root filesystem, the following would be used: </p> <blockquote> <p> <code>umount /dev/hda8 /dir8</code> </p> </blockquote> <p> A list of the devices that are currently mounted can be seen by viewing the <i>/etc/fstab</i> file. This <a href="plain_text.html">plain text</a> configuration file also shows the mount points and other information about the devices, and it is employed during the boot process to tell the system which partitions to automatically mount. It can be safely viewed by using the <a href="cat.html"><i>cat</i></a> command, i.e., </p> <blockquote> <p> <code>cat /etc/fstab</code> </p> </blockquote> <p><br /></p> <p><br /></p> <p><br /></p> <p><br /></p> <p><br /></p> <p class="copy">Created March 9, 2006.<br /> Copyright © 2006 The Linux Information Project. All Rights Reserved.</p> </td><td width="10%"></td></tr></tbody></table> </body></html>