Page 1 of 1

Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Posted: 17. Apr 2011, 09:39
by jayakumar
Hi,

I had a 160GB dual-boot Windows XP/Ubuntu system (laptop) which I wanted to convert into a single WinXP VDI for use with VirtualBox. The windows partition in this was 80GB in size and has a bunch of crappy software that I often need to use. So I dd-ed 100GB of the laptop's hard disk on to my host as a raw image. I then successfully converted this raw image into a VDI. So, I now have a 100GB VDI that contains an 80GB Windows partition and 20GB ext3 partition that just has the grub menu and start files. This works fine in virtualbox, I see it boot, go to the grub menu, and then chainload XP and all is good. The only issue is that the VDI is 100GB in size. So, I then defrag-ed and cleaned up the Windows partition so that it now has 50GB free. So, in theory, I should be able to resize my ntfs to 40GB (giving me still 10GB free in windows) and delete/shrink the other partitions to the minimum needed to hold the grub menu to chainload XP, lets call it a single 3GB partition. So my plan is:
- running guest
- boot from ubuntu CD in guest
- repartition the 100gb using ubuntu live CD into 40GB ntfs, 3GB grub/ubuntu, and leave the remainder (3rd partition) unallocated (so 57GB of unused partition)
Now, on the host, how do I clonevdi such that I can get the new vdi size to be 43GB instead of 100GB? That is, can I tell clonevdi that I don't want it to clone the unused partition on the original vdi? Thanks in advance for any advice or suggestions.

Thanks,
jaya

Re: Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Posted: 17. Apr 2011, 11:00
by jayakumar
Ah, I underestimated the smartness of clonevdi. Once I deleted the guest 3rd partition in the guest itself, then clonevdi --existing was smart enough to ignore the unwanted data.

Thanks virtualbox developers! You have done an awesome job.

Re: Deleting dual boot's 3rd partition (guest=winxp+ubuntu)

Posted: 17. Apr 2011, 13:54
by Sasquatch
To get rid of the Grub bootloader, run the recovery mode of the XP install disc and run fixmbr and fixboot. That will rewrite the MBR of the 'disk' to point to the Windows bootloader, instead of Grub. You can then remove the ext3 partition that holds the grub bootloader.

As for the partition size, you will still be able to let it grow up to 100 GB, but the file itself, the VDI, won't grow beyond the limit set as partitioned space. The RAW state will be ignored until you allocate it.