Complete.Org: Mailing Lists: Archives: discussion: September 1998:
Re: [aclug-L] SCSI question
Home

Re: [aclug-L] SCSI question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: Re: [aclug-L] SCSI question
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: 09 Sep 1998 21:14:36 -0500
Reply-to: aclug-L@xxxxxxxxxxxx

Dale W Hodge <dwh@xxxxxxxxxxxx> writes:

> I've got a question about scsi devices. It appears that I have to have my
> scsi devices on when I boot or Linux doesn't seem to see them.  Is this
> the normal thing, and is there any way around this?  I have an external
> tape drive that I swap between Linux and Win95 machines. I'd like to be
> able to simply connect/disconnect as needed, rather than rebooting.  Any
> suggestions?

OK, the easiest solution is this..  If none of your SCSI devices is
mounted at boot, you can compile your SCSI low-level driver as a
module.  Then, modprobe it when you turn on your devices, and rmmod it 
after turning them off.  This gives you the most flexibility since
with most cards, you can even physically break the SCSI chain
(physically detach a device) if the driver is not loaded when you do
it.

If, OTOH, your SCSI card also supports some disks that are mounted at
boot, things are more difficult.  It is not possible to physically
break the chain once the system has booted in this case -- if all of
your devices are connected but not necessarily turned on at boot,
you're OK, but if they are not all connected at boot, you'll have to
reboot in order to make things work.  Never break a live SCSI chain.

If the situation is that a device is connected at boot but not turned
on, you can do this:

echo "scsi add-single-device 0 0 6 0" > /proc/scsi/scsi

The numbers are:

 * SCSI host/controller number (0 for first or only controller)
 * SCSI channel number.  Most controllers have only one, so it is
   usually 0.
 * SCSI ID, set by the device.  This is generally anything except 7.
 * LUN -- generally 0 except on things like CD changers and RAID
   units.

You can find out these values by looking at dmesg's output, eg:

  Detected scsi tape st0 at scsi0, channel 0, id 6, lun 0

This corresponds to the command I gave above.

To remove a device, BEFORE TURNING IT OFF, try:

echo "scsi remove-single-device 0 0 6 0" > /proc/scsi/scsi

John

-- 
John Goerzen   Linux, Unix consulting & programming   jgoerzen@xxxxxxxxxxxx |
Developer, Debian GNU/Linux (Free powerful OS upgrade)       www.debian.org |
----------------------------------------------------------------------------+
Visit the Air Capital Linux Users Group on the web at http://www.aclug.org
---
This is the Air Capitol Linux Users Group discussion list.  If you
want to unsubscribe, send the word "unsubscribe" to
aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
message to aclug-L@xxxxxxxxxxxx.



[Prev in Thread] Current Thread [Next in Thread]