MOUNT(1)

NAME
 - Display information about mounted filesystems, or mount a filesystem

SYNOPSIS
mount [OPTION] [<win32path> <posixpath>]
mount -a
mount <posixpath>

OPTIONS

-a, --all
    mount all filesystems mentioned in fstab

-c, --change-cygdrive-prefix
    change the cygdrive path prefix to <posixpath>

-f, --force
    force mount, don't warn about missing mount point directories

-h, --help
    output usage information and exit

-m, --mount-entries
    write fstab entries to replicate mount points and cygdrive prefixes

-o, --options X[,X...]
    specify mount options

-p, --show-cygdrive-prefix
    show user and/or system cygdrive path prefix

-v, --version
    output version information and exit

DESCRIPTION
The mount program is used to map your drives and shares onto Cygwin's simulated POSIX directory tree, much like as is done by mount commands on typical UNIX systems. However, in contrast to mount points given in /etc/fstab, mount points created or changed with mount are not persistent. They disappear immediately after the last process of the current user exited. Please see mount-table /xref for more information on the concepts behind the Cygwin POSIX file system and strategies for using mounts. To remove mounts temporarily, use umount

If you just type mount with no parameters, it will display the current mount table for you.

$ mount
c:\cygwin\bin on /usr/bin type ntfs (binary)
c:\cygwin\lib on /usr/lib type ntfs (binary)
c:\cygwin on / type ntfs (binary)
c: on /c type ntfs (binary,user,noumount)
d: on /d type fat (binary,user,noumount)

In this example, c:\cygwin is the POSIX root and D drive is mapped to /d. Note that in this case, the root mount is a system-wide mount point that is visible to all users running Cygwin programs, whereas the /d mount is only visible to the current user.

The mount utility is also the mechanism for adding new mounts to the mount table. The following example demonstrates how to mount the directory //pollux/home/joe/data to /data for the duration of the current session.

$ ls /data
ls: /data: No such file or directory
$ mount //pollux/home/joe/data /data
mount: warning - /data does not exist!
$ mount
//pollux/home/joe/data on /data type smbfs (binary)
c:/cygwin/bin on /usr/bin type ntfs (binary)
c:/cygwin/lib on /usr/lib type ntfs (binary)
c:/cygwin on / type ntfs (binary)
c: on /c type ntfs (binary,user,noumount)
d: on /d type fat (binary,user,noumount)

A given POSIX path may only exist once in the mount table. Attempts to replace the mount will fail with a busy error. The -f (force) option causes the old mount to be silently replaced with the new one, provided the old mount point was a user mount point. It's not valid to replace system-wide mount points. Additionally, the -f option will silence warnings about the non-existence of directories at the Win32 path location.

 The -o option is the method via which various options about the mount point may be recorded. The following options are available (note that most of the options are duplicates of other mount flags):

  acl - Use the filesystem's access control lists (ACLs) to
               implement real POSIX permissions (default).
  binary - Files default to binary mode (default).
  cygexec - Treat all files below mount point as cygwin executables.
  exec - Treat all files below mount point as executable.
  noacl - Ignore ACLs and fake POSIX permissions.
  nosuid - No suid files are allowed (currently unimplemented)
  notexec - Treat all files below mount point as not executable.
  override - Override immutable mount points.
  posix=0 - Switch off case sensitivity for paths under this mount point.
  posix=1 - Switch on case sensitivity for paths under this mount point
               (default).
  text - Files default to CRLF text mode line endings.

For a more complete description of the mount options and the /etc/fstab file, see mount-table /xref.

Note that all mount points added with mount are user mount points. System mount points can only be specified in the /etc/fstab file.

If you added mount points to /etc/fstab or your /etc/fstab.d/&lt;username> file, you can add these mount points to your current user session using the -a/--all option, or by specifing the posix path alone on the command line. As an example, consider you added a mount point with the POSIX path /my/mount. You can add this mount point with either one of the following two commands to your current user session.

$ mount /my/mount
$ mount -a

The first command just adds the /my/mount mount point to your current session, the mount -a adds all new mount points to your user session.

If you change a mount point to point to another native path, or if you changed the flags of a mount point, you have to umount the mount point first, before you can add it again. Please note that all such added mount points are added as user mount points, and that the rule that system mount points can't be removed or replaced in a running session still applies.

 The -m option causes the mount utility to output the current mount table in a series of fstab entries. You can save this output as a backup when experimenting with the mount table. Copy the output to /etc/fstab to restore the old state. It also makes moving your settings to a different machine much easier.

Whenever Cygwin cannot use any of the existing mounts to convert from a particular Win32 path to a POSIX one, Cygwin will, instead, convert to a POSIX path using a default mount point: /cygdrive. For example, if Cygwin accesses z:\foo and the z drive is not currently in the mount table, then z:\ will be accessible as /cygdrive/z. The mount utility can be used to change this default automount prefix through the use of the "--change-cygdrive-prefix" option. In the following example, we will set the automount prefix to /mnt:

$ mount --change-cygdrive-prefix /mnt

Note that the cygdrive prefix can be set both per-user and system-wide, and that as with all mounts, a user-specific mount takes precedence over the system-wide setting. The mount utility creates system-wide mounts by default if you do not specify a type. You can always see the user and system cygdrive prefixes with the -p option. Using the --options flag with --change-cygdrive-prefix makes all new automounted filesystems default to this set of options. For instance (using the short form of the command line flags)

$ mount -c /mnt -o binary,noacl

Limitations: there is a hard-coded limit of 30 mount points. Also, although you can mount to pathnames that do not start with "/", there is no way to make use of such mount points.

Normally the POSIX mount point in Cygwin is an existing empty directory, as in standard UNIX. If this is the case, or if there is a place-holder for the mount point (such as a file, a symbolic link pointing anywhere, or a non-empty directory), you will get the expected behavior. Files present in a mount point directory before the mount become invisible to Cygwin programs.

It is sometimes desirable to mount to a non-existent directory, for example to avoid cluttering the root directory with names such as a, b, c pointing to disks. Although mount will give you a warning, most everything will work properly when you refer to the mount point explicitly. Some strange effects can occur however. For example if your current working directory is /dir, say, and /dir/mtpt is a mount point, then mtpt will not show up in an ls or echo * command and find . will not find mtpt.

COPYRIGHT
Cygwin is Copyright (C) 1995-2010 Red Hat, Inc.

Cygwin is Free software; for complete licensing information, refer to: http://cygwin.com/licensing.html

SEE ALSO
The full documentation to the Cygwin API is maintained on the web at: http://cygwin.com/cygwin-api/cygwin-api.html The website is updated more frequently than the man pages and should be considered the authoritative source of information.