I was feeling bored and vaguely insane today, so I thought I would try hotswapping my cdrom drives as a challenge really.
I have two ide channels:
ide0: hda (main harddrive)
ide1: hdc && hdd (cdroms)
First I did:
#hdparm -Y /dev/hdc /dev/hdd
To put them to sleep. Took ages, but seemed to work fine.
Then I ran:
# hdparm -U 1 /dev/hdc
Took a long time, and the output went something like this:
attempting to unregister hwif#1
That was all, no error messages. Well ide1 was still in /proc/ide, but i pulled the power on the drives, then the ide cables. Plugged the ide cable into two other cdroms (I have 5 in my box.. don't ask), then the power. They spun up and did the whirry thing. The ide light on the case came on, and has been on solid since. Well ide1 was still in proc, so i had a look at /proc/ide/ide1/hdc/model and it still thought that the other drives where there. So I ran
# hdparm -R 0x170 0x376 15 /dev/hdc
At that point it seg faulted! Also ide1 disappeared from proc at this point, and /dev/hdc && /dev/hdd disappeared (I use udev). So I tried
# hdparm -R 0x170 0x376 15 /dev/hda
as the device doesn't matter really, it's just used for ioctl i believe. This spits out:
attempting to scan hwif (0x170, 0x376, 15)
HDIO_SCAN_HWIF failed: Input/output error
and this comes out in dmesg:
ide1: I/O resource 0x376-0x376 not free.
ide1: ports already in use, skipping probe
I tried running
# hdparm -U 1 /dev/hda
but it just seems to hang there.
Any ideas? (I'm happy to try most things, however insane) I will reboot soonish and try it again, see if i can get more logging out of the kernel to see what is going on.
(Yes I know this is unsupported, blah blah.. dangerous, blah blah.. )