Amanda-Users

Re: /dev/sg numbering

2003-09-25 16:05:58
Subject: Re: /dev/sg numbering
From: "C.Scheeder" <christoph.scheeder AT scheeder DOT de>
To: Stephen Walton <stephen.walton AT csun DOT edu>
Date: Thu, 25 Sep 2003 22:01:36 +0200
Hi again... ;-)

Stephen Walton wrote:
On Wed, 2003-09-24 at 23:10, C.Scheeder wrote:

Hi,
Is your changer the only device showing up in /proc/scsi/scsi?
or just the only device with a LUN of 1 ?


The former.  I have 3 SCSI devices, but the other two are disks with
only LUN=0.  The tape drive shows up last in the list from
/proc/scsi/scsi.  I suppose that's why the sg driver puts its other LUN
at /dev/sg3?

yup, that is it.
the lun number is only the way scsi uses to address multiple logical
units which respond to a single scsi-id.
to get the sg number for a device/lun is verry easy, count the
position of your device/lun in proc/scsi/scsi starting from 0 for the first entry and you have the sg-number for your device.


I'm just a bit curious, but I'm also worried about the number changing
and breaking Amanda if I add or remove SCSI devices from the system.  I
always tell people that one of the big advantages of Unix over Windows
is that devices don't shift from D: to E: to F: as you add disks, so
scripts and software still work.


This is not true for scsi-devices in linux. they change their names if
inserting new id's of the same type at lower numbers in the chain. But they do so in a easy to understand and predictable way.

The main advantage of unix is the abstraction from driveletters.
Your userr don't see any drives at all, only one big tree of directorys,
no matter where the files are stored.
But i think this is a little off Topic...
Christoph