* RE: Hot plugging a disk in runtime
@ 2002-05-20 16:34 berthiaume_wayne
2002-05-20 17:58 ` Doug Ledford
0 siblings, 1 reply; 12+ messages in thread
From: berthiaume_wayne @ 2002-05-20 16:34 UTC (permalink / raw)
To: alan; +Cc: linux-scsi, rabeeh
Will it, possibly, cause a reordering of other sd<xx> devices
already on line when scsi_init is called?
-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
Sent: Monday, May 20, 2002 9:14 AM
To: rabeeh@galileo.co.il
Cc: alan@lxorguk.ukuu.org.uk; linux-scsi@vger.kernel.org
Subject: Re: Hot plugging a disk in runtime
> * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
> * with "0 1 2 3" replaced by your "Host Channel Id Lun".
> * Consider this feature BETA.
> * CAUTION: This is not for hotplugging your peripherals. As
> * SCSI was not designed for this you could damage your
> * hardware !
> * However perhaps it is legal to switch on an
> * already connected device. It is perhaps not
> * guaranteed this device doesn't corrupt an ongoing data transfer.
> */
>
> 1.. What is meant by "SCSI was not designed for this ..." ?
SCSI itself is not. People had a habit of blowing up scsi kit trying to
hot plug stuff that was not meant that way. Obviously thats different for
hot plug certified SCA2 equipment
> 3.. What about the naming of /dev/sdxx naming of newly hot-plugged SCSI
disk ? which name does it get ? (supposly I'm not using the dev filesystem)
it gets the next free one
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 16:34 Hot plugging a disk in runtime berthiaume_wayne
@ 2002-05-20 17:58 ` Doug Ledford
0 siblings, 0 replies; 12+ messages in thread
From: Doug Ledford @ 2002-05-20 17:58 UTC (permalink / raw)
To: berthiaume_wayne; +Cc: alan, linux-scsi, rabeeh
On Mon, May 20, 2002 at 12:34:46PM -0400, berthiaume_wayne@emc.com wrote:
> Will it, possibly, cause a reordering of other sd<xx> devices
> already on line when scsi_init is called?
No, it will not move any devices that already exist. It will either
insert into the chain in the first hole it finds, or append to the end of
the chain. This way, if you have drives sda through sdd and you remove
sdb, then when you do an add, the new drive will take the now vacant sdb
slot. For the common case of wanting to replace a failed drive, this is
the perfect behaviour.
--
Doug Ledford <dledford@redhat.com> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Hot plugging a disk in runtime
@ 2002-05-20 18:11 berthiaume_wayne
0 siblings, 0 replies; 12+ messages in thread
From: berthiaume_wayne @ 2002-05-20 18:11 UTC (permalink / raw)
To: dledford; +Cc: alan, linux-scsi, rabeeh
Excellent. I assume that reboot will still have its usual discovery
methodology so if you were to hot plug in a new device and its placed at the
end of the chain, it could very well end up somewhere else after the reboot?
In other words, you have two Adaptec adapters (A & B) with two drives each.
Adapter A has sda and sdb; and adapter B has sdc and sdd. You add a new
drive to adapter A and now adapter A has sda, sdb, and sde. However, on a
system reboot adapter A would now have sda, sdb, and sdc; and adapter B
would have sdd and sde. True? Therefore, the sysadmin needs to be wise to
this modality or he's hosed at the next boot.
Wayne.
-----Original Message-----
From: Doug Ledford [mailto:dledford@redhat.com]
Sent: Monday, May 20, 2002 1:58 PM
To: berthiaume_wayne@emc.com
Cc: alan@lxorguk.ukuu.org.uk; linux-scsi@vger.kernel.org;
rabeeh@galileo.co.il
Subject: Re: Hot plugging a disk in runtime
On Mon, May 20, 2002 at 12:34:46PM -0400, berthiaume_wayne@emc.com wrote:
> Will it, possibly, cause a reordering of other sd<xx> devices
> already on line when scsi_init is called?
No, it will not move any devices that already exist. It will either
insert into the chain in the first hole it finds, or append to the end of
the chain. This way, if you have drives sda through sdd and you remove
sdb, then when you do an add, the new drive will take the now vacant sdb
slot. For the common case of wanting to replace a failed drive, this is
the perfect behaviour.
--
Doug Ledford <dledford@redhat.com> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread[parent not found: <rabeeh@galileo.co.il>]
* Hot plugging a disk in runtime
@ 2002-05-20 10:19 ` Rabeeh Khoury
2002-05-20 11:41 ` Karl Hammar
2002-05-20 11:57 ` Alan Cox
0 siblings, 2 replies; 12+ messages in thread
From: Rabeeh Khoury @ 2002-05-20 10:19 UTC (permalink / raw)
To: linux-scsi
Hi list,
I have few questions withregards to hot-plugging disk into a running
system -
1.. How is it possible to signal SCSI mid-layer (or other layers) of a
presence of a newly hot-plugged disk ?
2.. Can an adapter's device driver trigger SCSI subsystem to scan
channels for new LUNs / Targets ?
3.. Is this can be handled in a kernel level ? is there a user space
application that can be triggered to start scanning adapters (obviously
through SCSI subsystem) and registering new LUNs / Targets etc... ?
4.. How does SCSI API allow insertion of a new disk ?
5.. Is there a generic way of hot-plugging disks ?
Thank you alot,
Rabeeh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 10:19 ` Rabeeh Khoury
@ 2002-05-20 11:41 ` Karl Hammar
2002-05-20 11:57 ` Alan Cox
1 sibling, 0 replies; 12+ messages in thread
From: Karl Hammar @ 2002-05-20 11:41 UTC (permalink / raw)
To: linux-scsi
I use this script:
# cat `which sdon`
#!/bin/sh
dev=/dev/sdc
num=4
case $0 in
*off)
umount ${dev}1
scsi-spin --down $dev
echo "scsi remove-single-device 0 0 $num 0" > /proc/scsi/scsi
;;
*on)
echo scsi add-single-device 0 0 $num 0 > /proc/scsi/scsi
mount ${dev}1
;;
esac
for a disk which happens to have scsi-id 4 and shows up as /dev/sdc.
Used like, sdoff, remove disk; insert disk, let it spin up, sdon.
Regards,
/Karl
-----------------------------------------------------------------------
Karl Hammar Aspö Data karl@kalle.csb.ki.se
Lilla Aspö 2340 +46 173 140 57 Networks
S-742 94 Östhammar +46 10 270 26 67 Computers
Sweden Consulting
-----------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Hot plugging a disk in runtime
2002-05-20 10:19 ` Rabeeh Khoury
2002-05-20 11:41 ` Karl Hammar
@ 2002-05-20 11:57 ` Alan Cox
2002-05-20 11:41 ` Kaushik Datta
` (2 more replies)
1 sibling, 3 replies; 12+ messages in thread
From: Alan Cox @ 2002-05-20 11:57 UTC (permalink / raw)
To: Rabeeh Khoury; +Cc: linux-scsi
> 1.. How is it possible to signal SCSI mid-layer (or other layers) of a
> presence of a newly hot-plugged disk ?
aacraid is one example that does this, but via its config tools.
> 2.. Can an adapter's device driver trigger SCSI subsystem to scan
> channels for new LUNs / Targets ?
It is designed so user space can do so - so yes
> 3.. Is this can be handled in a kernel level ? is there a user space
> application that can be triggered to start scanning adapters (obviously
> through SCSI subsystem) and registering new LUNs / Targets etc... ?
echo "scsi-add-single-device a b c d" /proc/scsi/scsi
if I remember it right
Alan
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Hot plugging a disk in runtime
2002-05-20 11:57 ` Alan Cox
@ 2002-05-20 11:41 ` Kaushik Datta
2002-05-20 12:24 ` Rabeeh Khoury
2002-05-20 22:33 ` Oliver Xymoron
2 siblings, 0 replies; 12+ messages in thread
From: Kaushik Datta @ 2002-05-20 11:41 UTC (permalink / raw)
To: rabeeh; +Cc: linux-scsi, kdatta
A small cut'n paste from man proc !
scsi This is a listing of all SCSI devices known to the kernel. The
listing is similar to the one seen during bootup. scsi currently
supports only the add-single-device command which allows root to
add a hotplugged device to the list of known devices.
An echo 'scsi add-single-device 1 0 5 0' > /proc/scsi/scsi will
cause host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN
0. If there is already a device known on this address or the
address is invalid an error will be returned.
Alan Cox wrote:
> > 1.. How is it possible to signal SCSI mid-layer (or other layers) of a
> > presence of a newly hot-plugged disk ?
>
> aacraid is one example that does this, but via its config tools.
>
> > 2.. Can an adapter's device driver trigger SCSI subsystem to scan
> > channels for new LUNs / Targets ?
>
> It is designed so user space can do so - so yes
>
> > 3.. Is this can be handled in a kernel level ? is there a user space
> > application that can be triggered to start scanning adapters (obviously
> > through SCSI subsystem) and registering new LUNs / Targets etc... ?
>
> echo "scsi-add-single-device a b c d" /proc/scsi/scsi
>
To be precise :
echo 'scsi add-single-device a b c d ' > /proc/scsi/scsi
Thanks,
Kaushik
>
> if I remember it right
>
> Alan
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Hot plugging a disk in runtime
2002-05-20 11:57 ` Alan Cox
2002-05-20 11:41 ` Kaushik Datta
@ 2002-05-20 12:24 ` Rabeeh Khoury
2002-05-20 13:14 ` Alan Cox
2002-05-20 14:20 ` James Bottomley
2002-05-20 22:33 ` Oliver Xymoron
2 siblings, 2 replies; 12+ messages in thread
From: Rabeeh Khoury @ 2002-05-20 12:24 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-scsi
Alan Cox wrote:
>echo "scsi-add-single-device a b c d" /proc/scsi/scsi
>
>
from drivers/scsi/scsi.c : (kernel 2.4.18)
/*
* Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
* with "0 1 2 3" replaced by your "Host Channel Id Lun".
* Consider this feature BETA.
* CAUTION: This is not for hotplugging your peripherals. As
* SCSI was not designed for this you could damage your
* hardware !
* However perhaps it is legal to switch on an
* already connected device. It is perhaps not
* guaranteed this device doesn't corrupt an ongoing data transfer.
*/
1.. What is meant by "SCSI was not designed for this ..." ?
2.. SCSI architecture model (SAM-2 at least) does not mention hot-plugging storage device into a running system ; but doing so is a very common task. So, are all the SCSI hot-plug systems in the world are based on proprietry methods of hot-plug ?
3.. What about the naming of /dev/sdxx naming of newly hot-plugged SCSI disk ? which name does it get ? (supposly I'm not using the dev filesystem)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 12:24 ` Rabeeh Khoury
@ 2002-05-20 13:14 ` Alan Cox
2002-05-20 14:20 ` James Bottomley
1 sibling, 0 replies; 12+ messages in thread
From: Alan Cox @ 2002-05-20 13:14 UTC (permalink / raw)
To: Rabeeh Khoury; +Cc: Alan Cox, linux-scsi
> * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
> * with "0 1 2 3" replaced by your "Host Channel Id Lun".
> * Consider this feature BETA.
> * CAUTION: This is not for hotplugging your peripherals. As
> * SCSI was not designed for this you could damage your
> * hardware !
> * However perhaps it is legal to switch on an
> * already connected device. It is perhaps not
> * guaranteed this device doesn't corrupt an ongoing data transfer.
> */
>
> 1.. What is meant by "SCSI was not designed for this ..." ?
SCSI itself is not. People had a habit of blowing up scsi kit trying to
hot plug stuff that was not meant that way. Obviously thats different for
hot plug certified SCA2 equipment
> 3.. What about the naming of /dev/sdxx naming of newly hot-plugged SCSI disk ? which name does it get ? (supposly I'm not using the dev filesystem)
it gets the next free one
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 12:24 ` Rabeeh Khoury
2002-05-20 13:14 ` Alan Cox
@ 2002-05-20 14:20 ` James Bottomley
2002-05-21 15:42 ` Michael Clark
1 sibling, 1 reply; 12+ messages in thread
From: James Bottomley @ 2002-05-20 14:20 UTC (permalink / raw)
To: Rabeeh Khoury; +Cc: Alan Cox, linux-scsi
rabeeh@galileo.co.il said:
> 1.. What is meant by "SCSI was not designed for this ..." ?
That really refers to a very old daisy chained parallel SCSI model. Since the
whole bus is a transmission line, breaking it to add another device can cause
enormous disruption (sometimes this was bad enough to physically destroy other
devices on the bus). However, these days, you can even get hotplug enclosures
for parallel SCSI that don't need to break the bus to add new devices. And,
of course, things like Fibre Channel we're designed to be alterable on the fly
anyway.
> 2.. SCSI architecture model (SAM-2 at least) does not mention
> hot-plugging storage device into a running system ; but doing so is a
> very common task. So, are all the SCSI hot-plug systems in the world
> are based on proprietry methods of hot-plug ?
This is the province of something called the Scsi Enclosure Services (SES)
standard:
ftp://ftp.t10.org/t10/drafts/ses/ses-r08b.pdf
However, like most standards it began life as a bunch of companies each
inventing their own more or less proprietary way of doing things and then
realising that standardisation might be a good thing, so there are quite a few
not quite compatible implementations of this.
Like all good standards it's also due to be superceded (by SES-2) any day now.
There is an enclosure monitor, which I haven't looked at but which I presume
could be used as part of a hotplug system for SCSI devices:
http://gort.metaparadigm.com/saftemon/
> 3.. What about the naming of /dev/sdxx naming of newly hot-plugged
> SCSI disk ? which name does it get ? (supposly I'm not using the dev
> filesystem)
The first available one.
James Bottomley
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 14:20 ` James Bottomley
@ 2002-05-21 15:42 ` Michael Clark
0 siblings, 0 replies; 12+ messages in thread
From: Michael Clark @ 2002-05-21 15:42 UTC (permalink / raw)
To: James Bottomley; +Cc: Rabeeh Khoury, Alan Cox, linux-scsi
On 05/20/02 22:20, James Bottomley wrote:
[snip]
>This is the province of something called the Scsi Enclosure Services (SES)
>standard:
>
>ftp://ftp.t10.org/t10/drafts/ses/ses-r08b.pdf
>
>However, like most standards it began life as a bunch of companies each
>inventing their own more or less proprietary way of doing things and then
>realising that standardisation might be a good thing, so there are quite a few
>not quite compatible implementations of this.
>
>Like all good standards it's also due to be superceded (by SES-2) any day now.
>
>There is an enclosure monitor, which I haven't looked at but which I presume
>could be used as part of a hotplug system for SCSI devices:
>
>http://gort.metaparadigm.com/saftemon/
>
>
saftemon currently only does SAF-TE and not SES - but if you have a SAF-TE
enclosure, it will give you an event when a disk has been inserted into an
empty slot (or removed).
There is even some (currently not activated) code in there to map SAF-TE
slots to the corresponding Linux SCSI device. This of course only works if
you have physical disk devices on the SCSI bus as logical (RAID) devices
can't be correllated easily to device slots (not unless you have an API
to do
get the mappings from your RAID controller).
It would be quite nice to get saftemon events to trigger Software RAID
commands in a Software RAID set-up such as doing a device probe and
maybe a raid hot add when a new disk is inserted.
~mc
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Hot plugging a disk in runtime
2002-05-20 11:57 ` Alan Cox
2002-05-20 11:41 ` Kaushik Datta
2002-05-20 12:24 ` Rabeeh Khoury
@ 2002-05-20 22:33 ` Oliver Xymoron
2 siblings, 0 replies; 12+ messages in thread
From: Oliver Xymoron @ 2002-05-20 22:33 UTC (permalink / raw)
To: Alan Cox; +Cc: Rabeeh Khoury, linux-scsi
On Mon, 20 May 2002, Alan Cox wrote:
> > 1.. How is it possible to signal SCSI mid-layer (or other layers) of a
> > presence of a newly hot-plugged disk ?
>
> aacraid is one example that does this, but via its config tools.
>
> > 2.. Can an adapter's device driver trigger SCSI subsystem to scan
> > channels for new LUNs / Targets ?
>
> It is designed so user space can do so - so yes
>
> > 3.. Is this can be handled in a kernel level ? is there a user space
> > application that can be triggered to start scanning adapters (obviously
> > through SCSI subsystem) and registering new LUNs / Targets etc... ?
>
> echo "scsi-add-single-device a b c d" /proc/scsi/scsi
>
> if I remember it right
If I recall correctly, that code is more than a little bit racy. You're
probably just fine adding a device here and there, but adding a couple
dozen all at once makes things unhappy. Never finished debugging it though
- it seemed in need of a major rewrite.
--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-05-21 15:42 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-20 16:34 Hot plugging a disk in runtime berthiaume_wayne
2002-05-20 17:58 ` Doug Ledford
-- strict thread matches above, loose matches on Subject: below --
2002-05-20 18:11 berthiaume_wayne
[not found] <rabeeh@galileo.co.il>
2002-05-20 10:19 ` Rabeeh Khoury
2002-05-20 11:41 ` Karl Hammar
2002-05-20 11:57 ` Alan Cox
2002-05-20 11:41 ` Kaushik Datta
2002-05-20 12:24 ` Rabeeh Khoury
2002-05-20 13:14 ` Alan Cox
2002-05-20 14:20 ` James Bottomley
2002-05-21 15:42 ` Michael Clark
2002-05-20 22:33 ` Oliver Xymoron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox