I've came up with a problema, let me explain it:

I have an Ubuntu 12 LTS virtualized on Hyper-V, initially it had 20Gb of asigned virtual disk but now I'm almost runing out of space so I've increased the virtual disk to 60Gb used parted magic to resize the 20 Gb partition to 60Gb partition but as I see on volumes manager it shows me that / partition is only 20 Gb so I'm wondering how to make it bigger given that / is part of an lvm group.

enter image description here

resize2fs /dev/mapper/x

Next time you could rather use the lvm-extend:

lvm-extend -r /dev/mapper/x

I tried lots of links to increase my LVM(/root) partition size after assembled new disks, only this one works: https://www.tecmint.com/extend-and-reduce-lvms-in-linux/

As a summary: It guided me to create partitions on these newly assembled disks(500GB per each) first and then create logical and physical volumes; then extend volume group by adding this partitions and then resize.

$ pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1
$ vgextend ubuntu-vg /dev/sdb1 /dev/sdc1 /dev/sdd1
$ lvextend -l +360380 /dev/ubuntu-vg/root
$ resize2fs /dev/ubuntu-vg/root
$ vgdisplay
--- Volume group ---
  VG Name               ubuntu-vg
  System ID
  Format                lvm2
  Metadata Areas        4
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                4
  Act PV                4
  VG Size               <1.83 TiB
  PE Size               4.00 MiB
  Total PE              479614
  Alloc PE / Size       479614 / <1.83 TiB
  Free  PE / Size       0 / 0

Hope, it may help.

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.