3.6.7.1. Using mount. Comtrol DeviceMaster Software Development Kit
Advertisement
Advertisement
Chapter 3. Using Cygwin
-b = text files are equivalent to binary files (newline = \n)
-x = files in the mounted directory are automatically given execute permission.
-f = force mount, don’t warn about missing mount point directories
-s = add mount point to system-wide registry location
-change-automountprefix = change path prefix used for automatic mount points
-import-old-mounts = copy old registry mount table mounts into the current mount areas
When invoked without any arguments, mount displays the current mount table.
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. Please see Section 3.1.2 for more information on the concepts behind the
Cygwin POSIX file system and strategies for using mounts.
3.6.7.1. Using mount
If you just type mount with no parameters, it will display the current mount table for you.
Example 3-9. Displaying the current set of mount points c:\cygnus\>
Device
D:
C: mount
Directory
/d
/
Type user system
Flags textmode textmode
In this example, the C drive 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.
56
Chapter 3. Using Cygwin
The mount utility is also the mechanism for adding new mounts to the mount table.
The following example demonstrates how to mount the directory
C:\cygnus\cygwin-b20\H-i586-cygwin32\bin to /bin and the network directory \\pollux\home\joe\data to /data .
/bin is assumed to already exist.
Example 3-10. Adding mount points c:\cygnus\> ls /bin /data ls: /data: No such file or directory c:\cygnus\> c:\cygnus\> mount C:\cygnus\cygwin-b20\H-i586-cygwin32\bin /bin mount \\pollux\home\joe\data /data
Warning: /data does not exist!
c:\cygnus\> mount
Device Directory
\\pollux\home\joe\data /data
Type user
Flags textmode
C:\cygnus\cygwin-b20\H-i586cygwin32\bin /bin user textmode
D:
\\.\tape1:
/d
/dev/st1 user user
\\.\tape0:
\\.\b:
\\.\a:
C: c:\cygnus\>
/dev/st0
/dev/fd1
/dev/fd0
/ ls /bin/sh user user user system
/bin/sh textmode textmode textmode textmode textmode textmode
Note that mount was invoked from the Windows command shell in the previous example. In many Unix shells, including bash, it is legal and convenient to use the forward "/" in Win32 pathnames since the "\" is the shell’s escape character.
The "-s" flag to mount is used to add a mount in the system-wide mount table used by all Cygwin users on the system, instead of the user-specific one. System-wide mounts are displayed by mount as being of the "system" type, as is the case for the / partition in the last example. Under Windows NT, only those users with Administrator priviledges are permitted to modify the system-wide mount table.
57
Download
Advertisement