Mount

Share on Facebook Share on Twitter Email
Top

The Unix command line utility mount instructs the operating system that a file system is ready to use, and associates it with a particular point in the system's file system hierarchy (its mount point). The 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 the corresponding fine-grained privilege, unless the file system is defined as "user mountable" in the /etc/fstab file (which can only be modified by the root user).

Main Highlights:

  1. Before a file can be accessed, the file system containing the file must be mounted.
  2. Mounting makes file systems, files, directories, devices and special files available for use at a particular location.
  3. A mount point is a directory or file at which a new file system, directory, or file is made accessible.
  4. This can be done using system call mount or the function mount_root( ).The mount_root( ) function takes care of mounting the first file system(root file system).
  5. It is called by system call setup.
  6. Every mounted system is represented by super_block structure held in static table super_blocks[] (maximum number  NR_SUPER) .
  7. The superblock is initialized by the function read_super( ) in the VFS.
  8. CD-ROM or Floppy is checked for changed media and checks for presence of super block. If present, returned otherwise a new superblock is created.
Contents

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

To mount an ISO file (Linux):

$ mount -o loop ~/disks/dvd-image.iso /media/dvd

To mount all filesystems listed in fstab:

$ mount -a

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 confines the amount of code that runs 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 them to pmount.

To configure, the administrator would add a list of devices to /etc/pmount.allow that non-root users can mount:

echo /media/cdrom >> /etc/pmount.allow &&
echo /media/dvd >> /etc/pmount.allow &&
echo /media/thumbdrive >> /etc/pmount.allow

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). 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]

See also

References

External links


Post a question - any question - to the WikiAnswers community:

Copyrights:

Mentioned in

Mt. (abbreviation)
Mound (family name)