Skip to contentSkip to conversation

online disk resizing

DISCUSSION Raayman, Sebastian 5 participants 10 messages Jul 5, 2007 – Jul 6, 2007 1 message not in the archive Device mapper

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

this is also dependant on the HBA you are using. With a Qlogic adapter you can simply send an:

echo scsi-qlascan

to your Qlogic adapter (for example under /proc/scsqi/qla2xxx). This will make the adapter aware of for example new LUNs that have been added.

You can then use the rescan-scsi-bus.sh command to rescan your bus and make the changes known to the OS. After that just do a resize of the fs on your disk or add them to the LVM or something similar.

Should work like a charm.

Cheers,
Bas

Quoted 30 lines

I did the same with HP MSA in the past, but without dm involved.

You can use "blockdev --rereadpt <blockdevice>" to make the the kernel recognise the new disk size (geometery). The nasty thing is that you have to stop all I/O to the blocdevice.

Roland Mieslinger

Quoted 22 lines

-----Original Message-----
From: dm-devel-bounces redhat com [mailto:dm-devel-bounces redhat com] On Behalf Of Alexander Benaguev
Sent: Mittwoch, 4. Juli 2007 19:17
To: dm-devel redhat com
Subject: [dm-devel] online disk resizing

hi, list

I have fc-based SAN which has ability to resizing logical disks online (IBM DS4000). is this a method tell about resizing to host system (centOS 5) without reboot or echo "scsi remove(add)-single-device 0 1 2 3"? I use multipath if this matters. will apprecate any help

alexander

--
dm-devel mailing list
dm-devel redhat com
https://www.redhat.com/mailman/listinfo/dm-devel

#2 lore raw
Quoted 6 lines · Sebastian

this is also dependant on the HBA you are using. With a Qlogic adapter you can simply send an:

echo scsi-qlascan

to your Qlogic adapter (for example under /proc/scsqi/qla2xxx)

thanks for attention, guys

Sebastian, yes, I use qlogic, but, you will laught, I have not /proc/scsqi/qla2xxx. googling around shows that:
"as of RHEL4 U3 (and I'd imagine upstream kernel.org kernels) the 'scsi-qlascan' no longer works with the qla2xxx driver. The new method is:

echo 1 > /sys/class/fc_host/host<ID>/issue_lip
echo "- - -" > /sys/class/scsi_host/host<ID>/scan" but it does not work for me.
I tried "echo 1 > /sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/0000:06:01.0/host1/rport-1:0-1/target1:0:1/1:0:1:2/rescan" too. so, it was much better: dmesg showed me disks with new capacity, but "fdisk -l" still showing old capacity;( any thoughts?

alexander

#3 lore raw

Alexander
Here is what I do (RHEL4u4) I use iscsi over a qlogic HBA but its basically the same.. still "scsi" to RH :-)
Oh yea no partitions on my volumes either, It seems cleaner that way.

1. stop access to volume and unmount
2. resize your san volume
3. locate the scsi target number

Quoted 1 line

cat /proc/scsi/qla4xxx/<controller>

I find the volume Im interested in via our naming schema .. your milage
my very with that.
I now have my volume def in scsi terms .. ie 2 0 2 0 or <host> <channel>
<scsi id> <lun>
4. remove and readd the scsi device

Quoted 2 lines

echo "scsi remove-single-device 2 0 2 0" > /proc/scsi/scsi echo "scsi add-single-device 2 0 2 0" > /proc/scsi/scsi

6. at this point I have a new scsi device ie /dev/sdg or such which should reflect the new size via your dmesg
( i usually have a tail -f of /var/log/messages going :-)
7. next run my ext2online to get the FS in sync with the actual size of the volume
8. remount and re access the volume

Hope that helps out some ..

Signature · 2 lines
:wq!
kevin.foote
Quoted 35 lines · Alexander Benaguev
Quoted 6 lines · Sebastian

this is also dependant on the HBA you are using. With a Qlogic adapter you can simply send an:

echo scsi-qlascan

to your Qlogic adapter (for example under /proc/scsqi/qla2xxx)

thanks for attention, guys

Sebastian, yes, I use qlogic, but, you will laught, I have not /proc/scsqi/qla2xxx. googling around
shows that:
"as of RHEL4 U3 (and I'd imagine upstream kernel.org kernels) the 'scsi-qlascan' no longer works
with the qla2xxx driver. The new method is:

