Problems extending Logical volume

General support questions
Post Reply
solidblueliquid
Posts: 11
Joined: 2018/01/11 07:41:06

Problems extending Logical volume

Post by solidblueliquid » 2018/02/23 08:52:14

Hi Everyone,

I'm trying to follow the guide at https://ma.ttias.be/increase-a-vmware-d ... rebooting/ to extend my hard drive to another virtual disk in xenserver.

Code: Select all

[root@ftp ~]# fdisk -l

Disk /dev/xvda: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000cda96

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048     2099199     1048576   83  Linux
/dev/xvda2         2099200  1048575999   523238400   8e  Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 65536 bytes


Disk /dev/mapper/centos-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-home: 370.4 GB, 370352848896 bytes, 723345408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 65536 bytes


Disk /dev/xvdb: 2147.5 GB, 2147483648000 bytes, 4194304000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@ftp ~]#

Code: Select all

[root@ftp ~]# vgdisplay
  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               3
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               2.44 TiB
  PE Size               4.00 MiB
  Total PE              639742
  Alloc PE / Size       102193 / 399.19 GiB
  Free  PE / Size       537549 / 2.05 TiB
  VG UUID               Oi0dMW-SMLh-BMka-PhKv-5AT8-Ngqh-kWGFej

[root@ftp ~]#
When i run the command to extend i get this error,

[root@ftp ~]# lvextend /dev/centos/ /dev/xvdb
Logical volume name "" is invalid.
Run `lvextend --help' for more information.
[root@ftp ~]#

What am i doing wrong?

solidblueliquid
Posts: 11
Joined: 2018/01/11 07:41:06

Re: Problems extending Logical volume

Post by solidblueliquid » 2018/02/23 08:55:06

I tried this as well and still no luck

Code: Select all

[root@ftp ~]# lvextend /dev/mapper/centos-home /dev/xvdb
  WARNING: Sum of all thin volume sizes (<2.34 TiB) exceeds the size of thin poo                                          l centos/pool00 and the amount of free space in volume group (2.05 TiB)!
  For thin pool auto extension activation/thin_pool_autoextend_threshold should                                           be below 100.
  Size of logical volume centos/home changed from <344.92 GiB (88299 extents) to                                           <2.29 TiB (600298 extents).
  Logical volume centos/home successfully resized.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Problems extending Logical volume

Post by TrevorH » 2018/02/23 09:32:44

You need to partition /dev/xvdb first and tag the partition as type 0x8e (LVM). Well, that's not strictly required but it's fairly good practice to always put a partition table on disks so that the next admin who comes along doesn't look at the disk and think it's unused and starts over. The partitioning may require a reboot afterwards if the disk is in use but otherwise should take effect immediately.

Once it's partitioned you need to turn that partition into a new LVM Physical Volume using pvcreate. Once that's done you add the new PV to your existing Volume Group using vgextend. Now the PV is part of the VG, you should have free space in the VG to be able to run lvextend.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply