aboutsummaryrefslogtreecommitdiff
path: root/DOCS.md
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-04-02 15:14:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-04-02 15:14:29 -0300
commit3ff504c70b291d6c41fdd2acbc15c58982f0e847 (patch)
treebd366c2c55a340633e7f18ca4181670df98fa1a3 /DOCS.md
parentd888cd87a04162ff05b58a1adce9d07817f335ee (diff)
downloadkvmx-master.tar.gz
kvmx-master.tar.bz2
Feat: adds the commandHEADmaster
Diffstat (limited to 'DOCS.md')
-rw-r--r--DOCS.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/DOCS.md b/DOCS.md
index e837f6b..0ca4c6a 100644
--- a/DOCS.md
+++ b/DOCS.md
@@ -40,3 +40,40 @@ Misc documentation on kvmx and qemu.
* https://bugs.launchpad.net/qemu/+bug/1810000
qemu system emulator crashed when using xhci usb controller
+
+## Manually resizing an image
+
+Nowadays this can be done with `kvmx growpart <device> <partition> <additional_size>`, but
+here goes some manual procedures if needed.
+
+* Image resize action, doing something like this, thanks to
+ https://ahelpme.com/linux/online-resize-of-a-root-ext4-file-system-increase-the-space/
+
+ # poweroff
+ kvmx poweroff $guest
+
+ # resize image
+ qemu-img resize `kvmx list_image $guest` +5G
+
+ # power up
+ kvmx up $guest
+
+ # ensure parted is installed
+ #sudo apt-get install -y parted
+ kvmx ssh $guest sudo apt-get install -y cloud-guest-utils
+
+ # resize virtual machine root fs - while the partition is mounted!
+ # this parted command currently need to be done manually
+ #echo resizepart 2 -1 | kvmx ssh $guest sudo parted /dev/vda
+
+ # See https://unix.stackexchange.com/questions/373063/auto-expand-last-partition-to-use-all-unallocated-space-using-parted-in-batch-m
+ # https://unix.stackexchange.com/questions/190317/gnu-parted-resizepart-in-script#202872
+ # https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203
+ # https://techtitbits.com/2018/12/using-parteds-resizepart-non-interactively-on-a-busy-partition/
+ # https://serverfault.com/questions/870594/resize-partition-to-maximum-using-parted-in-non-interactive-mode
+ #kvmx ssh $guest sudo parted /dev/vda resizepart 2 -1 Yes
+ kvmx ssh $guest sudo growpart /dev/vda 2
+
+ kvmx ssh $guest sudo resize2fs /dev/vda2
+ kvmx ssh $guest sudo touch /forcefsck
+ kvmx restart $guest