[4978] in linux-scsi channel archive

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

Re: Howto: rescan scsi bus after a hot swap ??

daemon@ATHENA.MIT.EDU (Hardware Stuff)
Fri Oct 23 07:15:15 1998

Date: 	Fri, 23 Oct 1998 04:13:33 -0700
From: Hardware Stuff <mrfixit@clouddancer.com>
To: Chiaki.Ishikawa@personal-media.co.jp
CC: linux-scsi@vger.rutgers.edu, ncr53c810@Colorado.EDU
In-reply-to: <199810230817.RAA09323@sparc18.personal-media.co.jp> (message
	from Chiaki Ishikawa on Fri, 23 Oct 1998 17:17:48 +0900 (JST))
Reply-to: mrfixit@clouddancer.com


   From: Chiaki Ishikawa <Chiaki.Ishikawa@personal-media.co.jp>

   Hello,

Thanks for the information, encouraged by your reply (and the others),
I decided to give it a try (after bringing down the system to a point
where possible damage would be minimal).

   I am not sure what your hardware requirements are, but

   >Now, I know it's possible, since the latest RAID5 can perform a hot
   >reconstruction even when the drive devices reshuffle.  I also wonder
   >how to use the above method when I remove a drive and replace it with
   >a different sized drive at the same ID.

   let me assume that all hardware-related problems are solved one way or 
   the other (hot pluggability, etc.), then this is the outline of what
   you can do in theory:

I think that those comments in the code are CYA.  If one is careful,
hot swapping isn't that difficult, especially on an unused SCSI bus.


   1. umount all the mounted files on the HD.

   2. I think there is a delete-single-device that you can use.
   The format is 

	   echo "scsi delete-single-device H C I L" > /proc/scsi/scsi

      so that you can let the controller forget(?) the
      ID for a moment.

yes this works nicely.  running cat /proc/scsi/scsi will supply you
with the necessary information.  The kernel removes the device and
forgets everything associated with it.  A bit of perl would allow a
user to specify sd[abcd..] instead of the quad of numbers.


   3. Exchange the hard disks.
     (Again, whether you can do this electrically or not is up to your
      particular hardware setup.)

   4. Let linux recognize the hard disk at the given ID again using

	   echo "scsi add-single-device H C I L" > /proc/scsi/scsi 

      This ought to let linux recognize the new device...

Yup, worked fine (once I remembered what the ID was).


   However, I have to be honest.

   I have not used delete-single-device SCSI subsystem command myself
   although I used add-single-device command a lot.
   I used add-single-device command to let a Tekram DC390 SCSI controller
   recognize my SCSI 7 CDROM changer device: one CD at each LUN.
   I add the CDROM one by one using add-single-device. It works just fine.
   At boot time, I disabled the multi-lun scan of the DC390 due to
   a problem with the OS/2 driver for the said card on the same machine.
   This is why I have to add the logical units afterward manually.

Hmm..why not make it part of the rc boot scripts?

   I don't know if delete-single-device works with your particular
   controller card. If I recall correctly the DC390 device driver had to
   be tweaked to support add-single-device correctly (thanks to the
   current maitainer of DC390 driver, Kurt Garloff).

It's a Symbios 53X876 with the latest drivers.  This command works fine.


   Another thing that may complicate the procedure is what happens to the
   /dev/sdX name assigned to the original disk.  Say, in the step 4, is
   the newly added disk given the SAME /dev/sdX name or the next
   available name /dev/sdX'?

   Eg. If the original disk was /dev/sdb,
   do we get /dev/sdb for the new disk, or do we get 
   the next free name, say, /dev/sdd if we already have /dev/sda,
   /dev/sdb, and /dev/sdc and have just removed the /dev/sdb in step 2?.

   Naturally, we want the same name, say /dev/sdb in the above example.
   But who knows?

And the answer is: when it's the last drive, the new drive gets the
old drive id.  Alas, I only have two drives in the system just now
(not the normal 5-6), so I don't really know what happens when the
swapped drive is in the middle.  My guess would be that the ids stay
stable, but that's a SWAG.

Plus, I'm sure that the devfs users would just in an point out that
their system solves this problem.

Thanks!!

-
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