Skip to contentSkip to conversation

Rescan IDE interface when no IDE devices are present

DISCUSSION Daniel De Graaf 4 participants 6 messages Jul 16, 2006 – Jul 26, 2006

lore
Share & tools
lore
#0 lore raw

My laptop has only one IDE interface (/dev/hdc), which means there are no valid IDE block devices which can be used for HDIO_SCAN_HWIF ioctl to scan for the insertion of my CD-ROM drive.

Are there alternate methods of invoking this ioctl, or for creating an open filehandle where it can be used?

#1 lore raw
Quoted 6 lines · Daniel De Graaf

My laptop has only one IDE interface (/dev/hdc), which means there are no valid IDE block devices which can be used for HDIO_SCAN_HWIF ioctl to scan for the insertion of my CD-ROM drive.

Are there alternate methods of invoking this ioctl, or for creating an open filehandle where it can be used?

If you have ide1, you have both hdc and hdd (slave of hdc) unles sit's not really IDE ...

Ben.

#2 lore raw
Quoted 4 lines · Benjamin Herrenschmidt

If you have ide1, you have both hdc and hdd (slave of hdc) unles sit's not really IDE ...

Ben.

Yes, I have /dev/hdd, but no device is ever present there. I also have /dev/sda for the SATA hard disk, but do not think it is useful for HDIO_SCAN_HWIF or HWIO_UNREGISTER_HWIF ioctls.

- Daniel

#3 lore raw

I wonder if its like my laptop: hdc is hard disk, hda is cdrom, and in this case removable so it is necessary to scan for ide0 when inserting cdrom.

#4 lore raw
In reply to Daniel De Graaf
Quoted 9 lines · Daniel De Graaf
Quoted 4 lines · Benjamin Herrenschmidt

If you have ide1, you have both hdc and hdd (slave of hdc) unles sit's not really IDE ...

Ben.

Yes, I have /dev/hdd, but no device is ever present there. I also have /dev/sda for the SATA hard disk, but do not think it is useful for HDIO_SCAN_HWIF or HWIO_UNREGISTER_HWIF ioctls.

There isn't. Feel free to write a module to do it (see how the ioctl handles it and follow the same logic). Its at best a hack. libata is trying to add proper hotplug for ATA/SATA.

Alan

#5 lore raw
Quoted 11 lines · Alan Cox
Quoted 9 lines · Daniel De Graaf
Quoted 4 lines · Benjamin Herrenschmidt

If you have ide1, you have both hdc and hdd (slave of hdc) unles sit's not really IDE ...

Ben.

Yes, I have /dev/hdd, but no device is ever present there. I also have /dev/sda for the SATA hard disk, but do not think it is useful for HDIO_SCAN_HWIF or HWIO_UNREGISTER_HWIF ioctls.

Quoted 5 lines

There isn't. Feel free to write a module to do it (see how the ioctl handles it and follow the same logic). Its at best a hack. libata is trying to add proper hotplug for ATA/SATA.

Alan

I wrote a module to do the register/unregister through a /proc file. It currently only works on ide1; the constants in scan_hw and unreg_hw should be made to depend on the value written to the /proc if other interfaces are needed. Available at
http://danieldegraaf.afraid.org/linux/ide_proc_register.c

Daniel