{"id":100,"date":"2011-03-24T20:17:56","date_gmt":"2011-03-24T10:17:56","guid":{"rendered":"http:\/\/helms-deep.net\/~rwh\/blog\/?p=100"},"modified":"2011-03-24T20:25:41","modified_gmt":"2011-03-24T10:25:41","slug":"resizing-a-virtualbox-hard-drive-howto","status":"publish","type":"post","link":"https:\/\/helms-deep.net\/~rwh\/blog\/?p=100","title":{"rendered":"Resizing a VirtualBox Hard Drive HOWTO"},"content":{"rendered":"<p>Update: There&#8217;s another method here that skips the use of clonezilla and does everything with gparted: <a href=\"http:\/\/www.modhul.com\/2008\/10\/21\/re-sizing-a-virtualbox-virtual-disk-image-file\">Re-sizing a VirtualBox Virtual Disk Image File<\/a><\/p>\n<p>VirtualBox doesn&#8217;t currently offer any tools for directly resizing a hard drive image (VDI).  This method, using only free software tools, allows you to perform that task without any risk of losing the data you currently have on the image.<\/p>\n<p>First, we&#8217;ll create a new, larger VDI, then we&#8217;ll use Clonezilla to clone our old one to the new one, then we&#8217;ll use Parted Magic to resize our partitions to fill our new, larger VDI, and finally will remove our old VDI from our machine image.  This method assumes a linux client, but it should be equally applicable to a windows client (probably easier, given that there is no swap partition).<\/p>\n<p>Download clonezilla live (stable release): <a href=\"http:\/\/clonezilla.org\/downloads.php\">http:\/\/clonezilla.org\/downloads.php<\/a><br \/>\nRight click on the machine, settings<br \/>\nStorage, click on the SATA Controller, Add Hard Disk<br \/>\nCreate new (larger) VDI disk image<br \/>\nYou should now see two VDI images listed under SATA controller<br \/>\nClick on the CD drive, underneath the IDE controller<br \/>\nUnder attributes, click the CD icon, choose a virtual CD\/DVD disk file&#8230;<br \/>\nchoose the clonezilla live iso image you downloaded<br \/>\nClick OK<br \/>\nBoot the machine<br \/>\nStart Clonezilla live<br \/>\n&#8211; English<br \/>\n&#8211; Select keymap from full list<br \/>\n&#8211; pc \/ qwerty \/ British \/ Standard \/ Standard<br \/>\n&#8211; Start Clonezilla<br \/>\n&#8211; device-device<br \/>\n&#8211; Expert<br \/>\n&#8211; local disk to local disk clone<br \/>\n&#8211; sda as source<br \/>\n&#8211; sdb as target<br \/>\n&#8211; check the -r and -q1 options.  -q1 is required because the faster methods fail in virtualbox for some reason.  Slower, but works. \ud83d\ude41<br \/>\n&#8211; Use partition table from source disk<br \/>\n&#8211; Enter to continue<br \/>\n&#8211; yes, we&#8217;re sure we want to continue<br \/>\n&#8211; yes, again, we&#8217;re sure<br \/>\n&#8211; yes, clone the bootloader<br \/>\n&#8211; yes, we&#8217;re sure!<br \/>\n&#8211; once it completes, 0 to power off<br \/>\n&#8211; Enter<br \/>\nDownload Parted Magic: <a href=\"http:\/\/partedmagic.com\/doku.php?id=start\">http:\/\/partedmagic.com\/doku.php?id=start<\/a><br \/>\nGo into settings of the machine again.  Change the sata ports around so that the new drive is on SATA Port 0 and the old one on SATA Port 1.  We can remove the old one once we&#8217;re sure the new one works.<br \/>\nClick on the CD drive, underneath the IDE controller<br \/>\nUnder attributes, click the CD icon, choose a virtual CD\/DVD disk file&#8230;<br \/>\nchoose the pmagic iso image<br \/>\nOK<br \/>\nStart the machine<br \/>\n&#8211; Boot with default settings<br \/>\n&#8211; Button bottom left -&gt; System Tools -&gt; Parition editor<br \/>\n&#8211; Resize the extended partion to take up all remaining space (right click -&gt; resize\/move)<br \/>\n&#8211; Then do the Resize\/move on \/dev\/sda5 (swap).  Change the free space following to 0 (this moves it to the end).  Click OK on the warning dialogue.<br \/>\n&#8211; Resize the extended partition down to maximise the free space preceding it.  OK on the warning message.<br \/>\n&#8211; Resize \/dev\/sda1 to use up all the free space.<br \/>\n&#8211; Click the Apply button.<br \/>\n&#8211; Click Apply to continue.<br \/>\n&#8211; Click close when it&#8217;s done.<br \/>\n&#8211; Bottom left button -&gt; logout -&gt; shut down<br \/>\nSettings of the machine again<br \/>\nRemove the iso image from the CD drive, then click OK.<br \/>\nStart the machine.  If it boots OK (did for me), we can shut it down and remove and delete the old VDI hard disk image.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: There&#8217;s another method here that skips the use of clonezilla and does everything with gparted: Re-sizing a VirtualBox Virtual Disk Image File VirtualBox doesn&#8217;t currently offer any tools for directly resizing a hard drive image (VDI). This method, using &hellip; <a href=\"https:\/\/helms-deep.net\/~rwh\/blog\/?p=100\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[19,29,21,24,25,31,27,30,28,20,22,23,18,32,26,16,17],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-clonezilla","tag-free","tag-gparted","tag-hard-drive","tag-hdd","tag-howto","tag-iso","tag-libre","tag-oss","tag-parted","tag-parted-magic","tag-partition","tag-resize","tag-sysadmin","tag-vdi","tag-virtual","tag-virtualbox"],"_links":{"self":[{"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":4,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/helms-deep.net\/~rwh\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}