Re: Questions about proc_scsi_write() in scsi_proc.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 26, 2007 at 05:29:53PM -0500, Rob Landley wrote:
> Ok, I'm unclear on what a LUN is.  All the devices I have lying around give me 
> a LUN of zero.  I used to think that a LUN was a bit like partition, and 
> mostly used for CD changes.  The structure "scsi_target" seems to aggregate 
> host/channel/target and I thought it referred to a device.

Maybe the best way to understand this is by analogy with PCI.  With PCI,
you have a 5-bit device id and a 3-bit function ID.  Most physical
devices implement only one function, but we create a pci_dev for every
implemented function.  I'm not sure how many bits we have for target and
lun in SCSI, but it works much the same way; the target is the physical
thing, and the LUN is a logical entity within that hunk of hardware.  We
create a scsi_device for each LUN.

> Every device I have that shows up as SCSI has shown up with a LUN of 0, which 
> is target-wide unique because none of those targets have sub-functions that 
> need to be independently addressed as devices.

I have two devices with multiple LUNs.  One is a Plasmon PD-2000 combo
CD-reader and optical-disc.  If you put a CD-ROM in it, that's LUN 0
(sr) and if you put an optical disc in it, that shows up on LUN 1 (sd).

The other device is an HP fibre-channel Virtual Array which is a 3U
piece of metal with up to 15 drives inside it.  It splits those discs
up into as many LUNs as you configure it to, at whatever RAID level you
configure it to, and (in my configuration) presents itself as a single
target with 128 LUNs.

Not all storage arrays behave like that; I have another HP array that
presents each disc within it as an individual target, and the controller
is another target (it shows up as a PROCESSOR device).  In this scenario,
you only have LUN 0 on each target.

I'm sure there are plenty of other examples, but hopefully this will
help.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux