"pvresize" an existing PV after it's been resized on a SAN?
This is in Red Hat 4 Update 4 btw. Can you extend a SAN LUN (HP EVA) from to a blade (which is allocated as 250gb PV as /dev/sda1) in size to, say 160gb, and then extend the /dev/sda1 PV (which has data on it) without blowing away the data and/or without unmounting?
The easier solution would be to add a new LUN as a different PV (say, /dev/sdb1) and add that to the VG and then the LV, but I'd like to know if the other solution is possible? Or when the LUN has been resized, should we just create a new PV with a new LVM partition as /dev/sda2 and use that?
The man page for "pvresize" says it allows you to resize a PV that's already allocated in a VG (and mounted too?) & has active LVs allocated on it. However later on, the man pages says to run "pvresize /dev/sda1" which will "Expand the PV on /dev/sda1 after enlarging the partition with fdisk". Now if the LUN has been increased on the SAN level, and I rescan the LUNs ("hp_rescan" for HP devices) and see the new 160gb size when running "fdisk -l /dev/sda1", is that the same as "...enlarging the partition with fdisk" (which is what "man pvresize" says has to be done before running "pvresize")? If it is, then after that I know I can extend the LV after extending the VG (have done that before with mounted filesystems using LVM). But all the allocated cylinders are taken by the /dev/sda1 LVM partition according to "fdisk -l /dev/sda1" output. That fdisk output says it's 160gb in size but it along with the /dev/sda1 partition were 150gb to begin with. See below:
Disk /dev/sda: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 19581 157284351 8e Linux LVM
|