diff options
Diffstat (limited to 'md/writeup/running_disk_images_in_qemu.md')
-rw-r--r-- | md/writeup/running_disk_images_in_qemu.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/md/writeup/running_disk_images_in_qemu.md b/md/writeup/running_disk_images_in_qemu.md index afdf6fa..3a7c4ea 100644 --- a/md/writeup/running_disk_images_in_qemu.md +++ b/md/writeup/running_disk_images_in_qemu.md @@ -151,6 +151,30 @@ Linux Documentation/admin-guide/init.rst for guidance. ]---" Next step is to figure out what to do with this info, maybe make your own distro? Create some cool ass crypto drive? Or just have fun. +## Resize image + +When space runs out on the virtual machine, provided images can be resized +Here is example how to resize image to bigger size and still be able to run it on +qemu. + +Main step that is may harm is fdisk, save disk layout with +``` +fdisk -l of=raspbian-stretch-lite-20gb.img +``` +and use it for later reference when partition will be resized. + +``` +dd if=2017-08-16-raspbian-stretch-lite.img of=raspbian-stretch-lite-20gb.img seek=0 conv=notrunc +fdisk -l raspbian-stretch-lite-20gb.img +#use here fdisk to resize partiions +sudo kpartx -a raspbian-stretch-lite-20gb.img +sudo kpartx -d raspbian-stretch-lite-20gb.img +sudo e2fsck /dev/mapper/loop0p2 +resize2fs /dev/mapper/loop0p2 +``` + + + ## References to other articles [01] [http://main.lv/writeup/compile_linux_kernel.md](http://main.lv/writeup/compile_linux_kernel.md) @@ -172,3 +196,5 @@ Create some cool ass crypto drive? Or just have fun. [12] [https://en.wikibooks.org/wiki/QEMU/Images](https://en.wikibooks.org/wiki/QEMU/Images) [13] [https://wiki.gentoo.org/wiki/QEMU/Linux_guest](https://wiki.gentoo.org/wiki/QEMU/Linux_guest) [14] [https://www.cs.vu.nl/~herbertb/misc/writingkernels.txt](https://www.cs.vu.nl/~herbertb/misc/writingkernels.txt) +[15] [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/s2-disk-storage-parted-resize-part](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/s2-disk-storage-parted-resize-part) +[16] [https://access.redhat.com/articles/1190213](https://access.redhat.com/articles/1190213)
\ No newline at end of file |