sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #23782
Re: Reset af IDE controller
> Hej,
>
> Kan man på en eller anden måde få Linux til at resette IDE controlleren og
> få den til at søge efter diske igen?
> Jeg ved godt at det IDE systemet ikke er beregnet på hotplug, men hvis jeg
> nu ikke har noget imod at satse min controller, diske, og andet
> indvolveret hardware findes der så ikke en måde hvor jeg kan få en ny disk
> til at virke uden reboot?
> Det er irreterende at boote hvis man har en høj oppetid! Men man kan jo
> komme til at opleve pladsmangel.
En af mine kammarater har brugt nedenstaaende til at undgaa boot ved
skift i sin harddiskskuffe. Men det er vist en aeldre kerne, og der
er ingen garantier.
----------------------------------------------------------------
Path: news.th-darmstadt.de!hertz.ikp.physik.th-darmstadt.de!not-for-mail
From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Newsgroups: comp.os.linux.development.system
Subject: Re: mount removable harddisk?
Date: 28 Feb 1997 16:38:12 GMT
Organization: Technische Hochschule Darmstadt
Lines: 75
Message-ID: <5f71lk$tbq@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <5f53v0$n8q@xxxxxxxxxxxxx> <5f5h1v$r25$1@xxxxxxxxxxxxxxxxxxx>
NNTP-Posting-Host: hertz.ikp.physik.th-darmstadt.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [UNIX 1.3 unoff BETA 970212; i586 Linux 2.0.29]
Damian Maxwell <cscdkm@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
: Jesper Holm Olsen (dunkel@xxxxxxx) wrote:
: : I have tried to insert the harddisk while the system was booted
: : and then tried to mount it, but mount complains that "device is
: : not a block device. I think this is because the kernel have not
: : yet "probed" the IDE bus, as it does at boot-up.
: [...]
: : Is there a way to make the kernel aware of the inserted harddisk,
: : so that I can mount it?
(sorry, I didn't receive the original post yet)
The IDE subsystem has some rough hooks to rescan an unused IDE bus. I use
this on a Triton board, where the second chanel only connects to a removable
hard disk tray.
This is for 2.0.x. From what I read, things are easier for 2.1, also I
didn't see a proposal how to do the task you request.
You must configure your kernel with:
CONFIG_BLK_DEV_IDE_PCMCIA=y
This gives you access to an exported kernel function:
int ide_register(int io_base, int ctl_port, int irq)
I wrote this stupid module
#include <linux/config.h>
#include <linux/module.h>
#include <linux/hdreg.h>
#include <linux/kernel.h>
#include "linux/version.h"
static int host;
int init_module(void)
{
host = ide_register(0x170, 0x376, 15);
if (host == -1)
{
printk(KERN_NOTICE "IDE-Register failed on host %d \n", host);
return host;
}
printk(KERN_NOTICE "IDE-Register successfull on host %d \n", host);
return 0;
}
void cleanup_module(void)
{
printk(KERN_NOTICE "Trying to ide_unregister host %d\n", host);
ide_unregister(host);
}
/*
elektron:~/tmp/misc> gcc -O2 -Wall -D__KERNEL__ -I/usr/src/linux/include\
-DMODULE -DCPU=586 -c -o ideinsert.o ideinsert.c
Copyright Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
based on another module as example from
Copyright David Hinds <dhinds@xxxxxxxxxxxxxxxxxx>,
*/
Compile as a module.
Insert the module, the second bus should be recscanned and some device
recognized.
Mount the devices. Work on them.
Unmount them, then remove the module.
There is no locking, so use at your own risk.
--
Uwe Bonnes bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
-- end of forwarded message --
--
Uwe Bonnes bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Rasmus(rasmus@xxxxxxx)
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but
they've always worked for me. - Hunter S. Thompson
References