virt-resize
TLDR
Resize and expand partition to fill space
SYNOPSIS
virt-resize [options] indisk outdisk
DESCRIPTION
virt-resize copies a virtual machine disk image, resizing partitions and filesystems in the process. Unlike qemu-img resize which only changes the container size, virt-resize modifies partition tables and can resize filesystems.
The tool cannot resize in place; it requires a separate output disk. First create the new disk with qemu-img create at the desired size, then run virt-resize to copy and resize content.
Supported filesystems for expansion include ext2/3/4, XFS, Btrfs, and NTFS. LVM physical volumes can be expanded, and specific logical volumes can be grown with --LV-expand.
PARAMETERS
--expand partition
Expand partition to fill available space.--shrink partition
Shrink partition to make space.--resize part=size
Resize partition to exact size.--LV-expand logvol
Expand LVM logical volume inside PV.--no-expand-content
Don't expand filesystem, only partition.--ntfsresize-force
Force NTFS resize (for Windows guests).-v, --verbose
Verbose output.-d, --debug
Debug output.--machine-readable
Output for scripts.
CAVEATS
Cannot resize in place; needs separate output disk. VM must be shut down. Shrinking can cause data loss if partition is too full. Backup before resizing. Part of libguestfs.
HISTORY
virt-resize is part of libguestfs, a library and tools for accessing and modifying virtual machine disk images. Libguestfs was created by Red Hat to provide powerful offline VM disk manipulation without requiring the VM to be running.
SEE ALSO
qemu-img(1), virt-sparsify(1), virt-filesystems(1), guestfish(1)


