[clug] hot-swap (hotplug) sata, Intel ICH7 controller

Andrew Janke a.janke at gmail.com
Tue Apr 24 10:01:24 GMT 2007

On 4/24/07, Steve Granger <steveg at magellan-technology.com> wrote:

> Drives are coming up as /dev/sda and /dev/sdb.

Good good, so no ata_piix wierdness is happening.

> my partitions are as such.
> /dev/md0 (/dev/sda1, /dev/sdb1)  - /boot - 150MB
> /dev/md1 (/dev/sda2, /dev/sdb2)  - swap - 2GB
> /dev/md2 (/dev/sda3, /dev/sdb3)  - / - 464GB
> I just went into the bios and changed the SATA mode from compatible to
> Enhanced. I left the SATA RAID disabled and enabled SATA AHCI booted and
> was able to unplug the device without the system hanging, the mdadm
> monitor process also told me the raid had failed!

Sorry, I forgot to mention that AHCI is needed (well it was in my case
too!).  Glad to see you found it. :)

> However cat /proc/mdstat showed that one of the raid arrays was still up
> and running. /dev/md1 still had UU status. This is the drive with the
> swap partition on it. No swap was in use. Seeing the drive didn't
> actually exist in /dev I couldn't do a
> mdadm --manage /dev/md1 --fail /dev/sdb2
> I plugged the drive back in and the drive came back up as /dev/sdc  ...
> not /dev/sdb which originally was. I rebooted and it came back up as
> /dev/sdb.
> When a drive fails will I somehow need to notify udev that it has been
> removed?

When I did this I was using scsidev so that  could get consistent
mountpoints for real SCSI devices.  I do know you can resort to
skullduggery such as this:

   echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/delete

When ejecting things on Thinkpads and the likes.  Perhaps the same has
to be done with udev and HDDs?

The other option (From a quick scan of man mdadm.conf is to use uuids
for the partitions, this should get around your problem.


More information about the linux mailing list