Non-RAID Hot Swapping Help Needed

10 07 2008

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!


Actions

Informations

11 responses to “Non-RAID Hot Swapping Help Needed”

10 07 2008
troll (14:38:27) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on SuSE Linux SuSE Linux)

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?

10 07 2008
Non-RAID Hot Swapping Help Needed (14:52:57) :
   (Using WordPress WordPress 2.5)
10 07 2008
nixternal (15:06:34) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

@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!

10 07 2008
Jim (15:11:43) :
   (Using Konqueror Konqueror 4.0 on GNU/Linux GNU/Linux)

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.

10 07 2008
Jim (15:14:48) :
   (Using Konqueror Konqueror 4.0 on GNU/Linux GNU/Linux)

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.

10 07 2008
nixternal (15:37:55) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

@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!

11 07 2008
Fabian Rodriguez (06:08:29) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

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 ;)

11 07 2008
Fabian Rodriguez (06:09:44) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

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

11 07 2008
Fabian Rodriguez (06:28:29) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

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/

11 07 2008
nixternal (11:41:46) :
   (Using Mozilla Firefox Mozilla Firefox 3.0 on GNU/Linux GNU/Linux)

@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 :)

13 07 2008
zdz (11:08:50) :
   (Using Epiphany Epiphany 2.22 on GNU/Linux GNU/Linux)

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 comment

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>