Skip to contentSkip to conversation

Resizing multipath maps: reload ioctl failed: Invalid argument

DISCUSSION Domenico Viggiani 3 participants 7 messages Oct 24, 2007 – Oct 25, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

Hi,
I'm trying to resize a multipath map (an EMC Clariion LUN) but something goes wrong with ioctl call.
After resizing LUN by EMC Navisphere, I rescanned four paths using:
echo "1" > /sys/bus/scsi/drivers/sd/<h>\:<b>\:<t>\:<l>/block/device/rescan
...
I noticed (in /var/log/messages) that kernel "sees" new size only for two paths, surely the active ones (Clariion is an active/passive array). Then, I trespassed LUN on the other storage processor and rescanned all paths a second time: all sizes was updated.
But, re-running 'multipath -v2', I got:

 # multipath -v 2
 device-mapper: reload ioctl failed: Invalid argument
I found no other way to make this work but umounting filesystem,
deactivating LVM and ran 'multipath -f ... && multipath -v2' (and then other
regular LVM stuffs).
OS is Red Hat 4.5.

About this, I found this message in archives:
http://www.redhat.com/archives/dm-devel/2007-August/msg00188.html

Is it confirmed that online resizing with multipath is impossible?

If yes, in my opinion, this is a serious limitation to a serious enterprise use of Linux.

Thanks in advance for any help

Signature · 1 line
Domenico Viggiani
#1 lore raw
Quoted 20 lines

Hi,
I'm trying to resize a multipath map (an EMC Clariion LUN) but something goes wrong with ioctl call.
After resizing LUN by EMC Navisphere, I rescanned four paths using:
echo "1" > /sys/bus/scsi/drivers/sd/<h>\:<b>\:<t>\:<l>/block/device/rescan
...
I noticed (in /var/log/messages) that kernel "sees" new size only for two
paths, surely the active ones (Clariion is an active/passive array). Then, I trespassed LUN on the other storage processor and rescanned all paths a second time: all sizes was updated.
But, re-running 'multipath -v2', I got:

 # multipath -v 2
 device-mapper: reload ioctl failed: Invalid argument
I found no other way to make this work but umounting filesystem,
deactivating LVM and ran 'multipath -f ... && multipath -v2' (and then 
other
regular LVM stuffs).
OS is Red Hat 4.5.
Quoted 7 lines

About this, I found this message in archives:
http://www.redhat.com/archives/dm-devel/2007-August/msg00188.html

Is it confirmed that online resizing with multipath is impossible?

If yes, in my opinion, this is a serious limitation to a serious enterprise use of Linux.

I have used the following in the past when I needed to resize online. I have only tested this for the round robin selector but a similar method could also work for other selectors.

#Started with the following dm table
dmsetup table m500i_A_lun_4
0 157287936 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100

###Used the following in a script to complete the resize dmsetup suspend m500i_A_lun_4

#Reload with one device removed and old size dmsetup load m500i_A_lun_4 <<EOF
0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:80 100 EOF
dmsetup resume m500i_A_lun_4
dmsetup suspend m500i_A_lun_4

#Reload with one device removed for all other devices dmsetup load m500i_A_lun_4 <<EOF
0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:160 100 EOF
dmsetup resume m500i_A_lun_4
dmsetup suspend m500i_A_lun_4

#Reload with all devices and new size
dmsetup load m500i_A_lun_4 <<EOF
0 209717248 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100 EOF
dmsetup resume m500i_A_lun_4

After the last step everything is able to see the new device size. I know this isn't an ideal solution but it might be useful for some people.

Aaron Bergstralh

#5 lore raw
In reply to Domenico Viggiani

Hi,

Quoted 6 lines · Domenico Viggiani

http://www.redhat.com/archives/dm-devel/2007-August/msg00188.html

Is it confirmed that online resizing with multipath is impossible?

If yes, in my opinion, this is a serious limitation to a serious enterprise use of Linux.

I'm trying to find a kernel fix for this issue.

I'll post patches for 2.6.23 kernel.
(But it should be easily adaptible to other versions.)

I have tested the patches mainly on modified LVM2 (i.e. resizing mirror LV).
Since I don't have resizable multipath device,
if you are interested in testing, it would be much appreciated.

Alternative is to use dmsetup directly, as Aaron suggested. But there is a corner case that if all paths are down before 'dmsetup suspend', I/O errors will occur regardless of queue_if_no_path setting.

Thanks,

Signature · 1 line
Jun'ichi Nomura, NEC Corporation of America
#6 lore raw

RE: Resizing multipath maps: reload ioctl failed: Invalidargument

Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jun'ichi Nomura
Sent: Wednesday, October 24, 2007 11:10 PM

Since I don't have resizable multipath device, if you are interested in testing, it would be much appreciated.

I'm sorry but I have only (semi-)production servers where I'm not able to install different kernels from Red Hat stock ones.

--
DV

#2 lore raw

RE: Resizing multipath maps: reload ioctl failed: Invalidargument

In reply to Aaron Bergstralh
Quoted 26 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Aaron Bergstralh
Sent: Wednesday, October 24, 2007 5:50 PM

I have used the following in the past when I needed to resize online. I have only tested this for the round robin selector but a similar method could also work for other selectors.

#Started with the following dm table
dmsetup table m500i_A_lun_4
0 157287936 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100

###Used the following in a script to complete the resize dmsetup suspend m500i_A_lun_4

#Reload with one device removed and old size dmsetup load m500i_A_lun_4 <<EOF 0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:80 100 EOF dmsetup resume m500i_A_lun_4 dmsetup suspend m500i_A_lun_4

