[SOLVED] Problem increasing LVM

Hi

sda                 8:0    0   80G  0 disk 
├─sda1              8:1    0  487M  0 part /boot
├─sda2              8:2    0    1K  0 part 
└─sda5              8:5    0 49,5G  0 part 
  ├─vg_ucs-root   254:0    0 46,3G  0 lvm  /
  └─vg_ucs-swap_1 254:1    0  3,3G  0 lvm  [SWAP]

Before sda were 50Gb, than I’ve increase qcow2 to 80Gb
Now I’ve to increase vg_ucs-root

                                                    Disk: /dev/sda
                                  Size: 80 GiB, 85899345920 bytes, 167772160 sectors
                                          Label: dos, identifier: 0x000398bd

    Device            Boot                 Start             End         Sectors        Size       Id Type
>>  /dev/sda1         *                     2048          999423          997376        487M       83 Linux           
    /dev/sda2                            1001470       104855551       103854082       49,5G        5 Extended
    └─/dev/sda5                          1001472       104855551       103854080       49,5G       8e Linux LVM
    Free space                         104855552       167772159        62916608         30G

lvextend -l +100%FREE /dev/mapper/vg_ucs-root

reboot

PV /dev/sda5 VG vg_ucs lvm2 [49,52 GiB / 0 free]
Total: 1 [49,52 GiB] / in use: 1 [49,52 GiB] / in no VG: 0 [0 ]

Can you help me?

Hi!

The short manual would look something like this:

  • use the free 30G space and create a new partition with type Linux LVM
  • use pvcreate with that new partition to create a physical volume (PV)
  • add that PV to your existing volume group (VG) via vgextend
  • now your VG is much larger, so you can call lvextent again to increase the size of your logical volume (LV)
  • resize your filesystem, that is located on your LV vg_ucs-root

EDIT:

Or the one that’s just a little more dangerous:

  • increase the size of partition sda5, but make sure, that the partition start is not altered and the size is not smaller than before (otherwise data loss is imminent).
  • use pvresize to increase the size of your PV to maximum
  • check everything via pvs, vgs and lvs

Best regards,

Sönke

hi @Schwardt

                                                                                                                Disk: /dev/sda
                                                                                              Size: 80 GiB, 85899345920 bytes, 167772160 sectors
                                                                                                      Label: dos, identifier: 0x000398bd

    Device                          Boot                                             Start                          End                      Sectors                     Size                    Id Type
>>  /dev/sda1                       *                                                 2048                       999423                       997376                     487M                    83 Linux                                     
    /dev/sda2                                                                      1001470                    104855551                    103854082                    49,5G                     5 Extended
    └─/dev/sda5                                                                    1001472                    104855551                    103854080                    49,5G                    8e Linux LVM
    /dev/sda3                                                                    104855552                    167772159                     62916608                      30G                    8e Linux LVM

then:

pvcreate /dev/sda3
  Device /dev/sda3 not found (or ignored by filtering).

When you change the partitions of a drive that’s currently in use (e.g. because one of your mounted partition comes from that disk), the kernel keeps using the old partition table until you reboot.

@Schwardt, @Moritz_Bunkus
Thank you
I’ve fixed

Regards