Non-RAID Hot Swapping Help Needed

July 10th, 2008  |  Published in Help  |  11 Comments

OK, since the lazyweb totally owned in helping me locate a killer portable media device, I can use your help once again.

I have Googled and Googled until my eyes have exploded, and I have yet to find the answer I am looking for.

The question….Can you hot swap, not warm swap, SATA drives in Linux without having them a) setup in RAID, and b) not using a hardware RAID controller card? Someone told me that you can and the kernel works out of the box that way. Well, whoever told me was wrong. I have tried it in Red Hat, CentOS, Ubuntu, and SUSE. No go, the kernel panics and blows up and I have to call the Chicago Fire Department :)

Warm swapping works just fine, where I unmount the drive, pull the drive, put in a new drive, configure drive, and then mount the drive. That works, but when a drive fails that isn’t on a RAID controller, or is on one, and isn’t configured with RAID, I want to a) know about it, and b) pull it out without unmounting and what not first.

So, I know there are some of you wizards out there that can help me, so please, any information you may have or questions, please comment or feel free to email me directly (nixternal kubuntu org). Thanks!

Responses

  1. trollNo Gravatar says:

    July 10th, 2008 at 14:38:27 (#)

    Such kernel option indeed exists, but I think it changes only behaviour of the general interface driver for sata/scsi. It does not help you with mounting and such things. I guess what is hot swapping for the kernel developers isn’t quite what you think it is.

    Why on earth would you attempt anything like that in the first place?

  2. Non-RAID Hot Swapping Help Needed says:

    July 10th, 2008 at 14:52:57 (#)

    [...] http://blog.nixternal.com/2008.07.10/non-raid-hot-swapping-help-needed/ asks Hoosgot, [...]

  3. nixternalNo Gravatar says:

    July 10th, 2008 at 15:06:34 (#)

    @troll – thanks! Ya, it really isn’t hot swap it is really warm swap. The reason we are doing this is only for one of our appliances. It has 3 750GB (soon to be 1TB) drives that are the data drives. Our entire system has its own rebuilder which fixes any partition that breaks on its own, so we do not need RAID and plus we have the performance loss which we don’t want at all. We want to squeeze every bit of performance we can on these storage boxes, which aren’t like SANs or anything like that. Thanks for the quick comment!

  4. JimNo Gravatar says:

    July 10th, 2008 at 15:11:43 (#)

    Did you try echo “scsi remove-single-device ” >/proc/scsi/scsi before unplugging the device? I use this all the time when a disk fails on scsi, sata and sas devices. It works quite well on 2.6 kernels. Also swapoff if you’re using swap on the device.

    There are a couple of issues with this, though. First, it can cause the box to crash. Doesn’t happen too often, mostly only on 2.4 kernel. Second, sometimes when you add a replacement disk with scsi add-single-device it gets a different device letter. e.g. remove sdb and add it back and it becomes sdc.

  5. JimNo Gravatar says:

    July 10th, 2008 at 15:14:48 (#)

    hmm… it removed everything i put in brackets. so lets try that command syntax again. echo “scsi remove-single-device host bus target lun”. e.g. echo ’scsi remove-single-device 0 0 1 0″ will remove sdb.

  6. nixternalNo Gravatar says:

    July 10th, 2008 at 15:37:55 (#)

    @Jim – ya, I read about the sdb becoming sdc and then fixing itself after rebooting as well. I know I have done this in the past with and without RAID, but I think that was all configured with the Compaq DL380s back then. Thanks!

  7. Fabian RodriguezNo Gravatar says:

    July 11th, 2008 at 06:08:29 (#)

    Mhh… sorry for stating the obvious but… put them in external enclosures / docks ?

    Check this dock:
    http://www.tigerdirect.ca/applications/SearchTools/item-details.asp?EdpNo=3516746&Sku=T925-1219

    This reviewer used it with Ubuntu 8.04 and it works out of the box.

    You may also use enclosures wich will better protect the drives, and have USB, firewire, network AND eSata connectors, so you can choose whatever works faster for you.

    Would that be what you want ? Next time ask the lazy web BEFORE spending your time on it ;)

  8. Fabian RodriguezNo Gravatar says:

    July 11th, 2008 at 06:09:44 (#)

    Oh, and ask mneptok where the best deal for docks is, I think he just got one :)

  9. Fabian RodriguezNo Gravatar says:

    July 11th, 2008 at 06:28:29 (#)

    Oh and external storage device assignments can be configured permanently by using the devices UUIDs in /etc/fstab (instead of device names). UUIDs can be fetched from this command:
    ls -l /dev/disk/by-uuid/

  10. nixternalNo Gravatar says:

    July 11th, 2008 at 11:41:46 (#)

    @Fabian – ya, lazy web from this point forward :) Anyways, the reason that works is because it converts the SATA drive to a USB drive, which everyone knows that USB is easily hot swappable. From the looks of it, warm swapping will be the route we will have to go. This system is a 2U setup that has 4 hot swappable drive bays. Oh this is so much fun :)

  11. zdzNo Gravatar says:

    July 13th, 2008 at 11:08:50 (#)

    Modern way of signalling kernel that you are about to remove device is:
    echo 1 > /sys/bus/scsi/devices/0:0:0:0/delete

    change 0:0:0:0 to your device address.

Leave a Response

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">