LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   How to expand the VG after the LUNs expanded? (https://www.linuxquestions.org/questions/linux-enterprise-47/how-to-expand-the-vg-after-the-luns-expanded-4175462198/)

hilou 05-16-2013 04:14 AM

How to expand the VG after the LUNs expanded?
 
the luns have been expanded from the filer side, and all luns in server side are in use, so how to expand the vg to use the expanded luns?

eg: former lun size 100G and all in use in vg1, and now the lun have been expanded to 200G, and the vg is still in use in server side, how to expand the vg to 200G since the pv should be resized?

Thanks in advance!

jmajor 05-16-2013 08:31 AM

I'm not sure if expanding the original pv is possible. You should be able to create a new pv in the spare space and add it to the vg. You should then be able to expand the lv using (I think lvchange). After that you will need to expand any filesystem in the lv using a tool such as ext2resize (sp?).

hilou 05-16-2013 08:39 PM

Please guide how to expand the original pv. Currently situation: lun size on filer:200G, the mapper disk on server sdd size 100G.

cliffordw 05-17-2013 10:16 AM

Hi there, and welcome!

First, make sure you have a good backup!!

Next, let the kernel see the extra space by triggering a rescan. to do this, run:
Code:

echo 1 > /sys/block/sd?/device/rescan
where "sd?" is the name of the applicable LUN.

Check that this worked by either looking at the dmesg messages, or running "fdisk -l /dev/sd?".

From here the next steps depend on whether you have a partition table on the LUN or not.

If you do, jmajor's suggestion to add a partition and new PV is the safest. If you really want to expand the existing PV, you should be able to do so with a tool like gparted. Just make sure you have a good backup first :-) Alternately you could use fdisk to delete the partition & recreate it with the same start position and a new size, but this is more risky!

If you don't have a partition table (i.e. you're using the entire /dev/sd? as PV), while I haven't tried this, I found some articles online about how to do this using multipathd, like the article at http://earlruby.org/2010/10/increasi...out-rebooting/.

Once this is done, you'll need to run the appropriate pvresize, lvextend & resize2fs (or similar, depending on your FS type) commands.

Which Linux distribution & version are you running?

Good luck with this!

hilou 05-19-2013 10:01 PM

Hi cliffordw,

Thanks very much for your post, that's very helpful!

Fortunately, we don't use multipath currently and we don't have a partition table on the pv, so only two steps:
1. rescan
2. pvresize.

:)


All times are GMT -5. The time now is 04:50 AM.