Swapping IDE Drives in Linux without Rebooting?
Hasufin writes "I've got quite a few of those removable IDE drive bays in my computers. I'd like to be able to swap these drives without the need of rebooting linux. I've searched quite a bit via google and other resources but haven't found a good how-to. Any pointers? I've seen few mentions to hdparm -U & -R and a script or two, but haven't had any luck using it w/ my promise udma/66 & udma/100 offboard pci controllers... :\ Any help appreciated!"
You do get hotswap IDE now, but obviously the OS needs to support it. As most modern OSs don't actually use the BIOS for disk accesses (past the kernel booting), the BIOS is a non-issue.
This is being discussed on the LKML right now!
Excessive forking causes un-wanted children.
'course, I could be wrong, but I'd imagine some of the comments in the linux kernel code might provide some hints as to how it finds the information.
Just be sure to unmount the drive first and disconnect the power cable. Then disconnect the IDE ribbon. Reverse the process with the new drive, then mount it.
If you've already got a couple of drives without mission critical data on them, you could try this. I doubt if it would damage the drives as long as you're careful. I'm not sure how Linux gets the drive's parameters, but I would guess that it can get them during the mounting, perhaps with a few command-line options if needed.
Sig (appended to the end of comments you post, 120 chars)
...is to buy a SCSI RAID card and a hot swap SCSI enclosure.
If you try this kind of shit with IDE, prepare for Deep Hurting.
Sometimes (and I know this is going to really upset a lot of slashdroids) you need to spend money to get certain features.
- A.P.
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
"read a recent man page for hdparm and you will see kernel allows remove/add ide interface. scripts with correct parameter usage are in contrib directory of hdparm source. IDE maintainer has code to electrically turn off (tristate) ide channels on most PC ide chips, but is waiting to demonstrate at an industry conference before releasing to public." -- Jeremy Jackson
Most IDE drive trays are NOT rated for hot swap, and neither are the controllers on the motherboard. To do ide hotswap the best way is an ide raid controller from either 3ware, Promise or Adaptec along with certified disk trays.
There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
I haven't tried any of these enclosures, but there are some out there that claim IDE-Hot-Swap.
See this Rackmountpro example.
-sid
If you use an external 1394/Firewire/iLink or USB hard disk, it's just an ATA disk inside. Both 1394 and USB support hot-plugging, and linux support (at least for generic devices like ATA disks) is fairly mature. As for performance, 1394 is supposedly 400 Mb (bits) per second and USB 2.0 is 480 Mb/s. You need to buy a USB 2.0 PCI card for your PC, but they aren't too much. USB 2.0 controllers are also called "EHCI". USB 2.0 devices work with USB 1.1 controllers at the standard 12 Mb/s. Search the web for "USB ATA enclosure" or "Firewire ATA enclosure" and you should find something. For portable disks, you're more likely to find USB ports on a PC, and I suspect 1394 devices are going to seem really overpriced compared to USB 2.0. But YMMV.
http://www.linux-usb.org
(you're on your own for 1394)
I know you spent money on those removable ATA caddies, but if all you want is a hot-swap ATA disk, there are other ways of getting there that are designed to do what you're after.
Democracy. Whiskey. Sexy. Pick any two.