lkml.org 
[lkml]   [1999]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: re-scan ide devices
Date
> when I'm trying to re-scan the IDE devices, I get Input/output error,
> meaning ide_register() function fails... why, and how to fix?
> kernel: 2.2.10
>
> void
> rescan_hwif(int channel)
> {
> int fd;
> int ide[][3] =
> {
> {0x1f0,0x3f6,14},{0x170,0x376,15}
> };
>
> fd=open("/dev/hda", O_RDONLY);
> ioctl(fd, HDIO_SCAN_HWIF, ide[channel]);

The drives on the re-scanned channel must not be in use (mounted,
ioctl-operated, etc.).
If you want to rescan sth on the first IDE channel, you must:
- umount everything from /dev/hdax, dev/hdbx
- swapoff -"- -"- -"-
- use an existing drive from another channel in fopen(), eg. hdc

These are ioctl() limitations...

--
=======================================================================
Andrzej M. Krzysztofowicz ankry@mif.pg.gda.pl
phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math., Technical University of Gdansk


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.026 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site