Last active
November 17, 2023 06:56
-
-
Save smurugap/f83284fd6ab37bd27e5e5e600f6997d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install packages: | |
# yum install -y libguestfs-tools qemu-img | |
Create the target image | |
# qemu-img create -f qcow2 target.qcow2 256G | |
Expand the new image and resize the partitions | |
# virt-resize --expand /dev/sda1 ubuntu.qcow2 target.qcow2 | |
If CentOS, do xfs_growfs inside the VM after boot | |
# yum install cloud-utils-growpart | |
# growpart /dev/vda 1 | |
# xfs_growfs /dev/vda1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used below commands on ubuntu qcow2 to resize the disk from inside the VM.
growpart /dev/vda 1
resize2fs /dev/vda1