Mount (Unix)

Short description: Unix command to mount a filesystem

mount

Original author(s)| Ken Thompson,
Dennis Ritchie
Developer(s)| AT&T Bell Laboratories
Initial release| November 3, 1971; 54 years ago (1971-11-03)
Operating system| Unix and Unix-like
Type| Command

In computing, `mount` is a command in various operating systems. Before a user can access a file on a Unix-like machine, the file system on the device[1] which contains the file needs to be mounted with the mount command. Frequently `mount` is used for SD card, USB storage, DVD and other removable storage devices. The command is also available in the EFI shell.[2]

## Contents

* 1 Overview
* 2 Examples
* 2.1 Bind mounting
* 2.2 Mounting loop devices
* 3 Derivatives and wrappers
* 4 See also
* 5 References
* 6 External links

## Overview

The `mount` command instructs the operating system that a file system 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 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` 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 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:

$ 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, a bind mount does not exist on the filesystem itself.[3] In the following example, the path `/olddir` will be mounted in `/newdir`

$ mount --bind /olddir /newdir

### Mounting loop devices

A loop device is a device that corresponds to a file, usually a disk image. 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 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 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.[4]

As with all unix-like commands, the options are specific to the version of mount and are precisely detailed in its man page.

In addition to the system call mount, the function mount_root() mounts the first, or root filesystem. In this context mount is called by the system call setup.

## See also

* Mount (computing)
* mtab
* util-linux

## References

1. ↑ "mount(8) - Linux manual page". https://man7.org/linux/man-pages/man8/mount.8.html.
2. ↑ "EFI Shells and Scripting". Intel. http://software.intel.com/en-us/articles/efi-shells-and-scripting/. Retrieved 2013-09-25.
3. ↑ "What is the difference between ln -s and mount --bind?". https://newbedev.com/what-is-the-difference-between-ln-s-and-mount-bind.
4. ↑ "gnome-mount-0.6". Archived from the original on June 5, 2008. https://web.archive.org/web/20080605160454/http://www.linuxfromscratch.org/blfs/view/svn/gnome/gnome-mount.html.

## External links

* `mount(1)` – Version 7 Unix Programmer's Manual
* `mount(8)` – Linux Administration and Privileged Commands Manual
* `mount(8)` – FreeBSD System Manager's Manual
* `pmount(1)` – Linux User Commands Manual
* `gnome-mount(1)` – Linux User Commands Manual

* v
* t
* e

Unix command-line interface programs and shell builtins

File system|

* cat
* chmod
* chown
* chgrp
* cksum
* cmp
* cp
* dd
* du
* df
* file
* fuser
* ln
* ls
* mkdir
* mv
* pax
* pwd
* rm
* rmdir
* split
* tee
* touch
* type
* umask

Processes|

* at
* bg
* crontab
* fg
* kill
* nice
* ps
* time

User environment|

* env
* exit
* logname
* mesg
* talk
* tput
* uname
* who
* write

Text processing|

* awk
* basename
* comm
* csplit
* cut
* diff
* dirname
* ed
* ex
* fold
* head
* iconv
* join
* m4
* more
* nl
* paste
* patch
* printf
* sed
* sort
* strings
* tail
* tr
* uniq
* vi
* wc
* xargs

Shell builtins|

* alias
* cd
* echo
* test
* unset
* wait

Searching|

* find
* grep

Documentation|

* man

Software development|

* ar
* ctags
* lex
* make
* nm
* strip
* yacc

Miscellaneous|

* bc
* cal
* expr
* lp
* od
* sleep
* true and false

* Categories
* Standard Unix programs
* Unix SUS2008 utilities
* List

* v
* t
* e

Virtual drive software

* Virtual disk image
* RAM disk
* Mount

Free software|

* AcetoneISO
* CDemu
* Furius ISO Mount
* K3b
* mount
* WinCDEmu

Proprietary software|

* Alcohol 120%
* Daemon Tools
* DiskImageMounter
* Disk Utility
* MagicISO
* Roxio Toast
* UltraISO
* Virtual CloneDrive
* VirtualDrive Pro

Comparison of disc image software

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Mount (Unix). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Mount_(Unix)&oldid=951281"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template