Questo contenuto non è disponibile nella lingua selezionata.

14.10. Re-sizing the Disk Image


Change the disk image filename as if it had been created with size size. Only images in raw format can be resized in both directions, whereas qcow2 images can be grown but cannot be shrunk.
Use the following to set the size of the disk image filename to size bytes:
# qemu-img resize filename sizeqemu-img resize filename sizeqemu-img resize filename sizeqemu-img resize filename size
Copy to Clipboard Toggle word wrap
You can also resize relative to the current size of the disk image. To give a size relative to the current size, prefix the number of bytes with + to grow, or - to reduce the size of the disk image by that number of bytes. Adding a unit suffix allows you to set the image size in kilobytes (K), megabytes (M), gigabytes (G) or terabytes (T).
# qemu-img resize filename [+|-]size[K|M|G|T]qemu-img resize filename [+|-]size[K|M|G|T]qemu-img resize filename [+|-]size[K|M|G|T]qemu-img resize filename [+|-]size[K|M|G|T]qemu-img resize filename [+|-]size[K|M|G|T]
Copy to Clipboard Toggle word wrap

Warning

Before using this command to shrink a disk image, you must use file system and partitioning tools inside the VM itself to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss.
After using this command to grow a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat