devices and mount points

Igor Pechtchanski pechtcha@cs.nyu.edu
Tue May 13 01:23:00 GMT 2003


On Mon, 12 May 2003, Larry Hall (RFK Partners, Inc.) wrote:

> Robert Citek wrote:
> > Hello all,
> >
> > Is there an easy way to discover what device is mounted to what drive?
> >
> > Specifically, I have a CD drive.  If I put a CD into the drive, I can
> > access it at the filesystem level as /cygdrive/d/.  However, mount does not
> > tell me what device the CD drive is.  It only says d: is mounted on
> > /cygdrive/d/.  I eventually discovered that is was /dev/scd4, but not
> > before trying devices /dev/scd[0-3].
> >
> > To get a list of all devices I tried 'ls -la /dev/*' but that did not work.
> >  I also searched the archives using "CD device" and "/dev/ mount" but did
> > not see anything relevant.
> >
> > Any pointers?
>
> Cygwin mount is not the same as a UNIX mount.  It doesn't mention (or
> need) devices.  It's really just a mapping of one file system notation
> into another.  Cygwin emulates certain common UNIX devices but these are
> virtual.  They don't show up in the file system by default (you can create
> explicit names for them if you like).  The best way to find out the
> currently supported virtual devices is to grep through the Cygwin code
> for them.

Here are a couple of scripts (well, one's a batch file) I whipped up a
while ago to create physical zero-length files so that "ls /dev" works
correctly.  They should be run from "/cygdrive/c/cygwin/dev", the .bat
first, and then the .sh to create symbolic links.  I was going to suggest
putting them in the base-files package, but with the coming of mkdev(),
/dev will cease to be a virtual directory, so there is really no point.
Use 'em while you can! ;-)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II
-------------- next part --------------
@echo off
REM Create devices, part 1
REM Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
REM
REM All devices of a certain type to be created - add if more needed
set ALL=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

REM - console (1,*)
for %%i in (conin conout) do echo off > %%i
REM - tty master (4,*)
for %%i in (ttym) do echo off > %%i
REM - tty (5,*)
for %%i in (%ALL%) do echo off > tty%%i
REM - pty master (6,*)
for %%i in (ptmx) do echo off > %%i
REM - serial (7,*)
for %%i in (%ALL%) do echo off > ttyS%%i
REM   TODO: should we do com* as well?
REM - windows (12,*)
for %%i in (windows) do echo off > %%i

REM - floppy (17,0..15)
for %%i in (0 1 2) do echo off > fd%%i
REM - cdrom (17,16..31)
for %%i in (0 1 2) do echo off > scd%%i
REM - hard disks (17,32..223)
for %%j in (a b c) do for %%i in (. 1 2) do echo off > sd%%j%%i
REM - tape [rewind] (18,0..127)
for %%i in (0 1 2) do echo off > st%%i
REM - tape [norewind] (18,128..255)
for %%i in (0 1 2) do echo off > nst%%i

REM - null (19,*)
for %%i in (null) do echo off > %%i
REM - zero (20,*)
for %%i in (zero) do echo off > %%i
REM - random (21,*)
for %%i in (random urandom) do echo off > %%i
REM - mem (22,*)
for %%i in (mem port) do echo off > %%i
REM - clipboard (23,*)
for %%i in (clipboard) do echo off > %%i
REM - dsp (24,*)
for %%i in (dsp) do echo off > %%i

REM Create pipes
for %%i in (pipe piper pipew) do echo off > %%i
REM Create sockets
for %%i in (tcp udp streamsocket dgsocket) do echo off > %%i

-------------- next part --------------
#!/bin/sh
# Create devices, part 2
# Author: Igor Pechtchanski <pechtcha@cs.nyu.edu>
#
# Create symbolic links
[ ! -e console ] && ln -s tty console
[ ! -e floppy ]  && ln -s fd0 floppy
[ ! -e cdrom ]   && ln -s scd0 cdrom
[ ! -e tape ]    && ln -s st0 tape
[ ! -e audio ]   && ln -s dsp audio

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list