Subject: Re: partition bookkeeping
To: Oleg Polyanski <email@example.com>
From: Bill Studenmund <firstname.lastname@example.org>
Date: 09/22/1999 14:46:22
On 23 Sep 1999, Oleg Polyanski wrote:
> Consider my disk has name `sd0' (because it was detected first during
> the kernel booting). Later I will add ZIP drive and IT will get the
> name `sd0' and hard disk will become `sd1'. Bad surprise, manual
> intervention required. Something like `/dev/scsi/dsk/c0d0p0' as root
> fs unique identifier will help.
Yes but there are consequences to doing that which is why we won't. To do
that, we'd have to pre-reserve space in the minor number to encode drive,
LUN (something you forgot above) and partition.
Right now we have 20 bits for the minor number. We're talking about new
disklabels/wedges, and everyone seems to be happy with 64 partitions per
disk. That's 6 bits, which leaves us 12 bits to specify the disk.
As is, that's 8192 disks, which is a lot.
But to do somethign like c0d0l0p0, we have to reserve enough space for the
maximum values of fields. We IMMEDIATLY run out of room. For instace, the
SCSI-3 spec permits 16 bits of LUN per disk. So right off the bat we
can't encode all the possible LUN's on ONE disk!
Say we restrict ourselves to the 8 LUN's of SCSI-2. That's three bits.
Well, we also want to support fibre channel. A fibre channel bus can be
approximated as a scsibus with 126 possible targets. To hard code to cover
them all, that's 7 bits. We started with 12 bits to specify the disks, and
we've used 10. That leaves us 2 bits to specify the controller.
That's only 4 controllers. We have a number of PC's here which can support
more than 4 controllers at once. If we did this, we'd loose. :-)
Also, here at NAS, we've got some Alpha 8200's, which are BIG alpha-based
machines. They have around 84 PCI slots in them. So if we did this
hard-coding, we could only put 4 SCSI cards into a machine with 84 slots,
just because we hard coded things.
That's why we wont' hard-code things. It'd waste too much space, because
you have to code for the max value when doing so, and all the cases which
don't use anything near the max (like how most SCSI devices only use LUN
0) will just waste resources.