This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
virtualisation [2017/07/27 12:42] hkoller [Resizing a (system) disk] |
virtualisation [2020/02/13 11:07] mantis [Trusty KVM, 64bit] |
||
---|---|---|---|
Line 52: | Line 52: | ||
</code> | </code> | ||
+ | |||
+ | ==== Bionic ==== | ||
+ | |||
+ | <code bash> | ||
+ | virt-builder ubuntu-18.04 --format qcow2 --size 20G -o ubuntu1804.qcow2 --root-password password:ubuntu | ||
+ | </code> | ||
===== Empty disk Images===== | ===== Empty disk Images===== | ||
Line 134: | Line 140: | ||
sudo qemu-img resize image.qcow2 +10G | sudo qemu-img resize image.qcow2 +10G | ||
</code> | </code> | ||
+ | |||
+ | Make sure virt-manager knows about the changed disk size: go to "Storage" and Refresh (not sure if really necessary, but cant hurt..) | ||
Next boot the VM, log in and increase the size of the partition. This is done by deleting the old partition and re-creating it with the same start, but a larger size: | Next boot the VM, log in and increase the size of the partition. This is done by deleting the old partition and re-creating it with the same start, but a larger size: | ||
Line 140: | Line 148: | ||
sudo fdisk /dev/vda | sudo fdisk /dev/vda | ||
#sudo fdisk --compatibility=dos /dev/vda # in case you want to start at sector 63 | #sudo fdisk --compatibility=dos /dev/vda # in case you want to start at sector 63 | ||
+ | # or on newer fdisk versions: | ||
+ | #sudo fdisk -c=dos /dev/vda # in case you want to start at sector 63 | ||
p # print partition table and memorize start sector etc. | p # print partition table and memorize start sector etc. |