#Reload with one device removed for all other devices dmsetup load m500i_A_lun_4 <<EOF 0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:160 100 EOF dmsetup resume m500i_A_lun_4 dmsetup suspend m500i_A_lun_4

Quoted 8 lines

#Reload with all devices and new size
dmsetup load m500i_A_lun_4 <<EOF
0 209717248 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100 EOF dmsetup resume m500i_A_lun_4

After the last step everything is able to see the new device size. I know this isn't an ideal solution but it might be useful for some people.

I have an EMC Clariion with four paths (two active and two passive):

# multipath -ll

360060160eb2417004412f146416bdc11
[size=20 GB][features="0"][hwhandler="1 emc"]
\_ round-robin 0 [prio=2][active]
\_ 0:0:2:200 sdb 8:16 [active][ready]
\_ 1:0:4:200 sdk 8:160 [active][ready]
\_ round-robin 0 [enabled]
\_ 0:0:3:200 sde 8:64 [active][ready]
\_ 1:0:3:200 sdh 8:112 [active][ready]

# dmsetup table 360060160eb2417004412f146416bdc11
0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100
round-robin 0 2 1 8:64 100 8:112 100 

What are the exact order of remove/reload in this case? I'd like to understand the logic!

Thanks again
--
DV

#3 lore raw

Re: RE: Resizing multipath maps: reload ioctl failed: Invalidargument

Quoted 48 lines
Quoted 26 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Aaron Bergstralh
Sent: Wednesday, October 24, 2007 5:50 PM

I have used the following in the past when I needed to resize online. I have only tested this for the round robin selector but a similar method could also work for other selectors.

#Started with the following dm table
dmsetup table m500i_A_lun_4
0 157287936 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100

###Used the following in a script to complete the resize dmsetup suspend m500i_A_lun_4

#Reload with one device removed and old size dmsetup load m500i_A_lun_4 <<EOF 0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:80 100 EOF dmsetup resume m500i_A_lun_4 dmsetup suspend m500i_A_lun_4

#Reload with one device removed for all other devices dmsetup load m500i_A_lun_4 <<EOF 0 157287936 multipath 0 0 1 1 round-robin 0 1 1 8:160 100 EOF dmsetup resume m500i_A_lun_4 dmsetup suspend m500i_A_lun_4

Quoted 8 lines

#Reload with all devices and new size
dmsetup load m500i_A_lun_4 <<EOF
0 209717248 multipath 0 0 1 1 round-robin 0 2 1 8:80 100 8:160 100 EOF dmsetup resume m500i_A_lun_4

After the last step everything is able to see the new device size. I know this isn't an ideal solution but it might be useful for some people.

I have an EMC Clariion with four paths (two active and two passive):

# multipath -ll

360060160eb2417004412f146416bdc11
[size=20 GB][features="0"][hwhandler="1 emc"]
\_ round-robin 0 [prio=2][active]
\_ 0:0:2:200 sdb 8:16 [active][ready]
\_ 1:0:4:200 sdk 8:160 [active][ready]
\_ round-robin 0 [enabled]
\_ 0:0:3:200 sde 8:64 [active][ready]
\_ 1:0:3:200 sdh 8:112 [active][ready]

Quoted 7 lines
# dmsetup table 360060160eb2417004412f146416bdc11
0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100
round-robin 0 2 1 8:64 100 8:112 100 0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100
round-robin 0 2 1 8:64 100 8:112 100 

What are the exact order of remove/reload in this case? I'd like to understand the logic!

The basic logic behind the table manipulation is to remove one device at a time and then add it back in allowing dm to see the new size of device. When all devices have been removed and reinserted the size of the table can finally be updated. I haven't tried this with your configuration so if I get it wrong someone please correct me.

Starting Table:
0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100 round-robin 0 2 1 8:64 100 8:112 100 Remove sdb:
0 41943040 multipath 0 1 emc 2 1 round-robin 0 1 1 8:160 100 round-robin 0 2 1 8:64 100 8:112 100 Remove sdk reinsert sdb:
0 41943040 multipath 0 1 emc 2 1 round-robin 0 1 1 8:16 100 round-robin 0 2 1 8:64 100 8:112 100 Remove sde reinsert sdk:
0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100 round-robin 0 1 1 8:112 100 Remove sdh reinsert sde:
0 41943040 multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100 round-robin 0 1 1 8:64 100 Reinsert sdh and set the new table size:
If you don't know your new size you can grab it from one of the devices with blockdev: /sbin/blockdev --getsize /dev/sdb 0 <newsize> multipath 0 1 emc 2 1 round-robin 0 2 1 8:16 100 8:160 100 round-robin 0 2 1 8:64 100 8:112 100

For each table you will need to complete a suspend, load, resume sequence.

Aaron

#4 lore raw

RE: RE: Resizing multipath maps: reload ioctl failed:Invalidargument

Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Aaron Bergstralh
Sent: Thursday, October 25, 2007 5:05 PM
...
If you don't know your new size you can grab it from one of the devices with blockdev: /sbin/blockdev --getsize /dev/sdb

"/sbin/blockdev --getsize /dev/sdb" gives old size :-( even if I rescanned SCSI devices with "echo "1" > /sys/bus/scsi/drivers/sd/<SCSI-ID>/block/device/rescan" for all 4 paths and verified in /var/log/messages that kernel sees new size.
Thus latest load fails with usual error (ioctl).

--
DV