Page 1 of 1

Virtualbox Gparted VDI Resize

Posted: 12. Mar 2009, 10:29
by bf109
I was in the Ubuntu Forums poking around and tried to see if their virtualization forum might have someone that could give me some insight into a problem I am having in VirtualBox. No one has given me any really helpful feedback yet so I thought I would try here which is where I should have tried to begin with. :oops:

Here is the link to the thread that will tell all that is the matter and that is driving me up the wall with confusion:

http://ubuntuforums.org/showthread.php?t=1089860

I'm running Ubuntu 8.10 and VBox version 2.0.4_OSE.

I was thinking of somehow using the vboxmanage clonevdi process that I just successfully used to clone a W2K3 .vdi and then maybe use the GParted program again to see if that might do the trick.

Any helpful hints would be very much appreciated.

Re: Virtualbox Gparted VDI Resize

Posted: 13. Mar 2009, 19:40
by TerryE
Most of this is covered in my tutorial All about VDIs. Yes, you can use a GParted LiveCD. But (assuming that your source disk is HD1 and your new disk HD0) -- first do a dd if=/dev/hdb of=/dev/hda bs=512 count=1 to copy the MBR from the old disk. Then use fdisk to delete the partitions (s) on HD0 and write back to reload the partition info.

Switch into the Gparted Application and copy then extend the partitions. Don't do the full dd (the gparted copy is faster since this just copies allocated blocks.) Make the dest VDI about 100-200% bigger than the target partition(s) if you are using a dynamic VDI but leave this space unallocated. (That way you can just grow your partition next time.) Finally remember to activate the system partition on the new HD0.

Re: Virtualbox Gparted VDI Resize

Posted: 16. Mar 2009, 01:18
by bf109
TerryE wrote:Most of this is covered in my tutorial All about VDIs."Then use fdisk to delete the partitions (s) on HD0 and write back to reload the partition info."

"Finally remember to activate the system partition on the new HD0."
Sorry TerryE but you are talking to a complete newb here. :oops:

I did not understand what you meant by "and write back to reload the partition info." Did you mean RIGHT back to reload, meaning return to gparted to copy the partition data?

Also, did this mean set the boot attribute in gparted?

"Finally remember to activate the system partition on the new HD0."

Re: Virtualbox Gparted VDI Resize

Posted: 16. Mar 2009, 04:59
by TerryE
The kernel reads the MBR + EBRs for each disk to work out what partitions are on the disk, e.g. /dev/sda0, /dev/sda1, ... When the MBR is blank these don't exist so if you change the MBR then you need to let the kernel know to rescan it. Fdisk does this when you tell it to write back content to the MBR.

In the case of a Windows MBR, it scans the partition list for one that is marked as "active" and boots from that. One of the most common problems is that users forget to activate the Windows system so the bootstrap loader then fails to boot. You can do this with Gparted, fdisk or a number of other tools.