[4755] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: Removing a unit from the chain when linux is up ?

daemon@ATHENA.MIT.EDU (Kurt Garloff)
Mon Sep 28 23:42:11 1998

Date: 	Tue, 29 Sep 1998 00:46:13 +0200
From: Kurt Garloff <garloff@kg1.ping.de>
To: Andre Doherty <doherty@evian.thonon.inra.fr>, linux-scsi@vger.rutgers.edu
Mail-Followup-To: Andre Doherty <doherty@evian.thonon.inra.fr>,
	linux-scsi@vger.rutgers.edu
In-Reply-To: <Pine.GSO.4.05.9809281925550.506-100000@evian.thonon.inra.fr>; from Andre Doherty on Mon, Sep 28, 1998 at 07:33:25PM +0200

On Mon, Sep 28, 1998 at 07:33:25PM +0200, Andre Doherty wrote:
> 
> 
> Hello,
> 
> If i turn off and remove an unit from the scsi chain when linux is up,
> what may happen ? 
> Of course, i am not talking about the main HD unit (i guess that would
> provide me a nice kernel panic), but about for instance an external
> CDrom drive. 
> 
> As i am not really familiar with scsi, i would first like to know if it
> may cause any damages to the other units. (Sorry if a bit off-topic).  
> And how will the kernel react (considering that unit is not mounted) when
> it notices the missing unit ??
> 
> Thanks a lot for any idea you might provide me,

Note that the SCSI bus was not designed to hot-plug devices. So there might
be electrical problems when doing this. 
I personally think that you only run into trouble, if a SCSI transfer is
going on when the process of unplugging happens.
Take care to have the bus terminated again after removing your device.

In software you have to do the following: 
* Umount everything from the device which is getting unplugged
* echo "scsi remove-single-device H B I L" >/proc/scsi/scsi
  where H B I L is host, bus, scsi ID, scsi LUN, e.g. 0 0 6 0

There's also a scsi add-single-device command which can be used for plugging.


-- 
Kurt Garloff, Dortmund 
<K.Garloff@ping.de>
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff
----------------------------------------------------------------------------
The following is a Python RSA implementation. According to the US Government
posting these four lines makes me an international arms trafficker!  Join me
in civil disobedience; add these lines of code to your .sig block to help get
this stupid and unconstitutional law changed.
============================================================================
from sys import*;from string import*;a=argv;[s,p,q]=filter(lambda x:x[:1]!=
'-',a);d='-d'in a;e,n=atol(p,16),atol(q,16);l=(len(q)+1)/2;o,inb=l-d,l-1+d
while s:s=stdin.read(inb);s and map(stdout.write,map(lambda i,b=pow(reduce(
lambda x,y:(x<<8L)+y,map(ord,s)),e,n):chr(b>>8*i&255),range(o-1,-1,-1)))

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post