mount -- mount file systems for
mount [ -dvfurw] special-device | remote-node
mount [-adfruvw] [-t ufs | lfs | external_type]
mount [ -dfruvw] [-o options] [-t ufs | lfs | external_type] special-device point-node
Make then file system on the
special-device or remote-node (rhost:path)
available on the file system tree at the point node.
special-device is frequently a hard disk partition like /dev/hda1
To determine the partitions use
ls -1 /dev | grep "[hs]d" or
cat /proc/diskstats | grep "[hs]d"
The point-node is an existing directory.
If the directory contains files they will be hidden (unless union is specified)
If either special-device or remote-node are not provided, information is taken from fstab .
If no arguments are given the list of mounted filesystems is displayed.
/dev/disk0s3 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
/dev/disk0s14 on /Volumes/IMAGES (asynchronous, local)
/dev/disk0s5 on /Volumes/DATA (local, journaled)
/dev/disk0s7 on /Volumes/PHOTOS (local, journaled)
/dev/disk0s10 on /Volumes/BACKUPS (local, journaled)
automount -nsl [151] on /Network (automounted)
automount -fstab [181] on /automount/Servers (automounted)
automount -static [181] on /automount/static (automounted)
//RDOMAIN;DGERMAN@SAMME/INTERVOL on /Volumes/intervol (nodev, nosuid, mounted by dgerman)
-v | verbose
| -w read / write.
| -r read-only. (even the super-user may not write it). same as -o rdonly .
-f | Forces downgrade from read-write to read-only.
| -u update the status of an already mounted file system ,
-o options may 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 -f is also specified.
The set of options is determined by
- extracting the options for the file system from
/etc/fstab ,
- applying any options specified by
-o , and
- applying
-r or -w .
Options specific to NFS filesystems are described in nfs .
| -o | Other options followed by a comma separated string of options.
update an already mounted file system.Same as -u
rdonly read-only . Same as -r
force force read-write to read-only.same as -f
async | All I/O to the file system should be done asynchronously. Default.
| noasync| do not force all I/O to be written asynchronously.
| sync | All I/O to the file system should be done synchronously.
| noauto skipped when mount is run with -a .
| noexec | Do not allow execution of binaries on the
file system. Used when has file systems contains executables for foriegn architectures, as may be the case with NetworkFileSystem mounts.
| nosuid Ignore set-user-identifier or set-group-identifier bits
| union namespace at the mount point is the union of the mounted filesystem root and the existing directory, i.e. previously existing files are not hidden.
Lookups will be done in the mounted filesystem first.
If those operations fail due to a non-existent file the underlying directory is then accessed.
Creates are done in the mounted filesystem.
| nodev | Do not interpret character or block special devices on the file system.
useful that has file systems like NetworkFileSystems
| [no]atime | update access time
|
Additional options, specific to a filesystem type not one of the internally known types (see -t ) , are passed as a comma separated list; these options are distinguished
by a leading - (dash).
Options that take a value are specified using the syntax -option=value. For example, the mount command:
mount -t hfs -o nosuid,-m=755 /dev/disk2s9 /reference
causes mount to execute the equivalent of:
/sbin/mount_hfs -o nosuid -m 755 /dev/disk2s9 /reference
| | | | | | | | | | | | | | |
| -t types |
Restricts actions to filesystems of types only.
Default: ufs
(mount determines the actual type of a file system as it mounts it.)
More than one type may be specified in a comma separated list.
The list of filesystem types can be prefixed with no to specify the
filesystem types for which action should not be taken.
mount -a -t nonfs,hfs
mounts all filesystems except those of type nfs and hfs.
If mount complains:"you must specify the filesystem type" be sure you have specified a disk partition and not a disk.
cifs cd9660 efs ext ext2 ext3 hfs ntfs reiserfs msdos nfs† smbfs synthfs udf volfs webdav vfat usbfs afp
If the type is not one of the internally known types, an
attempt is made to execute /sbin/mount_XX .
For example, nfs filesystems are mounted by the program /sbin/mount_nfs.
| -a All filesystems in /etc/fstab are mounted, except those marked noauto or are excluded by -t .
Usually done at startup.
| -d Debug. Parsing etc is done, the system call is not done, so the mount doesn't happen.
Used with -v to determine what the command is trying to do.
| | | | | | | | | |
example:
sudo mkdir /c
sudo mount /dev/hda1 /c
ls -l /c
-rwxr-xr-x 1 root root 0 2004-06-27 11:52 autoexec.bat
-rwxr-xr-x 1 root root 760 2004-06-27 11:52 boot.ini
-rwxr-xr-x 1 root root 54619 2004-06-27 11:52 command.com
-rwxr-xr-x 1 root root 0 2004-06-27 11:52 config.sys
-rwxr-xr-x 1 root root 34724 2004-06-27 11:52 ntdect.com
-rwxr-xr-x 1 root root 214432 2004-06-27 11:52 ntldr
drwxr-xr-x 8 root root 4096 2004-06-27 11:52 Program Files
drwxr-xr-x 9 root root 4096 2004-06-27 11:52 winnt
Normally, /usr is not written to unless system updates are being made, have this mounted read-only by default, and then remount it as writable before performing system updates.
FILES
/etc/fstab file system table
SEE mount(2), fstab, mount_afp, mount_cd9660, mount_cddafs, mount_devfs, mount_fdesc, mount_hfs, mount_msdos, nfs, mount_smbfs, mount_synthfs, mount_udf, mount_volfs, mount_webdav, umount
BSD System Manager's Manual MOUNT(8) 4th Berkeley Distribution June 16, 1994 1G