Subject: Re: partition bookkeeping
To: Oleg Polyanski <luke@eed.miee.ru>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 09/23/1999 12:33:17
On 23 Sep 1999, Oleg Polyanski wrote:

> >>>>> "IS" == Ignatios Souvatzis writes:
> 
>  IS> Maybe I should add that for normal booting, root devices tend to not
>  IS> change their name all the time, so having the sysadmin edit fstab once
>  IS> at installation or reconfiguration time is good enough.
>  >>  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.
>  >> 
> 
>  IS> If you insist to make your boot drive scsi id 1, and not having any
>  IS> fixed disk scsi id 0, you can still wire down the sd unit of your root
>  IS> disk in your kernel configuration.
> 
> 	OK, here are excerpts from my `dmesg' output:
> 
> NetBSD 1.4K (TINDERBOX) #1: Sat Sep 18 15:08:22 MSD 1999
>     root@dazzle.org:/usr/sup/src/sys/arch/i386/compile/TINDERBOX
> cpu0: family 6 model 5 step 1
> cpu0: Intel Pentium II (Deschutes) (686-class)
> [....]
> pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4)
> pciide0: bus-master DMA support present
> pciide0: primary channel wired to compatibility mode
> atapibus0 at pciide0 channel 0
> sd0 at atapibus0 drive 1: <IOMEGA  ZIP 100       ATAPI, , 23.D> type 0 direct removable
> sd0: drive offline
> sd0: 32-bits data port
> pciide0: primary channel interrupting at irq 14
> sd0(pciide0:0:1): using PIO mode 3
> pciide0: secondary channel wired to compatibility mode
> atapibus1 at pciide0 channel 1
> [....]
> ncr0 at pci0 dev 16 function 0: ncr 53c875 fast20 wide scsi
> ncr0: interrupting at irq 10
> ncr0: minsync=12, maxsync=137, maxoffs=16, 128 dwords burst, large dma fifo
> ncr0: single-ended, open drain IRQ driver, using on-chip SRAM
> ncr0: restart (scsi reset).
> scsibus0 at ncr0: 16 targets, 8 luns per target
> sd1 at scsibus0 targ 1 lun 0: <SEAGATE, ST52160N, 0285> SCSI2 0/direct fixed
> sd1(ncr0:1:0): 20.0 MB/s (50 ns, offset 15)
> sd1: 2069 MB, 6536 cyl, 4 head, 162 sec, 512 bytes/sect x 4238282 sectors
> sd2 at scsibus0 targ 2 lun 0: <SEAGATE, ST36530N, 1206> SCSI2 0/direct fixed
> sd2(ncr0:2:0): 20.0 MB/s (50 ns, offset 15)
> sd2: 6208 MB, 9006 cyl, 6 head, 235 sec, 512 bytes/sect x 12715920 sectors
> [....]
> 
> 	So, what you mean when you say  `you can still  wire down the sd unit
> 	of your root disk in your kernel configuration'?

What we mean is that if you add

sd0 at scsibus0 targ 1 lun 0

to your kernel config and rebuild, then sd0 will ALWAYS be drive 1 on scsi
bus 0. You should probably also add

ncr0 at pci0 dev 16 function 0
scsibus0 at ncr0

So that you're certain that sd0 is always target 1 on the scsi bus off of
the ncr scsi adapter in that particular PCI slot.

You could then add scsi controllers in any other slot, add 3 other zip
drives (2 ide busses w/ 2 targets each), and sd0 won't move around.

If you change scsi controllers, or move that scsi bus to a different
controller, sd0 will no longer show up. If you leave sd* at scsibus?
target ? lun ? in the file, then the drive will show up at some other sd
#.

That's what we mean about wiring devices down. You can get the same effect
of cXtYlZpQ if you want, but you also get something much more flexabile.

Take care,

Bill