From: Bryan Curnutt (bryan@uhura1.uucp)
Date: 07/22/92


From: bryan@uhura1.uucp (Bryan Curnutt)
Subject: Re: Device names (was Re: ttys2 not responding)
Date: Wed, 22 Jul 1992 14:28:23 GMT

In article <711742044.F00069@remote.halcyon.com> Rob.Levin@f217.n3802.z1.fidonet.org (Rob Levin) writes:
> TT> This is very confusing - drive _letters_ are a DOS anachronism and
> TT> should have no place in Linux.
>
>You seem to be arguing that, because something is done a certain way in
>DOS, it is anathema. I'll be interested in hearing other, more
>substantive, arguments. ;-)

The only plus I can think of is that you can make drives conform
directly to SCSI id numbers, so SCSI id 0 is /dev/hd0, SCSI id 1
is /dev/hd1, etc.

>Could you be more specific on the BSD convention for hard disk naming?
>And for partitions, if such a thing exists in the vanilla BSD
>environment?

I can't comment on "vanilla BSD," but I've seen this on a couple of
BSD-derived systems:

Hard disks are labelled using a digit to denote the hard disk, and
a letter to denote the partition. If the device type you're using
is named "hd" then the "first" disk (which may not exist, e.g. the
"first" disk may be the disk with SCSI ID 0, while the only disk
you have may be the "fourth" disk with SCSI ID 3) would look like
this:

    /dev/hd0a /dev/hd0b /dev/hd0c /dev/hd0d /dev/hd0e /dev/hd0f
    /dev/hd0g /dev/hd0h

(There will also be appropriate "raw" devices /dev/rhd0a, /dev/rhd0b,
etc.)

Partitions are always labelled a through h. Letters beyond h are
illegal. For historical reasons, partition "c" is *always* the
entire drive (equivalent to MCC-Interim Linux's /dev/hda). By
tradition, the root partition is on partition "a", swap is on
partition "b", and /usr is on partition "g". You can never have
more than seven partitions on a disk, because only "a" through "h"
are available, and "c" is used to represent the entire disk. (This
is annoying -- there have been times when I've wanted to divide a
hard disk into >7 partitions.)

If Linux were to switch over to this ugly and bletcherous scheme
(me? no, I'm not opinionated), a typical Linux installation might
translate to something like this:

    /dev/hd0a /
    /dev/hd0b swap
    /dev/hd0c [entire hard disk, not usable for anything else]
    /dev/hd0d DOS partition???
    /dev/hd0e -not used-
    /dev/hd0f -not used-
    /dev/hd0g either /usr or -not used- if /usr is kept on /dev/hd0a
    /dev/hd0h /home

Usually, the partitions are laid out sequentially on the hard disk,
so /dev/hd0a occupies blocks 0 through N, /dev/hd0b occupies blocks
N through N+M, etc. Since my DOS partition is going to be the first
partition on my hard disk, my current layout of

    /dev/hda [entire hard disk, not usable for anything else]
    /dev/hda1 DOS partition
    /dev/hda2 /
    /dev/hda3 swap
    /dev/hda4 /home

doesn't translate nicely to the traditional BSD scheme.

Frankly, I much prefer the /dev/hda way of doing things. I wouldn't
mind switching to /dev/hd0 for the entire disk and /dev/hd0a for the
first partition, /dev/hd0b for the second, etc. but I'd like to see
the BSD partitioning conventions left out of it.

-- 
Any opinions above are mine, and do not necessarily reflect the views of SAI.

Bryan Curnutt | "I hope that UNIX is more like my diner bryan%uhura1@uunet.uu.net | than like McDonald's." -- Doug McIlroy