Swapping IDE Drives in Linux without Rebooting? 77
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!"
Re:power? (Score:4, Informative)
Re:power? (Score:3, Informative)
'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.
Re:power? (Score:1)
Re:power? (Score:2, Insightful)
Re:power? (Score:1)
Re:power? (Score:1)
Re:power? (Score:1)
Check LKML (Score:2, Informative)
Re:Check LKML (Score:4, Informative)
Hmmm... (Score:1)
Hate to respond to an anonymous coward, but... (Score:1)
Re:Might not work (Score:1)
Re:Might not work (Score:1)
Try this... (Score:5, Informative)
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.
Re:Try this... (Score:2, Informative)
Re:Try this... (Score:1)
seems like a big risk to take...
Re:Try this... (Score:2)
No kidding. Read this thread and tell and tell me how confident it would make anyone trying to hotswap IDE.
Re:Try this... (Score:1)
Re:Try this... (Score:2)
It's all about tradeoffs.
Re:Try this... (Score:1)
That fast enough for you?
Re:Try this... (Score:2)
Granted, it is vastly improved over USB 1.0, USB has caught up with IEEE1394, and there are IEEE1394 HDD's. But I still don't think they're worth holding anything other then "dumb data", things like video, mp3, etc...
*BUT*, if being hot-swappable is worth a drop in access times, then I agree that this would be a good fix.
Re:Try this... (Score:2)
This is a sure way to fry an onboard ide-controller, however.
what's the big deal? (Score:1)
I've never had problems with power or data loss.
hot-swapping (Score:5, Funny)
The correct procedure... (Score:5, Informative)
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.
Re:The correct procedure... (Score:1, Informative)
3ware has some excellent cards and hotswap enclosures. And a RAID5 with 3ware is more reliably, because a single cable problem can only take out one drive, instead of the whole chain.
From lkml (Score:4, Informative)
Warning! (Score:4, Informative)
Re:Warning! (Score:2, Informative)
/Pedro
Re:Warning! (Score:2)
IDE Enclosures that claim "hot swap" (Score:2, Informative)
See this Rackmountpro [rackmountpro.com] example.
-sid
swaping the OS or just a mount? (Score:2)
If you are talking about swaping out a drive that is running your OS I'd say forget it. I don't think most IDE are made for that.
Would this even work? (Score:1, Flamebait)
The best bet would be to get a USB/IDE external tray/case (because USB was designed for these kinds of hot-swap shennanigans). THAT would work. Serial ATA might also be able to do this when it hits the streets.
I can't even see how you'd do it with single drive array in a RAID controller/cabinet with hot-swap trays because even though the array config data is written on the drives themselves (so you can swap controllers), pulling one drive and plugging in another, the controller would still expect to see the same array, which it wouldn't. You'd have to get the controller to refresh itself with the new array data.
Re:Would this even work? (Score:1)
SCSI and Fibre Channel controllers are designed to handle just this sort of thing, no problem. Real Operating Systems can start or stop a device live, rescan a bus to see if something new showed up or something old went away, they can do pretty much everything live.
IDE on the other hand is a steaming pile of shit. I love the way that great IDE advancements are all just implementations of long-standing SCSI features. Five more years, and IDE will have the entire SCSI command set. Way to innovate, IDE!
One way to do it (Score:1)
Then a promise ide controller (fasttrack 100, not used for raid in hardware just as 2 extra ide buses).
Compile IDE support for the onboard controller in the kernel. Compile the promise support as a module.
To hotswap, umount the disks on that controller, and rmmod the module.
Make any changes
insmod the module, remount the drives.
Upon module load, it rescans the controller to get the new drive geometry data, so if disks change it all works.
Only problems are if you have a module that controls multiple IDE cards.
If your hotswapping a drive in and out without changing the drive, you dont even need to do that. just unmount and its good to go.
THe module thing is only needed if the drives gemetry changes (IE replaced with a different drive that isnt an identical modal)
OS support for hotswap IDE is shaky, cuz people that need that feature can generally spend the money on the right hardware to do it.
--Jon
IDE isn't, but Firewire is... (Score:2, Interesting)
I think that the last time I checked, these controllers were around $40-50... And firewire's very cool.
A "spin down" command for IDE? or even for SCSI? (Score:2)
Does any such command exist for standard EIDE controllers/drives? Or even in any standard Unix (preferably FreeBSD) SCSI drivers for non-FCAL drives?
Without a spin-down and disconnect, hot-swap seems like it must pose some risk, however slight.
Not really a danger (Score:1)
Unless you're doing something bizarre, like using drives like removable storage, if you're pulling a drive, you're past the point of caring about the data.
Re:A "spin down" command for IDE? or even for SCSI (Score:2)
-Y Force an IDE drive to immediately enter the lowest power consumption sleep mode, causing it to shut down completely. A hard or soft reset is required before the drive can be accessed again (the Linux IDE driver will automatically handle issuing a reset if/when needed). The current power mode status can be checked using the -C flag.
BIOS (Score:1)
Re:BIOS (Score:1)
Floppy Drives (Score:2)
Is it safe to just plug it in or do I need to power-down the system? Powering-down is a last-resort seeing the system is a server.
Re:Floppy Drives (Score:2)
unless you have an urgent need for it, i'd leave it disconnected, but put a note on the front, and maybe one on the os too.. that lets anybody who would be shutting it down or rebooting it know, that while its down, they may as well hook up the floppy power cable
It works on Win2k Pro... (Score:1)
Re:It works on Win2k Pro... (Score:1)
Re:It works on Win2k Pro... (Score:1)
If you're plugging them in by hand, make sure.. (Score:1)
I once tried to plug a drive in, out of laziness, without turning the system off. While fumbling around trying to get the cables in, I had the power the wrong way up, tried to put it in, and it got close enough to spark - blowing the drive. I got a sweet smell of burning chips (the silicon, not potatoe variety), and some nice 'bubbles' on one chip in particular.
Needless to say, I wasn't very happy, and always turn the PC off first now..
Use 1394 or USB 2.0 (Score:3, Informative)
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.
Familiar Linux may teach you a lesson... (Score:1)