the solution for removing, adding, and spinning up a scsi
disk drive is:
echo "scsi remove-single-device a b c d" >/proc/scsi/scsi
echo "scsi add-single-device a b c d " >/proc/scsi/scsi
in line 2, the space after the d is important due to a bug
where:
a is Host No (usually 0)
b is Channel (usually 0 or 1)
c is Device Id
d is LUN (usually 0)
Danilo Godec wrote:
>
> On Tue, 8 Feb 2000, remo strotkamp wrote:
>
> > If I plug in a new harddisk at runtime, how do I get
> > linux to recognize that new drive????
>
> Look at /usr/src/linux/drivers/scsi/scsi.c - search for 'scsi
> add-single-device' (also look at 'scsi remove-single-device').
>
> Obviously this works only for hot-swappable SCSI stuff.
>
> > Probably the things are rather easy if you replace an existing
> > one with identical properties and partition tables....
>
> Not really... In my experience, when I removed an existing disk without
> first using the above mentioned 'scsi remove-single-device' command, the
> specific disk ID (for example 0,0,2,0) would sort of hang and wouldn't be
> removed/released later. Since my hot-swap backplane had fixed IDs I was
> unable to add a new disk (since 0,0,2,0 was already in use and hung).
>
> > But what about bad blocks for example??? Will it take over
> > the bad blocks from the old drive or check the badblocks from
> > the new one ( I mean I could still make a e2fsck -c over all the
> > partitions to get around this)...
>
> It's not as easy as just swaping the drives... It alway comes down to some
> manual work (at least fdisk and raidhotadd). You have to manually create
> the partition, but I don't know what happens with bad blocks (hopefully a
> new replacement drive has none).
>
> D.
>
> PS: If I'm doing something wrong, I'd love to be educated! :)