mount (Unix)
Before a user can access a file on a Unix machine, the file system that contains it needs to be mounted with the mount command. In practice mount is most often used for USB and other removable storage devices, as the root system stays mounted. But the Unix file system is a software construct that need not correspond to a physical device.
The Unix command line instruction mount tells 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). Mounting makes file systems, files, directories, devices and special files available for use and available to the user. 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.
Its counterpart umount instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible. The mount and umount commands require root user privilege or, alternately, specific privileges to perform the corresponding action, previously granted by the root user. The file system can also be defined as user mountable in the /etc/fstab file. This too can only be done by the root user.
Every filesystem mounted on a given machine is represented by a super_block structure held in the static table super_blocks[] (maximum number NR_SUPER). The superblock is initialized by the function read_super( ) in the virtual file system.
Contents |
[edit] Use
The second partition of a hard disk is mounted with the command:
$ mount /dev/hda2 /new/subdir
and unmounted with the command:
$ umount /dev/hda2
or
$ umount /new/subdir
To list all mounted file systems:
$ mount
To remount a partition with specific options:
$ mount -o remount,rw /dev/hda2
[edit] 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 code running as 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.[1]
[edit] See also
[edit] References
[edit] External links
- – Linux Administration and Privileged Commands Manual
- – Linux User Commands Manual
- – Linux User Commands Manual
|
||||||||||||||||||||||||||||||||
|
||||||||||||||