theshell.ch/site/pages/cmd/interm/mount.html
bevilj a6515acdb9 order pages for navigation
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@254 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-18 20:38:56 +00:00

71 lines
3.1 KiB
HTML

---
layout: page
category-page: intermediate
category-title: Intermediate commands
tags: mount drive umount storage device
author: Marco Farace
title: mount
previous-page: pages/cmd/interm/md5.html
next-page: pages/cmd/interm/neofetch.html
---
To access a file on a Unix-like machine, the file system that contains it
needs to be mounted with the <code>mount</code> command. Mount is frequently used for
movable storage devices such as SD cards, DVDs, etc...<br>
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.<br>
Its counterpart, umount, does exactly the opposite.<br>
Both mount and umount require root user persmissions.<br>
To display all mounted partitions just write <code>mount</code>.<br>
This command will mount the second partition of a HDD:<br>
<pre>
mount /dev/hda2 /media/PHOTOS
</pre>
and will unmount (by referring to the physical disk partition):<br>
<pre>
umount /dev/hda2
</pre>
or (by referring to the mount point):<br>
<pre>
umount /media/PHOTOS
</pre>
<h3>Flags</h3>
<ul>
<li>-d: Causes everything to be done except for the actual system call.
This option is useful in conjunction with the -v flag to determine
what the mount command is trying to do.</li>
<li>-v: Verbose mode. (Gives additional detail during the mount process)</li>
<li>-f: Forces the revocation of write access when trying to downgrade a
filesystem mount status from read-write to read-only.</li>
<li>-u: The -u flag indicates that the status of an already mounted file
system should be changed. Any of the options discussed above
(the -o option) may be changed; also a file system can be changed
from read-only to read-write or vice versa. An attempt to change
from read-write to read-only will fail if any files on the
filesystem are currently open for writing unless the -f flag is
also specified.</li>
<li>-w: Mount the file system read-write.</li>
<li>-o: Options are specified with a -o flag followed by a comma separated
string of options. The following options are available:
<ul>
<li>noexec: Do not allow execution of any binaries on the mounted file system.
This option is useful for a server that has file systems containing
binaries for architectures other than its own.</li>
<li>noowners: Ignore the ownership field for the entire volume. This causes all
objects to appear as owned by user ID 99 and group ID 99. User ID 99
is interpreted as the current effective user ID, while group ID 99 is
used directly and translates to ``unknown''.</li>
<li>nobrowse: This option indicates that the mount point should not be visible via
the GUI (It will not appear on the Desktop as a separate volume).</li>
</ul>
</li>
</ul>