echo 1 > /sys/class/fc_host/host<ID>/issue_lip
echo "- - -" > /sys/class/scsi_host/host<ID>/scan" but it does not work for me.
I tried "echo 1 > /sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/0000:06:01.0 /host1/rport-1:0-1/target1:0:1/1:0:1:2/rescan"
too. so, it was much better: dmesg showed me disks with new capacity, but "fdisk -l" still showing
old capacity;( any thoughts?

alexander

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#4 lore raw
In reply to Alexander Benaguev
Quoted 24 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Benaguev
Sent: Donnerstag, 5. Juli 2007 14:44
To: device-mapper development
Subject: Re: [dm-devel] online disk resizing

Quoted 1 line · Sebastian

this is also dependant on the HBA you are using. With a

Qlogic adapter

Quoted 5 lines

you can simply send an:

echo scsi-qlascan

to your Qlogic adapter (for example under /proc/scsqi/qla2xxx)

thanks for attention, guys

Sebastian, yes, I use qlogic, but, you will laught, I have not /proc/scsqi/qla2xxx. googling around shows that:
"as of RHEL4 U3 (and I'd imagine upstream kernel.org kernels) the 'scsi-qlascan' no longer works with the qla2xxx driver. The new method is:

Quoted 8 lines

echo 1 > /sys/class/fc_host/host<ID>/issue_lip
echo "- - -" > /sys/class/scsi_host/host<ID>/scan" but it does not work for me.
I tried "echo 1 > /sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/0000:06:01.0 /host1/rport-1:0-1/target1:0:1/1:0:1:2/rescan"
too. so, it was much better: dmesg showed me disks with new capacity, but "fdisk -l" still showing old capacity;( any thoughts?

try:
blockdevice --rereadpt <blockdevice>

Roland

#5 lore raw
Quoted 3 lines · Roland Mieslinger

try: blockdevice --rereadpt <blockdevice>

Roland

just tried. no effect;(

#6 lore raw
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Benaguev
Sent: Donnerstag, 5. Juli 2007 16:08
To: device-mapper development
Subject: Re: [dm-devel] online disk resizing

Quoted 6 lines
Quoted 4 lines · Roland Mieslinger

try:
blockdevice --rereadpt <blockdevice>

Roland

just tried. no effect;(

Did you get a error from blockdev command?
Did you stop all I/O to the device?

This command worked for me in the past several times.

Roland

#7 lore raw
Quoted 1 line · Roland Mieslinger

Did you get a error from blockdev command?

none

Quoted 1 line

Did you stop all I/O to the device?

I can't!=) it's not online resizing, if I should stoping io;(

#8 lore raw
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Benaguev
Sent: Donnerstag, 5. Juli 2007 16:20
To: device-mapper development
Subject: Re: [dm-devel] online disk resizing

Quoted 5 lines
Quoted 1 line · Roland Mieslinger

Did you get a error from blockdev command?

none

Quoted 1 line

Did you stop all I/O to the device?

I can't!=) it's not online resizing, if I should stoping io;(

That's were i stuck too.
You can do it without reboot, but I've found no way to do it online.

Roland

#9 lore raw

Yes same here.. with IO still going dm does the failover just fine (using the echo scsi "remove/add") but failing back with a larger size is where I have seene issues. Although we have never lost data :-)

Signature · 2 lines
:wq!
kevin.foote
Quoted 24 lines · Roland Mieslinger
Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Benaguev
Sent: Donnerstag, 5. Juli 2007 16:20
To: device-mapper development
Subject: Re: [dm-devel] online disk resizing

Quoted 5 lines
Quoted 1 line · Roland Mieslinger

Did you get a error from blockdev command?

none

Quoted 1 line

Did you stop all I/O to the device?

I can't!=) it's not online resizing, if I should stoping io;(

That's were i stuck too.
You can do it without reboot, but I've found no way to do it online.

Roland

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#10 lore raw
In reply to Roland Mieslinger
Quoted 7 lines · Roland Mieslinger
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Benaguev
Sent: Donnerstag, 5. Juli 2007 16:20
To: device-mapper development
Subject: Re: [dm-devel] online disk resizing

Quoted 9 lines
Quoted 5 lines
Quoted 1 line · Roland Mieslinger

Did you get a error from blockdev command?

none

Quoted 1 line

Did you stop all I/O to the device?

I can't!=) it's not online resizing, if I should stoping io;(

That's were i stuck too.
You can do it without reboot, but I've found no way to do it online.

As already said: online resizing only works if there are _no_ references to that device. Ie no device-mapper tables referencing it etc. Otherwise any block device updates will be rejected by the kernel.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)