Scsi hotplug?

Christopher_Stanton@Dell.com Christopher_Stanton at Dell.com
Mon Sep 16 14:15:00 CDT 2002


man proc
/scsi

middle of the page states:
echo  'scsi add-single-device 1 0 5 0' > /proc/scsi/scsi

Is the man page out of date?

So, should it be
echo  'scsi add-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi
or
echo  'scsi-add-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi


Christopher Stanton
Dell Computer Corp.

Date: Mon, 16 Sep 2002 12:33:33 -0400 (EDT)
From: Nate Golnik <nate at redhat.com>
To: hordur at ejs.is
cc: Linux-Poweredge at dell.com
Subject: Re: Scsi hotplug?


First thing you have to do is make sure nothing is using the device.  
Check if you have software raid that it's been faild.  Hopefully you 
didn't have a directory hard mounted on the system.

then you must find some information on the drive that was pulled....
cat /proc/scsi/scsi

Get the HOST CHAN ID and LUN #'s for the device.  Then...

echo "scsi-remove-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi

That removes the device from the system.
Hot Add the drive

echo "scsi-add-single-device HOST CHAN DEV LUN' > /proc/scsi/scsi

Adds it back in and spins it up.

-Nate

EXAMPLE:  ASSUME IT WAS SDC REMOVEDB
# cat /proc/scsi/scsi
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02

So that would be 
host 0 Channel 0 id 3 lun 0

echo 'scsi-remove-single-device 0 0 2 0' > /proc/scsi/scsi
cat /proc/scsi/scsi
Attached devices: 
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02


Device is now gone
echo 'scsi-add-single-device 0 0 3 0' > /proc/scsi/scsi

And the device is back.

Attached devices: 
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DMVS09M          Rev: 0220
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE  Model: ST318406LC       Rev: 8A03
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: IBM      Model: DDYS-T09170M     Rev: S93E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: DELL     Model: 1x4 U2W SCSI BP  Rev: 1.16
  Type:   Processor                        ANSI SCSI revision: 02



On Mon, 16 Sep 2002 hordur at ejs.is wrote:

> 
> Hello. I was wondering if it is possible to hotplug scsi disks in linux.  
> My system is a PE1650 running RedHat 7.2 and kernel 2.4.9-31.  Someone
> thought that it would be funny to see what would happen if they just
> unplugged one of the disks, and now I need of get it back in, but I
> don't want to reboot the system. :=) And ... I dont have the PERC
> doughterboard :/
> 
> 
> Hor?ur Mar Gestsson
> hordur at ejs.is
> 
> _______________________________________________
> Linux-PowerEdge mailing list
> Linux-PowerEdge at dell.com
> http://lists.us.dell.com/mailman/listinfo/linux-poweredge
> Please read the FAQ at http://lists.us.dell.com/faq or search the list
archives at http://lists.us.dell.com/htdig/
> 


-- 
Nate Golnik			
	Red Hat System Administrator
	1801 Varsity Drive 
	Raleigh, NC 27606






More information about the Linux-PowerEdge mailing list