HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, mount is a
command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
in various
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s. Before a user can access a file on a
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
machine, the
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
on the device which contains the file needs to be
mounted Mount is often used as part of the name of specific mountains, e.g. Mount Everest. Mount or Mounts may also refer to: Places * Mount, Cornwall, a village in Warleggan parish, England * Mount, Perranzabuloe, a hamlet in Perranzabuloe parish, Co ...
with the mount command. Frequently mount is used for
SD card Secure Digital, officially abbreviated as SD, is a proprietary non-volatile flash memory card format developed by the SD Association (SDA) for use in portable devices. The standard was introduced in August 1999 by joint efforts between SanDis ...
,
USB storage The USB mass storage device class (also known as USB MSC or UMS) is a set of computing communications protocols, specifically a USB Device Class, defined by the USB Implementers Forum that makes a USB device accessible to a host computing device ...
, DVD and other removable storage devices. The command is also available in the EFI shell.


Overview

The mount command instructs the
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
that a
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
is ready to use, and associates it with a particular point in the overall file system hierarchy (its ''mount point'') and sets options relating to its access. Mounting makes file systems, files, directories, devices and special files available for use and available to the user. Its counterpart umount instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible and may be removed from the computer. It is important to umount a device before removing it since changes to files may have only partially been written and are completed as part of the umount. The mount and umount commands require
root user In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of th ...
privilege to effect changes. Alternately, specific privileges to perform the corresponding action may have been previously granted by the root user. A file system can be defined as user mountable in the /etc/
fstab fstab (after ''file systems table'') is a system file commonly found in the directory /etc on Unix and Unix-like computer systems. In Linux, it is part of the util-linux package. The fstab file typically lists all available disk partitions and o ...
file by the root user.


Examples

To display all mounted partitions: $ mount proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) /tmp on /var/tmp type none (rw,noexec,nosuid,bind) 10.4.0.4:/srv/export/setup_server on /nfs/setup_server type nfs (ro,addr=10.4.0.4) To mount the second partition of a
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with mag ...
to the existing directory ''/media/PHOTOS'' (mount point): $ mount /dev/hda2 /media/PHOTOS To unmount by referring to the physical disk partition: $ umount /dev/hda2 To unmount by referring to the mount point: $ umount /media/PHOTOS To remount a partition with specific
options Option or Options may refer to: Computing *Option key, a key on Apple computer keyboards *Option type, a polymorphic data type in programming languages *Command-line option, an optional parameter to a command *OPTIONS, an HTTP request method ...
: $ mount -o remount,rw /dev/hda2


Bind mounting

Bind mounting allows a filesystem hierarchy or a file to be mounted at a different mount point. Unlike a
symbolic link In computing, a symbolic link (also symlink or soft link) is a file whose purpose is to point to a file or directory (called the "target") by specifying a path thereto. Symbolic links are supported by POSIX and by most Unix-like operating syste ...
, a bind mount does not exist on the filesystem itself. In the following example, the path /olddir will be mounted in /newdir $ mount --bind /olddir /newdir


Mounting loop devices

A
loop device In Unix-like operating systems, a loop device, vnd (vnode disk), or lofi (loop file interface) is a pseudo-device that makes a computer file accessible as a block device. Before use, a loop device must be connected to an extant file in the file ...
is a device that corresponds to a file, usually a
disk image A disk image, in computing, is a computer file containing the contents and structure of a disk volume or of an entire data storage device, such as a hard disk drive, tape drive, floppy disk, optical disc, or USB flash drive. A disk image i ...
. Mounting a loop device allows the file to be accessed as a filesystem. This allows it to be used as a virtual drive. For example, a virtual disk image can be mounted as a regular filesystem. $ mount -o loop my_virtual_disk.img /mnt


Derivatives and wrappers

pmount is a wrapper around the standard mount program which permits normal users to mount removable devices without a matching /etc/
fstab fstab (after ''file systems table'') is a system file commonly found in the directory /etc on Unix and Unix-like computer systems. In Linux, it is part of the util-linux package. The fstab file typically lists all available disk partitions and o ...
entry. This provides a robust basis for automounting frameworks like GNOME's Utopia project and keeps the usage of root to a minimum. This package also contains a wrapper pmount-hal, which reads information such as device labels and mount options from
HAL HAL may refer to: Aviation * Halali Airport (IATA airport code: HAL) Halali, Oshikoto, Namibia * Hawaiian Airlines (ICAO airline code: HAL) * HAL Airport, Bangalore, India * Hindustan Aeronautics Limited an Indian aerospace manufacturer of figh ...
and passes it to pmount. The gnome-mount package contains programs for mounting, unmounting and ejecting storage devices. The goal for gnome-mount is for GNOME software such as gnome-volume-manager and GNOME-VFS to use this instead of invoking mount/umount/eject/pmount or direct HAL invoking methods. GNOME previously used pmount. Note, gnome-mount is not intended for direct use by users. All the gnome-mount programs utilize HAL methods and as such run unprivileged. The rationale for gnome-mount is to have a centralized place (in GConf) where settings such as mount options and mount locations are maintained. As with all unix-like commands, the options are specific to the version of mount and are precisely detailed in its
man page A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and e ...
. In addition to the system call mount, the function mount_root() mounts the first, or
root In vascular plants, the roots are the organs of a plant that are modified to provide anchorage for the plant and take in water and nutrients into the plant body, which allows plants to grow taller and faster. They are most often below the su ...
filesystem. In this context mount is called by the system call setup.


See also

*
Mount (computing) Mounting is a process by which a computer's operating system makes files and directories on a storage device (such as hard drive, CD-ROM, or network share) available for users to access via the computer's file system. In general, the process o ...
* mtab *
util-linux is a standard package distributed by the Linux Kernel Organization for use as part of the Linux operating system. A fork, (with meaning "next generation"), was created when development stalled, but has been renamed back to , and is the offi ...


References


External links

* * * * * {{Disk image emulators software Unix file system-related software