Discussion:
LUN-Probing on Multi-LUN Devices
Moritz Kiese
2006-11-27 02:04:55 UTC
Permalink
Greetings,

I just hooked up a rather old 6x CD-changer (Pioneer DRM-624X) to my
SUN Ultra 1 (fast SCSI provided by a combi SBUS card with additional esp,
le & cereal). The CD-changer usually presents its six cds at six different
devices appearing under six LUNs, however neither 4.0 GENERIC nor a custom
kernel with an additional

option SCSIFORCELUN_BUSES=0x0001

which I vaguely remember from an elderly discussion about multi-LUN
devices on misc@ seems to find more than the first cd (cd1) of the six
(which seems to be working fine).
In case it helps: Under Lunix and (IIRC) Slowlaris this beast appeared
under six different LUNs, generating six cd-devices. All devices could be
mounted simultaneously, but only one at a time could be read of course. So
I wonder whether there is some way to force LUN probing on all devices?

Any hints highly appreciated,
Moritz.

dmesg below:
OpenBSD 4.0 (MBK) #0: Sun Nov 26 19:10:47 CET 2006
***@luminara.dagobah:/usr/src/sys/arch/sparc64/compile/MBK
total memory = 134217728
avail memory = 110002176
using 819 buffers containing 6709248 bytes of memory
bootpath: /***@1f,0/SUNW,***@e,8800000/***@0,0
mainbus0 (root): Sun Ultra 1 UPA/SBus (UltraSPARC 167MHz)
cpu0 at mainbus0: SUNW,UltraSPARC @ 166.963 MHz, version 0 FPU
cpu0: physical 32K instruction (32 b/l), 16K data (32 b/l), 512K external
(64 b/l)
timer0 at mainbus0 addr 0xfffc7c00 ivec 0x7f0, 0x7f1
sbus0 at mainbus0 addr 0xfffcc000: clock = 25 MHz
sbus0: dvma map ff800000-ffffdfff, iotdb 20bbe000-20bc0000, STC0 enabled
audiocs0 at sbus0 slot 13 offset 0xc000000 vector 24 ipl 8
audio0 at audiocs0
auxio0 at sbus0 slot 15 offset 0x1900000
flashprom at sbus0 slot 15 offset 0x0 not configured
fdc0 at sbus0 slot 15 offset 0x1400000 vector 29 ipl 11: no drives
attached
clock1 at sbus0 slot 15 offset 0x1200000: mk48t59
zs0 at sbus0 slot 15 offset 0x1100000 vector 28 ipl 12 softpri 6
zstty0 at zs0 channel 0 (console i/o)
zstty1 at zs0 channel 1
zs1 at sbus0 slot 15 offset 0x1000000 vector 28 ipl 12 softpri 6
zskbd0 at zs1 channel 0: no keyboard
zstty2 at zs1 channel 1: mouse
uperf0 at sbus0 slot 15 offset 0x1300000: model SUNW,sc-up (0/0) ports 3
SUNW,pll at sbus0 slot 15 offset 0x1304000 not configured
esp0 at sbus0 slot 14 offset 0x8800000 vector 20 ipl 3: dma rev fas
esp0: FAS366/HME, 40MHz, SCSI ID 7
scsibus0 at esp0: 16 targets
sd0 at scsibus0 targ 0 lun 0: <SEAGATE, SX150176LC, BA0F> SCSI2 0/direct
fixed
sd0: 47702MB, 12024 cyl, 22 head, 369 sec, 512 bytes/sec, 97693755 sec
total
cd0 at scsibus0 targ 6 lun 0: <TOSHIBA, XM5701TASUN12XCD, 0997> SCSI2
5/cdrom removable
hme0 at sbus0 slot 14 offset 0x8c00000 vector 21 ipl 6, address
08:00:20:89:86:8d
nsphy0 at hme0 phy 1: DP83840 10/100 PHY, rev. 1
SUNW,bpp at sbus0 slot 14 offset 0xc800000 vector 22 ipl 2 not configured
dma0 at sbus0 slot 0 offset 0x200000: dma rev 2
esp1 at dma0 slot 0 offset 0x400000 vector 3 ipl 3: ESP200, 40MHz, SCSI ID
7
scsibus1 at esp1: 8 targets
cd1 at scsibus1 targ 2 lun 0: <PIONEER, CD-ROM DRM-624X, 1.08> SCSI2
5/cdrom removable
sd1 at scsibus1 targ 6 lun 0: <PHILIPS, DD640R2, 0020> SCSI2 0/direct
removable
sd1: drive offline
ledma0 at sbus0 slot 0 offset 0x200010: dma rev 2
le0 at ledma0 slot 0 offset 0x600000 vector 4 ipl 6: address
08:00:20:89:86:8d
le0: 8 receive buffers, 2 transmit buffers
SUNW,bpp at sbus0 slot 0 offset 0xc00000 vector 2 ipl 2 not configured
pcons at mainbus0 not configured
root on sd0a
rootdev=0x700 rrootdev=0x1100 rawdev=0x1102
DoN. Nichols
2006-11-27 04:55:49 UTC
Permalink
Post by Moritz Kiese
Greetings,
I just hooked up a rather old 6x CD-changer (Pioneer DRM-624X) to my
SUN Ultra 1 (fast SCSI provided by a combi SBUS card with additional esp,
le & cereal). The CD-changer usually presents its six cds at six different
devices appearing under six LUNs, however neither 4.0 GENERIC nor a custom
kernel with an additional
option SCSIFORCELUN_BUSES=0x0001
which I vaguely remember from an elderly discussion about multi-LUN
(which seems to be working fine).
In case it helps: Under Lunix and (IIRC) Slowlaris this beast appeared
under six different LUNs, generating six cd-devices. All devices could be
mounted simultaneously, but only one at a time could be read of course. So
I wonder whether there is some way to force LUN probing on all devices?
Any hints highly appreciated,
Look at sd(4) -- especially the synopsis:

======================================================================
sd* at scsibus?
#sd0 at scsibus0 target 3 lun 0 (fixed-configuration example)
======================================================================

And at cd(4)

======================================================================
cd* at scsibus?
#cd0 at scsibus0 target 6 lun 0 (fixed-configuration example)
======================================================================

Note that the first line is what you will find in your GENERIC
kernel configuration, and AFIK, it *only* selects "lun 0".

You will need, instead, to change that line to multiple lines
(assuming that you have only one SCSI drive other than the CD-ROM
changer):

======================================================================
# Your boot drive -- adjust SCSI ID as appropriate. IIRC, the
# Ultra-1 wants target 0 as the first internal drive.
#
# Yes -- I just checked, and the internal drives are SCSI ID 0
# and SCSI-ID 1, so let's allow for both, even if both are not
# currently present.
#
sd0 at scsibus0 target 0 lun 0
sd1 at scsibus0 target 1 lun 0
#
# Assume the CD-changer to be at the usual SCSI-ID 6 for
# Suns -- change as necessary
#
cd2 at scsibus0 target 6 lun 0
cd3 at scsibus0 target 6 lun 1
cd4 at scsibus0 target 6 lun 2
cd5 at scsibus0 target 6 lun 3
cd6 at scsibus0 target 6 lun 4
cd7 at scsibus0 target 6 lun 5
======================================================================

To be honest, I don't know what happens if some disks are hard
coded as above, and others are not -- but I do know that the hard-coding
of *disks* is needed for reliable behavior with the RAID system if you
boot with a missing or failed disk.

So -- make the changes to a copy of

/usr/src/sys/arch/sparc64/conf/GENERIC

(Perhaps call it WITHCDS or something similar), compile it, and install
it as the current kernel (/bsd) -- saving a copy of the old one, of
course, as something like /bsd-GENERIC to make it easier to recover if
something went wrong with the kernel which you built.

I hope that this helps,
DoN.
--
Email: <***@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---
Theo de Raadt
2006-11-27 08:30:25 UTC
Permalink
Post by DoN. Nichols
Note that the first line is what you will find in your GENERIC
kernel configuration, and AFIK, it *only* selects "lun 0".
that is balony. He's hit a bug. What he's got should not need special
configuration. It should just work.

config files specifiers which have no value do not default to 0. They
default to -1, which is '?', and allows the back-end subsystem to allocate
as many sub-devices fitting into that pattern that it can see.
DoN. Nichols
2006-11-27 19:35:14 UTC
Permalink
Post by Theo de Raadt
Post by DoN. Nichols
Note that the first line is what you will find in your GENERIC
kernel configuration, and AFIK, it *only* selects "lun 0".
that is balony. He's hit a bug. What he's got should not need special
configuration. It should just work.
config files specifiers which have no value do not default to 0. They
default to -1, which is '?', and allows the back-end subsystem to allocate
as many sub-devices fitting into that pattern that it can see.
My apologies for misunderstanding the way things work.

Should my suggestion work for him at least?

Thanks,
DoN.
--
Email: <***@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---
Loading...