I would like to increase lv_home to 20G and increase lv_root to 120G. In VMware I extended the harddrive to 200G. You can see that below in .host:/

Filesystem            Size  Used Avail Use% Mounted on
                       48G   31G   15G  68% /
tmpfs                 3.1G  100K  3.1G   1% /dev/shm
/dev/sda1             485M   81M  379M  18% /boot
                      4.6G  198M  4.2G   5% /home
.host:/               239G  110G  130G  46% /mnt/hgfs

I tried to run

resize2fs /dev/mapper/VolGroup-lv_home 20G

But it didn't work

I tried to run

lvextend -L 120G /dev/mapper/VolGroup-lv_root

But it didn't work

any ideas of how to add the space from .host over to lv_home?

  • The information provided is to partial to provide a proper answer. Please post the resulting file from the command - executed as root "(pvs; vgs; lvs) > lvm-setup.lst" - This command will give a summary of your LVS setup. Also, what error message did you get from resize2fs ? (Should it have been resize4fs ??)
    – davidgo
    Feb 26 '13 at 22:59

From what I can see from your LVS command, your LVM partition is only 54.1 gigs, all of which is allocated.

Am I correct in understanding that this is actually a VM, and you expanded the size of the physical disk on the VM to 200 GIGS ? If that is the case you need to first grow the PV, then the VG, then the LVs. (PV=Physical Volume, VG=Volume Group, LV=Logical Volume)

I've not tried these commands (so back up, your data is at risk !!!), but try the following -

  1. Create a new partition with the free space (for example, use FDISK and create sda2 - if that does not work, please please show me the result of "fdisk -l /dev/sda")
  2. Assuming the new partition is sda3 [ i'm guessing here, you might have a swap ] do the following

  3. Create a new Physical Volume using sda3

pvcreate /dev/sda3  
  1. Add the new partition to your volume group
vgextend Volgroup /dev/sda3
  1. Expand your partition
lvextend -L 120G /dev/mapper/VolGroup-lv_root
  1. Resize the partition
resize2fs /dev/mapper/VolGroup-lv_root

Note that these commands are untested and will probably need a bit of tweeking.

Also, an alternative to the pvcreate and lvextend command would be to resize /dev/sda1 (if thats an option with Fdisk) and then grow the physical volume.

  • [root@mybox ~]# pvs; vgs; lvs PV VG Fmt Attr PSize PFree /dev/sda2 VolGroup lvm2 a-- 54.51g 0 VG #PV #LV #SN Attr VSize VFree VolGroup 1 3 0 wz--n- 54.51g 0 LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lv_home VolGroup -wi-ao-- 4.67g lv_root VolGroup -wi-ao-- 47.87g lv_swap VolGroup -wi-ao-- 1.97g [root@mybox ~]# Feb 26 '13 at 23:28
  • I ran the command pvs; vgs; lvs, but I dont know how to format it in the box. Feb 26 '13 at 23:29
  • +1 very useful. However be careful to case sensitivity, Volgroup not being the same as VolGroup.
    – Frosty Z
    May 27 '13 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.