mount

establish a connection between a physical device and a directory (mount point)

linuxApple darwin/BSD
mount -a [-F][-fnrsvw] [-t fstype]
mount [-fnrsvw] [-o options] [-t fstype] device directory
mount [-fnrsvw] [-o options [,…]] device | directory
mount [-hV]

Temporaily attach the file system which exists on device ,
overlaying directory.

And update /etc/mtab

d> -r
device name of a   block special device, like: /dev/sda1
or
an NFS mount like knuth.cwi.nl:/sharedVolum
-a All filesystems set auto in /etc/fstab [of the given fstypes]
-F Fork a process for each device and NFS servers in parallel.
NFS timeouts will be independent, i.e. if one server or device is unavailable it won't hold up the other mounts.
mounts are done in undefined order.
do not use this option if you want to mount both /usr and /usr/spool.
read-only
-w read/write.
-ffake the actual mount. useful in conjunction with -v to determine what the mount is trying to do.
Can be used to add entries for devices that were mounted earlier with -n .
-n no writing to /etc/mtab.
Useful when /etc/fstab is on a read-only file system.
-s sloppy mount options don't cause exit
-L label the partition specified label.
-U uuidthe partition that has the specified uuid
-o other :
  • async I/O to the file system should be done asynchronously.
  • sync

  • atime Update access time. default.
  • noatime Do not "

  • auto will be mounted with -a .
  • noauto

  • ro read-only
  • rw read-write

  • suid Allow set-user-identifier or set-group-identifier bits to take effect.

-t fstype   MSDOS, e2fs, reiserfs, NTFS
-h help
-V Version
-v verbos

File system specific types

ufs local UNIX
msdos DOS compatible
nfs Sun Microsystems compatible Network File System
cd9660  CD-ROM (as per ISO 9660)
swap partition for swapping
tmpfs temporary ( may be cleaned at boot)
procfs for accessing process data
kernfs for accessing kernel parameters
fdesc /dev/fd
union translucent

The previous contents directory are hidden.
It might be a good idea to touch "not mounted" at the mount point.

list all mounted file systems of type fstype

mount [-t fstype]

The proc file system is not associated with a special device, proc can be used instead of a device specification.


mount - BSD/Apple darwin

mount [-adfruvw] [-t fstype ]
mount [-dfruvw] special | mount_point
mount [-dfruvw] [-o options] [-t fstype ] special mount_point

Prepare and graft a special device or the remote node (rhost:path) to the file system tree at the directory mount_point

If either special or mount_point are not provided, the information is obtained from getfsent(3)

Without arguments, the currently mounted files systems are output with options.

> mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk0s4 on /Volumes/Photos (hfs, local, journaled)
/dev/disk0s5 on /Volumes/DATA (hfs, local, journaled)
/dev/disk0s6 on /Volumes/CACHE+MAIL (hfs, local, journaled)
localhost:/VpHJ4VD2cF_wfkIaWdUjIK on /Volumes/MobileBackups (mtmfs, nosuid, read-only, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1 on /Volumes/Swift (hfs, local, nodev, nosuid, read-only, noowners, quarantine, mounted by jsmith)
/dev/disk2s1 on /Volumes/07_jsmith (msdos, local, nodev, nosuid, read-only, noowners)

-aAll filesystems listed via getfsent(3) are mounted
    Except
  • those marked as noauto;
  • excluded by --t
  • entries that are neither ro, rw, or rq;
  • nfs entries that also have net as an option;
  • and already mounted nfs entries.
-d Causes everything to be done except for the actual system call.useful in conjunction with -v to determine what the mount command will attempt
-r Mount the file system read-only (even the super-user may not write it). The same rdonly to -o .
-f Force the revocation of write access when downgrading from read-write to read-only.
-t fs File System Type (local or external). There is no default local file system, Type must be specified in order to mount a non-NFS filesystem.
example: to mount all filesystems except those of type NFS and HFS:
mount -a -t nonfs,hfs

All file system types are either links or programs in /sbin/mount_XXX. As of Elcaptain: mount_afp, mount_cddafs,,mount_exfat mount_ftp, mount_msdos mount_ntfs,mount_udf mount_acfs,mount_cd9660,,mount_devfs mount_fdesc mount_hfs, mount_nfs, mount_smbfs mount_webdav

lsvfs outputs the types currently loaded of filesystems

 > lsvfs
Filesystem                        Refs Flags
-------------------------------- ----- ---------------
nfs                                  1
hfs                                  7 local, dovolfs
devfs                                1
autofs                               2
smbfs                                0
msdos                                1 local

More than one type may be specified in a comma separated list and
May indicate that the actions should only be taken on filesystems of the specified type. Types can be prefixed with no to specify the filesystem types for which action should not be taken. For

-u Update the status of an already mounted file system .
From read-only to read-write or vice versa. An attempt to change from rw to rdonly will fail if files on the filesystem are currently open for writing unless -f is specified.
Any of the -o options may be changed.

The options are determined by extracting the current ones, applying options specified by -o and finally applying the -r or -w option.

-w Mount the file system read-write.
-v Verbose mode.
-o opt[,…] Options specific to a filesystem type that is not one of the internally known types (see -t ) may be 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, nfs filesystems are mounted by the program /sbin/mount_nfs. For example:
mount -t hfs -o nosuid,-w,-m=755 /dev/disk2s9 /tmp
causes mount to execute the equivalent of:
/sbin/mount_hfs -o nosuid -w -m 755 /dev/disk2s9 /tmp

The options specific to NFS filesystems are described in the mount_nfs(8) manual page.

async All I/O to the file system should be done asynchronously. This can be somewhat dangerous with respect to losing data when faced with system crashes and power outages. This is also the default. It can be avoided with the noasync option.
force The same as -f; forces the revocation of write access when trying to downgrade a filesystem mount status from read-write to read-only.
noasync This filesystem should not force all I/O to be written asynchronously.
noauto This filesystem should be skipped when mount is run with the -a flag.
nodev Do not interpret character or block special devices on the file system. This option is useful for a server that has file systems containing special devices for architectures other than its own.
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.
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.
nosuid Do not allow set-user-identifier or set-group-identifier bits to take effect.
rdonly The same as -r; mount the file system read-only (even the super-user may not write it).
sync All I/O to the file system should be done synchronously.
update The same as -u; indicate that the status of an already mounted file system should be changed.
union Causes the namespace to appear as the union of directories of the mounted filesystem with corresponding directories in the underlying filesystem. 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.
noatime Do not update the file access time when reading from a file. Useful on file systems where there are large numbers of files and performance is more critical than updating the file access time (which is rarely ever important).
nobrowse indicates that the mount point should not be visible via the GUI (i.e., appear on the Desktop as a separate volume).

SEE ALSO

mount(2), getfsent(3), mount_afp(8), mount_cd9660(8), mount_cddafs(8), mount_fdesc(8), mount_hfs(8), mount_msdos(8), mount_nfs(8), mount_smbfs(8), mount_udf(8), mount_webdav(8), umount(8)
df - Report filesystem disk space usage and device/mount_points
fdformat - Low-level format a floppy disk
fdisk - Partition table manipulator for Linux
ram - ram_disk
umount- detach/unmount a device
diskutil OS X administrative utility