* LUN resizing
@ 2003-11-25 9:34 Stefan Voelkel
2003-11-25 15:43 ` James Bottomley
0 siblings, 1 reply; 10+ messages in thread
From: Stefan Voelkel @ 2003-11-25 9:34 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]
Hello,
a hypothetical question:
I have a Linux box connected to a Fibre SAN. Now I'd like to resize one
LUN and tell my Linux box what happened. In other words can I _live_
resize a SCSI disk?
[ let's not talk about which filesystems are capable of live
resizing :) ]
* Is this possible at all, eg does the SCSI Standard include
something to enable a device to tell the host about the changed
geometry (SENSE DATA, ...) ?
* Is it possible with Linux, eg does the block layer/scsi layer
support it? any problems with the partition code?
* If there are problems, are they solveable, any plans on working
on them or is already someone working on this?
Two options come to my mind:
* LVM, just define a new LUN, add it to the group, and resize
* echo remove-single-device ... > /proc/scsi/scsi (would not be
life)
regards
Stefan
--
--------------------------------------------------------------------
Stefan Völkel stefan.voelkel@millenux.com
Millenux GmbH mobile: +49.170.79177.17
Lilienthalstraße 2 phone: +49.711.88770.300
70825 Stuttgart-Korntal fax: +49.711.88770.349
-= linux without limits -=- http://linux.zSeries.org/ =-
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: LUN resizing
2003-11-25 9:34 LUN resizing Stefan Voelkel
@ 2003-11-25 15:43 ` James Bottomley
2003-11-25 16:11 ` James Bottomley
2003-11-25 19:34 ` Lincoln Dale
0 siblings, 2 replies; 10+ messages in thread
From: James Bottomley @ 2003-11-25 15:43 UTC (permalink / raw)
To: Stefan Voelkel; +Cc: SCSI Mailing List
On Tue, 2003-11-25 at 03:34, Stefan Voelkel wrote:
> I have a Linux box connected to a Fibre SAN. Now I'd like to resize one
> LUN and tell my Linux box what happened. In other words can I _live_
> resize a SCSI disk?
>
> [ let's not talk about which filesystems are capable of live
> resizing :) ]
>
> * Is this possible at all, eg does the SCSI Standard include
> something to enable a device to tell the host about the changed
> geometry (SENSE DATA, ...) ?
The pull command is READ_CAPACITY. For pushing this information,
there's nothing really standard, although some type of proprietary AEN
could be adapted.
> * Is it possible with Linux, eg does the block layer/scsi layer
> support it? any problems with the partition code?
> * If there are problems, are they solveable, any plans on working
> on them or is already someone working on this?
You simply do
echo 1 > /sys/bus/scsi/<device>/rescan
It will re-read the capacity and partition table (as long as the device
is unmounted and none of the partitions open).
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
2003-11-25 15:43 ` James Bottomley
@ 2003-11-25 16:11 ` James Bottomley
2003-11-26 9:45 ` Stefan Voelkel
2003-11-25 19:34 ` Lincoln Dale
1 sibling, 1 reply; 10+ messages in thread
From: James Bottomley @ 2003-11-25 16:11 UTC (permalink / raw)
To: James Bottomley; +Cc: Stefan Voelkel, SCSI Mailing List
On Tue, 2003-11-25 at 09:43, James Bottomley wrote:
> You simply do
>
> echo 1 > /sys/bus/scsi/<device>/rescan
>
> It will re-read the capacity and partition table (as long as the device
> is unmounted and none of the partitions open).
OK, I actually tried this, you need two steps. The one above will
reread the capacity. After that you send a BLKRRPART ioctl to the
device to re-read the partition table. (but, obviously, something else
will have to update the partition table to see the new device size)
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
2003-11-25 16:11 ` James Bottomley
@ 2003-11-26 9:45 ` Stefan Voelkel
2003-11-26 9:48 ` Christoph Hellwig
0 siblings, 1 reply; 10+ messages in thread
From: Stefan Voelkel @ 2003-11-26 9:45 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]
On Tue, 2003-11-25 at 17:11, James Bottomley wrote:
> On Tue, 2003-11-25 at 09:43, James Bottomley wrote:
> > You simply do
> >
> > echo 1 > /sys/bus/scsi/<device>/rescan
> >
> > It will re-read the capacity and partition table (as long as the device
> > is unmounted and none of the partitions open).
>
> OK, I actually tried this, you need two steps. The one above will
> reread the capacity. After that you send a BLKRRPART ioctl to the
> device to re-read the partition table. (but, obviously, something else
> will have to update the partition table to see the new device size)
Ok, that is a step in the right direction, as it will not disrupt
operations of other devices on the same bus.
But I want to be able to do it with a mounted partition, something like
"device size hotpluging". I don't know if that is the right term, but
think of the 2.7 memory hotplug plans.
* in the SAN I add space to my LUN
* then I hit my linux box on the head to get it to send a
read_capacity and update the size of the device.
* run a nifty tool that creates a new partition table and writes
it to the device.
* use newly gained space
so what we actually need is:
* a way to force the scsi stack to send out a read_capacity and
act on it (perhaps another /sys/ entry?), perhaps a hotplug
event that creates a new partition table, eg add the new space
as "unused" at the end of the device, write that table and
ioctl() to reread it.
* a way to fiddle around with live partitions, a userspace tool
with a way to tell the kernel supsend/reactivate io on that
block device. it would have to take care of the filesystems
residing on the device.
regards
Stefan
--
--------------------------------------------------------------------
Stefan Völkel stefan.voelkel@millenux.com
Millenux GmbH mobile: +49.170.79177.17
Lilienthalstraße 2 phone: +49.711.88770.300
70825 Stuttgart-Korntal fax: +49.711.88770.349
-= linux without limits -=- http://linux.zSeries.org/ =-
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: LUN resizing
2003-11-26 9:45 ` Stefan Voelkel
@ 2003-11-26 9:48 ` Christoph Hellwig
2003-11-28 10:08 ` Stefan Voelkel
0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2003-11-26 9:48 UTC (permalink / raw)
To: Stefan Voelkel; +Cc: James Bottomley, SCSI Mailing List
On Wed, Nov 26, 2003 at 10:45:11AM +0100, Stefan Voelkel wrote:
> * a way to force the scsi stack to send out a read_capacity and
> act on it (perhaps another /sys/ entry?), perhaps a hotplug
> event that creates a new partition table, eg add the new space
> as "unused" at the end of the device, write that table and
> ioctl() to reread it.
> * a way to fiddle around with live partitions, a userspace tool
> with a way to tell the kernel supsend/reactivate io on that
> block device. it would have to take care of the filesystems
> residing on the device.
No way. You're better of using a proper volume manager instead of doing
this paritioning mess.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
2003-11-26 9:48 ` Christoph Hellwig
@ 2003-11-28 10:08 ` Stefan Voelkel
2003-11-28 10:23 ` Christoph Hellwig
2003-11-28 16:18 ` James Bottomley
0 siblings, 2 replies; 10+ messages in thread
From: Stefan Voelkel @ 2003-11-28 10:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: James Bottomley, SCSI Mailing List
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]
On Wed, 2003-11-26 at 10:48, Christoph Hellwig wrote:
> On Wed, Nov 26, 2003 at 10:45:11AM +0100, Stefan Voelkel wrote:
> > * a way to force the scsi stack to send out a read_capacity and
> > act on it (perhaps another /sys/ entry?), perhaps a hotplug
> > event that creates a new partition table, eg add the new space
> > as "unused" at the end of the device, write that table and
> > ioctl() to reread it.
> > * a way to fiddle around with live partitions, a userspace tool
> > with a way to tell the kernel supsend/reactivate io on that
> > block device. it would have to take care of the filesystems
> > residing on the device.
>
> No way. You're better of using a proper volume manager instead of doing
> this paritioning mess.
True, let's forget about the partitions: mount /dev/sda /home.
--
--------------------------------------------------------------------
Stefan Völkel stefan.voelkel@millenux.com
Millenux GmbH mobile: +49.170.79177.17
Lilienthalstraße 2 phone: +49.711.88770.300
70825 Stuttgart-Korntal fax: +49.711.88770.349
-= linux without limits -=- http://linux.zSeries.org/ =-
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: LUN resizing
2003-11-28 10:08 ` Stefan Voelkel
@ 2003-11-28 10:23 ` Christoph Hellwig
2003-11-28 16:18 ` James Bottomley
1 sibling, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2003-11-28 10:23 UTC (permalink / raw)
To: Stefan Voelkel; +Cc: James Bottomley, SCSI Mailing List
On Fri, Nov 28, 2003 at 11:08:49AM +0100, Stefan Voelkel wrote:
> > No way. You're better of using a proper volume manager instead of doing
> > this paritioning mess.
>
> True, let's forget about the partitions: mount /dev/sda /home.
Indeed. If you're resizing luns they're most likely virtualized
alreday anyway :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
2003-11-28 10:08 ` Stefan Voelkel
2003-11-28 10:23 ` Christoph Hellwig
@ 2003-11-28 16:18 ` James Bottomley
1 sibling, 0 replies; 10+ messages in thread
From: James Bottomley @ 2003-11-28 16:18 UTC (permalink / raw)
To: Stefan Voelkel; +Cc: Christoph Hellwig, SCSI Mailing List
On Fri, 2003-11-28 at 04:08, Stefan Voelkel wrote:
> True, let's forget about the partitions: mount /dev/sda /home.
OK, Let's try again in simpler terms.
The problem you are trying to solve has three components:
1. Filesystem resize
2. parition resize
3. SCSI device resize
1 and 3 are solved (for a subset of fs). A solution to 2 is to use the
Linux device mapper (a mini volume manager) to replace the use of
gendisk partitions. Then your entire stack constructed this way will be
resizable.
The place to begin finding out about DM is the development lists:
dm-devel@sistina.com
With a list archive at:
http://lists.sistina.com/pipermail/dm-devel/
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
2003-11-25 15:43 ` James Bottomley
2003-11-25 16:11 ` James Bottomley
@ 2003-11-25 19:34 ` Lincoln Dale
1 sibling, 0 replies; 10+ messages in thread
From: Lincoln Dale @ 2003-11-25 19:34 UTC (permalink / raw)
To: James Bottomley; +Cc: Stefan Voelkel, SCSI Mailing List
At 02:43 AM 26/11/2003, James Bottomley wrote:
>You simply do
>
>echo 1 > /sys/bus/scsi/<device>/rescan
>
>It will re-read the capacity and partition table (as long as the device
>is unmounted and none of the partitions open).
i guess that kinda defeats the purpose of online resizing; the idea is that
the partitions DO remain mounted and the partitions with a refcount against
them!
cheers,
lincoln.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LUN resizing
@ 2003-11-28 22:29 christophe varoqui
0 siblings, 0 replies; 10+ messages in thread
From: christophe varoqui @ 2003-11-28 22:29 UTC (permalink / raw)
To: linux-scsi
> The problem you are trying to solve has three components:
>
> 1. Filesystem resize
> 2. parition resize
> 3. SCSI device resize
>
> 1 and 3 are solved (for a subset of fs). A solution to 2 is to use the
> Linux device mapper (a mini volume manager) to replace the use of
> gendisk partitions. Then your entire stack constructed this way will be
> resizable.
Yes, this idea is floating around :
See the dmpartx post covered at http://lwn.net/Articles/13958/
May be someone (Andries B) will get something like that in initramfs for
2.7 ...
regards,
cvaroqui
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-11-28 22:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-25 9:34 LUN resizing Stefan Voelkel
2003-11-25 15:43 ` James Bottomley
2003-11-25 16:11 ` James Bottomley
2003-11-26 9:45 ` Stefan Voelkel
2003-11-26 9:48 ` Christoph Hellwig
2003-11-28 10:08 ` Stefan Voelkel
2003-11-28 10:23 ` Christoph Hellwig
2003-11-28 16:18 ` James Bottomley
2003-11-25 19:34 ` Lincoln Dale
-- strict thread matches above, loose matches on Subject: below --
2003-11-28 22:29 christophe varoqui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox