Helge Hafting wrote:

> [question on how to hot-swap IDE]
>
> I have an IDE drive that I can disconnect and reconnect with no
> problems.  It is not on a RAID though.
> The controller is nothing special, a ultra-dma thing
> built into the shuttle motherboard.
>
> The trick seems to be unloading the IDE kernel module before
> reconnecting.  It probes the drive just fine upon reloading.
> Unfortunately you can't do that with a IDE root file system.
>
> Helge Hafting

I did some hot-swap tests with IDE drives successfully:

normally the IDE driver is compiled fix in the kernel , and even if you
compile it as a module in the 2.2.x kernels , you can not unload it
because its busy
in the case the root-fs is on the IDE disk.

The kernel probes the attached disks at boot time,
so it has a static table of the disks which are present in your machine.

I tested the following:

a soft-RAID5 array consisting of 3 disks , hda1 , hdb1 , hdc1

diring heavy writes on the raid array, I disconnected the power hdb for
example.
At this point the kernel sees that the device does not respond and
writes many messages
in the syslog.
The raid layer detects the error condition , marks the device as faulty
(you can see this in /proc/mdstat ) , and continues in degrated mode.

at this point you must issue a:

raidhotremove /dev/md0 /dev/hdb1

which removes the hdb1 device from the array
(again, check your /proc/mdstat )

now you can reconnect the disk

if it's a new blank disk you have to repartition the disk like the old
one , creating hdb1 for
example, and you can do this on the fly without a reboot (it worked for
me,
I know that there are disks where you must reboot to ensure that the new
partition table
is updated properly)

now simply type:

raidhotadd /dev/md0 /dev/hdb1

et voila': the device is added to the array and hot-reconstruction
begins in background
and in /proc/mdstat you can see the progress status of the
reconstruction.

regards,
Benno.

Reply via email to