I followed this steps in order to add some space to a virtual disk in kvm environment
convert qcow2 disk to be expandend in raw format:
qemu-img convert -f qcow2 to-be-expandend.img -O raw to-be-expandend.raw
create extra space, 30G in this case:
sudo qemu-img create -f raw addon.raw 30G
merge the two files:
cat to-be-expandend.raw addon.raw >expanded.raw
re-convert in qcow2 format:
qemu-img convert -f raw expanded.raw -O qcow2 expanded.img
To be used, the extra space needs to be re-partitioned in the guest OS.
To do that, download the Gparted live cd
Then add the cdrom to the guest OS pointing to the downloaded iso. You can do that via the virt-manager or adding an xml like the following in the VM configuration file:
Add also the cd boot option:
hvm
Resize the partition, disable the cdrom boot and restart the VM
Extra space available!
Condividi:
Iscriviti alla newsletter
Questo sito utilizza cookie Questo sito utilizza cookie tecnici, analitici e di profilazione per offrirti un servizio personalizzato. Puoi scegliere come utilizzarli e modificare le impostazioni in qualsiasi momento. Maggiori dettagli nella nostra Cookie Policy.
Gestione preferenze cookie
Cookie tecnici
Necessari per il corretto funzionamento del sito e per garantire la sicurezza. Non possono essere disattivati.
Cookie analitici
Utilizzati per raccogliere informazioni statistiche anonime sull’utilizzo del sito e migliorare i contenuti.
Cookie di profilazione
Utilizzati per personalizzare contenuti e annunci in base ai tuoi interessi.