Subject: Standard Proposal for Device Naming

From: Alan B Clegg <[email-masked]>
Date: Fri, 3 Apr 92 10:52:45 EST

Well, I have put my brain in gear and after hearing all of the discussion, have
come up with a proposal.

General form:

  Western Digital (IDE/RLL/MFM etc) Hard Drives
	/dev/{r}wd[C][N][P]
		r == if specified, designates a raw (character) device
		C == [a-z] Controller designation [a=first, b=second, etc]
		N == [0-9] Disk Drive Number on Controller
		P == [a-z] Partition number (if not given, designates entire
						disk)

    Examples:
        /dev/wda0               First Controller, Drive 0, entire disk
        /dev/rwad0              First Controller, Drive 0, Entire disk
						 Raw device
        /dev/wda0a              First Controller, Drive 0, partition 1

  Non-SCSI Magnetic Tape Devices
	/dev/{r}mt[C][N]
		r == if specified, designates a raw (character) device
		C == [a-z] Host Adapter [a=floppy controller, b=first
				add-on board, etc]
		N == [0-9] Tape Device number on host adapter

    Examples:
	/dev/rmta0		Raw Tape device, using tape device 0 on
				the floppy controller
	/dev/rmtb0		Raw Tape device, using tape device 0 on
				add-on board

  SCSI Disk Devices
	/dev/{r}sd[C][N][L][P]
		r == if specified, designates a raw (character) device
		C == [a-z] Host Adapter [a=first, b=second, etc]
		N == [0-7] SCSI ID of Disk
		L == [0-7] Logical Unit Number of device
		P == [a-z] Partition number (if not given, designates entire
						disk)

    Examples:
	/dev/sda00a 		First Host Adapter,
				SCSI ID 0, Lun 0, partition a
	/dev/sdb10 		Second Host Adapter,
				SCSI ID 1, Lun 0, entire disk

  SCSI Tape Devices
	/dev/{r}st[C][N][L]
                r == if specified, designates a raw (character) device
                C == [a-z] Host Adapter [a=first, b=second, etc]
                N == [0-7] SCSI ID of Tape Unit
                L == [0-7] Logical Unit Number of device

    Examples:
	/dev/rsta40		Raw SCSI Tape, First Host Adapter,
				SCSI ID 4, Lun 0

  Floppy Disk Devices
	/dev/{r}fd[N][S][D]
                r == if specified, designates a raw (character) device
		N == [0-1] Floppy disk number [0=a, 1=b]
		S == [3,5,8] Disk Size in inches (rounded)
		D == [sdq] Density (capacity depends on S and D)
				h = "high" density
				l = "low" density
	
    Examples:
	/dev/fd03h		Drive A:, High Density, 3.5" disk (1.44Mb)
	/dev/fd03l		Drive A:, Low Density, 3.5" disk (720Mb)
	/dev/fd15h		Drive B:, High Density, 5.25" disk (1.2Mb)
	/dev/fd15l		Drive B:, Low Density, 5.25" disk (360k)

  Console Device
	/dev/console
		"Master" console == /dev/vc1 unless otherwise set

  Current tty
	/dev/tty
		standard UNIX device, your "current" terminal

  Virtual Console Devices
	/dev/vc[N]
		N == [1-8] Virtual Console number (number represents FKey
				that corresponds to given VC)

  Pseudo Terminals
	/dev/ttyp[N]
	/dev/ptyp[N]
		N == [00-99] Pseudo Terminal number.  The t and p devices
				represent the master and slave side of
				the pseudo terminal.

  "Standard" Serial Devices
	/dev/ttys[N]
		N == [0-3] Serial device corresponding to DOS COM1: - COM4:

  Intelligent Serial Devices [add-on boards]
	/dev/tty[T][N]
		T == [a-z] Board Identifier [a=first, b=second, etc]
		N == [00-99] Serial port number.

    Examples:
	/dev/ttya00 == first serial port on first add-on controller board.
	/dev/ttyb16 == 17th serial port on second add-on controller board.

  Parallel devices
	/dev/par[N]
		N == [0-2] Parallel port responding to DOS LPT1 - LPT3

-- 
[email-masked]				Alan Clegg - Network Programmer
KD4JML (just my luck!)			MCNC -- Center for Communications

---

From: David Engel <[email-masked]>
Date: Fri, 3 Apr 92 14:13:12 CST

> How many really use all three?  Are there still 720k floppy disks around?
> Why define more than we need?  If the need is there, I agree (infact, my
> original draft [internal use only] had Low, Double, and Quad, until I tried
> to find a use for all three... LET ME KNOW!

There probably aren't too many quads used, but who knows, somebody out 
there may actually be using them.  As Michael mentioned, we also have to 
consider the new 2.88 Meg drives also.

> I disagree.  This leads to confusion (ESPECIALY ON SERIAL DEVICES) of locking
> mechanisms.  Is every version of UUCP, kermit and pcomm supposed to know
> that /dev/tty03 == /dev/ttys3 when creating /usr/spool/uucp/LCK..tty03?

We may just have to agree to disagree on this one. :)

I see two worthwhile, but conflicting, goals here.  The first is to have a
definitive set of specific device names (and numbers) supported by Linux.  
The second is to have generic name, coomon across all systems, for the
devices that are actually in use.  The problem with the first goal is that
similarly used devices on separate systems have totally different names.
Conversely, the problem with the second is that the devices would have
different numbers.

What I'm proposing is a compromise.  Keep the highly specific device name
you proposed, but allow each user to set up symlinks, probably with the
aid of configuration script, between the generic and specific names.

I'll admit having generic names for hard disks is probably not very useful
since their use is highly dependent partitioning and file system set up.
However, I fell generic names for other devices such as ttys, floppies and
tapes is very useful.

Maybe an example might help.  Let's say I write "Dave's Nifty Backer-Upper"
for Linux and I want to present the user with a list of destination devices 
to make it as user-friendly as possible.  With standard, generic names, I 
can limit the choices to those valid for his/her system.  Without genric
names, I have to include all combinations of floppy, tape (both SCSI and 
non-SCSI), most of which aren't valid.  Not very user-friendly, IMO.

As for your example, UUCP, kermit, pcomm, etc. would all be configured to
use tty03.  They have no need to know that it is actually ttys3.  Ttys3
would never be referenced directly in normal use.  It is only there to 
remind you what tty03 really is the next time you reconfigure the hardware
installed in your system.

-David
-- 
David Engel                        Optical Data Systems, Inc.
[email-masked]                      1101 E. Arapaho Road
(214) 234-6400                     Richardson, TX  75081

---

From: [email-masked]
Date: Mon, 6 Apr 92 10:31:09 MET DST

> > I think we should stick with the standard density names, ie. d=double,
> > q=quad and h=high.
> 

I for one would not want the 720k floppies to be discarded. My Amiga can read/
write these, and not the 1.44MB ones.

And I do have some stuff on the Amiga that I might want to use under Linux.

	- Peter.