Contents|Index|Previous|Next

mount


 
USAGE
mount [-bf] <dospath> <unixpath>
mount --reset
mount
   -b     text files are equivalent to binary files
          (newline = \n)
   -f     force mount, don't warn about missing mount
          point directories
DESCRIPTION

To reset the mount table use: mount --reset.
The mount program is used to map your drives and shares onto the simulated POSIX directory tree, much like as is done by the POSIX mount command. This is very similar to the DOS join command, in that it makes your drive letters appear as subdirectories somewhere else. In POSIX operating systems (like Linux tm ), there is no concept of drives, nor drive letters. All absolute paths begin with a slash instead of  “c:” and all file systems appear as subdirectories (for example, you might buy a new disk and make it be the /disk2 directory). This practice is simulated by Cygwin to assist in porting POSIX programs to Windows.

Normally, you'd just give the DOS/Windows equivalent path and where you want it to show up in the simulated POSIX tree, like the following example’s declarations.
 

C:\Cygnus> mount c:\ /
C:\Cygnus> mount c:\Cygnus\gnupro-98r2\bin /bin
C:\Cygnus> mount d:\ /usr/data
C:\Cygnus> mount e:\mystuff /mystuff
bash$ mount 'c:\' /
Since native paths use backslashes, and backslashes are special in most POSIX-like shells (like bash), you need to properly quote them if you are using such a shell.

There are many opinions on what the proper set of mounts is, and the appropriate one for you depends on how closely you want to simulate a POSIX environment, whether you mix Windows and Cygwin programs, and how many drive letters you are using. If you want to be very POSIX-like, you may want to use declarations like the following example shows.
 

C:\> mount c:\Cygnus\gnupro-99r1 /
C:\> mount c:\ /c
C:\> mount d:\ /d
C:\> mount e:\ /cdrom
However, if you mix Windows and Cygwin programs a lot, you might want to create an identity mapping, so that conversions between the two (see the cygpath command) can be eliminated; for instance, you could use declarations like the following example shows.

 
C:\> mount c:\ \
C:\> mount d:\foo /foo
C:\> mount d:\bar /bar
C:\> mount e:\grill /grill
Repeat this process for all top-level subdirectories on all drives, but then you’d always have the top-level directories available as the same names in both systems.

The -b and -t options change the default text file type for files found in that mount point. The default is text, which means that Cygwin will automatically convert files between the POSIX text style (each line ends with the NL character) and the Windows text style (each line ends with a CR character and an LF character, or CRLF) as needed. The program can, and should, explicitly specify text or binary file access as needed, but not all do.

If your programs are properly written with the differentiation between text and binary files, the default (-t) is a good choice. You must use -t if you are going to mix files between Cygwin and Windows programs, since Windows programs will always use the CRLF format.

If you are mounting a remote filesystem from a Unix machine, use -b, as the text files found there will normally be NL format anyway, and you would want any files put there by Cygwin programs to be stored in a format that the Unix machine will understand.

If you just type mount with no parameters, the program will display the current mount table for you. Using --reset will reset the mount table to its default set of entries, which may include floppy, tape or other drives.

You do not need to set up mounts for most devices in the POSIX /dev directory (like /dev/null) as these are simulated automatically within Cygwin.



Top|Contents|Index|Previous|Next