I'm trying to extend an LVM group on VCenter without much success.
I followed this guide to extend the VMs disk and create the new primary partition /dev/sda3
. When I go ahead and use the pvcreate -vv /dev/sda3
command I get:
# pvcreate -vv /dev/sda3
Setting activation/monitoring to 1
Setting global/locking_type to 1
Setting global/wait_for_locks to 1
File-based locking selected.
Setting global/prioritise_write_locks to 1
Setting global/locking_dir to /run/lock/lvm
Setting global/use_lvmlockd to 0
metadata/pvmetadataignore not found in config: defaulting to 0
metadata/pvmetadatasize not found in config: defaulting to 255
metadata/pvmetadatacopies not found in config: defaulting to 1
Locking /run/lock/lvm/P_orphans WB
Setting response to OK
Setting response to OK
Setting id to ftrG8E-TB42-4ilL-dQnc-hLoK-wb8G-4KqGWb
Setting vgid to QQ20nS-fyFe-Eedo-vrDl-w7V0-q7bR-kY51WH
Setting vgname to conserver-vg
Setting format to lvm2
Setting device to 2053
Setting dev_size to 16666066944
Setting label_sector to 1
Setting size to 1044480
Setting start to 4096
Setting ignore to 0
Setting response to OK
Setting response to OK
Setting name to conserver-vg
Setting metadata/format to lvm2
Setting id to ftrG8E-TB42-4ilL-dQnc-hLoK-wb8G-4KqGWb
Setting format to lvm2
Setting device to 2053
Setting dev_size to 32550912
Setting label_sector to 1
Setting size to 1044480
Setting start to 4096
Setting ignore to 0
Setting response to OK
Setting response to OK
/dev/sda3: size is 2046 sectors
Setting devices/sysfs_scan to 1
Setting devices/multipath_component_detection to 1
Setting devices/md_component_detection to 1
Setting devices/fw_raid_component_detection to 0
Setting devices/ignore_suspended_devices to 0
Setting devices/ignore_lvm_mirrors to 1
devices/filter not found in config: defaulting to filter = [ "a|.*/|" ]
Setting devices/cache_dir to /run/lvm
Setting devices/cache_file_prefix to
devices/cache not found in config: defaulting to /run/lvm/.cache
Setting devices/write_cache_state to 1
Setting global/use_lvmetad to 1
/dev/sda3: size is 2046 sectors
Device /dev/sda3 not found (or ignored by filtering).
Unlocking /run/lock/lvm/P_orphans
Here are some outputs from similar posts:
# uname -a
Linux conserver 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# fdisk -l /dev/sda
Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 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
Disklabel type: dos
Disk identifier: 0x161f94c6
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 1001470 33552383 32550914 15.5G 5 Extended
/dev/sda3 999424 1001469 2046 1023K 8e Linux LVM
/dev/sda5 1001472 33552383 32550912 15.5G 8e Linux LVM
Partition table entries are not in disk order.
# grep -i filter /etc/lvm/lvm.conf
# returns all results as comments
# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/conserver--vg-root 9.3G 8.3G 492M 95% /
I'm lost in how I might be able to extend this LVM without being able to add the new partition!
Thanks
For online resizing, I created a small script that will generate the required commands. See: https://github.com/mircea-vutcovici/scripts/blob/master/vol_resize.sh
It covers most popular disk labels and file systems used on Linux.
You can do all this resizing without rebooting the machine.