Notice: I know this type of question has been asked (many times) before, but I have some remarks about the provided answers.
I run a RHEL (7.1) VM on Hyper-V. The VM has 2 IDE disks attached. I need to expand the second disk from 80 GB to 160 GB, so I expanded the disk in Virtual Machine Manager. Now there's some stuff that needs to be done on the Linux side.
Most solutions I've read boil down to this:
- Create a new primary partition with
fdisk /dev/sdb
- Set partition type to LVM (0x8e)
- Create a new Physical Volume (
pvcreate
) - Extend the Volume Group with the new PV (
vgextend
) - Extend the Logical Volume (
lvextend
) - Extend the filesystem (
xfs_growfs
)
An other solution is adding a second disk and adding that disk to the Volume Group. We don't want to go that route and keep only those 2 disks.
This all works great, I've done it before. Now I'm wondering if it's possible to extend the already existing partition (e.g. sdb1
) instead of adding a sdb2
, because as far as I remember there's a limit on the number of primary partitions? Imagine: what if I need to expand this disk 5 times? Then I have 6 primary partitions.
parted
is not an option anymore, because they removed the resize
and move
commands. GParted
could be a solution, but then I have to boot the VM with the GParted live CD, and I want to avoid that.
What are your thoughts?