Date: Tue, 22 Apr 2014 14:40:12 -0700 From: Rudy <crapsh@monkeybrains.net> To: freebsd-virtualization@freebsd.org Subject: HOW-TO resize a .img Ubuntu guest Message-ID: <5356E1BC.7060802@monkeybrains.net>
next in thread | raw e-mail | index | archive | help
Cloning images and growing them. We have a 'standard install' image called, 'ubuntu14-clone-me.img'. To copy, enlarge, and then grow the guest image size, we use the process below. Let's take an Ubuntu image (ubuntu14-clone-me.img), clone it, grow the system, then log into the Ubuntu guest (vm12) and resize the / partition (all our guests are single partition). In FreeBSD: FreeBSD# gcp --sparse=always ubuntu14-clone-me.img vm12.img FreeBSD# truncate -s 300g vm12.img Launch guest with bhyve, get on console, and use these commands: Guest-VM# swapoff -a Guest-VM# fdisk /dev/vda hit 'p' to print existing table delete all the paritions recreate partition '1' with same stating block noted in the 'print' make end block near end but with enough room for your swap create an extended parition '5' and put the rest in there for guest swap Guest-VM# reboot Guest-VM# resize2fs /dev/vda1 Done! Pro tip: research sparse files, install gcp (pkg install coreutils). Rudy MonkeyBrains.net Local ISP
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5356E1BC.7060802>