Hi,

> is it possible to increase the size of a SAN LUN in order to extend a
> LVM PV and VG living on that LUN without a reboot?  Of course I can
> hot-add a new physical disk and extend the VG but for some reasons we
> sometimes want to resize an existing LUN so that the number of LUNs
> attached to the system remains constant.

I've wrote a little howto we use ourselfs (san4_Data is the alias) on RHELS
>= 5.3 systems :

]# multipath -ll san4_Data
san4_Data (3600508b4001078340000d00004d80000) dm-10 HP,HSV210
[size=110G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 0:0:3:2 sdg 8:96  [active][ready]
 \_ 1:0:3:2 sdq 65:0  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:2:2 sdb 8:16  [active][ready]
 \_ 1:0:2:2 sdl 8:176 [active][ready]

]# for varTmp in `multipath -ll san4_Data | grep sd | awk '{print $2}'`; do
echo 1 > /sys/class/scsi_device/$varTmp/device/rescan ;done ; unset varTmp

]# multipathd -k"resize multipath san4_Data"

]# multipath -ll san4_Data
san4_Data (3600508b4001078340000d00004d80000) dm-10 HP,HSV210
[size=115G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][enabled]
 \_ 0:0:3:2 sdg 8:96  [active][ready]
 \_ 1:0:3:2 sdq 65:0  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:2:2 sdb 8:16  [active][ready]
 \_ 1:0:2:2 sdl 8:176 [active][ready]

]# pvresize /dev/mapper/san4_Data
  Physical volume "/dev/dm-10" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

]# lvresize /dev/vg_san4_Data/lv_san4_Data -l +100%FREE
  Extending logical volume lv_san4_Data to 115.00 GB
  Logical volume lv_san4_Data successfully resized

]# resize2fs /dev/vg_san4_Data/lv_san4_Data
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/vg_san4_Data/lv_san4_Data is mounted on /san4; on-line
resizing required
Performing an on-line resize of /dev/vg_san4_Data/lv_san4_Data to 30145536
(4k) blocks.
The filesystem on /dev/vg_san4_Data/lv_san4_Data is now 30145536 blocks
long.

]# df -h /san4
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_san4_Data-lv_san4_Data
                      114G  188M  112G   1% /san4

I hope it is of any use for you.

Cheers,
Andre

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to