Random ramblings about Mac, Python, TeX, programming, and more   |     |        |     |  



Resizing windows partition on my iMac

July 18, 2009  |  mac, software  |  not published
On my iMac at home I use Boot Camp and VMWare Fusion to make it possible to use Widows (Vista). After I moved all media files to an external disk (Drobo) I got a lot of available disk space on the Mac partition of the disk. The Windows partition has always been to small (32 GB) for all the games and maps installed on it, and I decided to make repartition the disk with a larger Windows partition. The way to do this is to delete the Windows partition using Boot Camp Assistant, and then create a new larger partition using the Boot Camp Assistant again. But since I don't want to reinstall everything on the Windows partition I cloned the content of it using WinClone (I downloaded it from Versiontracker). So the step by step process I planned was this:

  1. Use WinClone to create a copy of the content on the old Windows partition (WinClone works with NTFS only, I think)

  2. Delete the old Windows partition with Boot Camp Assistant (and reboot your Mac)

  3. Create a new Windows partition with Boot Camp Assistant (I created a 99 GB partition for Windows)

  4. Use your Windows install media to create a NTFS file system on this new partition (you start the Windows install process from Boot Camp Assistant and cancel it after the Windows partition is formated)

  5. Reboot into Mac OS X (you might have to use your Mac OS X install media to do this since the Windos install process above might have overwritten the boot partition of the disk)

  6. Use WinClone to restore the Windows partition with the backup you created in step 1

  7. If Windows did overwrite the boot partition, fix the boot partition problem (I do this by installing the rEFIt boot menu)

  8. Reboot into Mac and Windows to see if everything works


This was the smooth and everything works perfect version, but of course it never does. First of all you should have a backup of everything important before you do anything like this. If you loose data and you don't have a backup of it, it was you who messed up. And the backup should not be on the disk you are repartitioning.

In step 3 when I tried to create a new partition using the Boot Camp Assistant I got an error. The problem was some inconsistent on the file system on the disk. To fix this I had to boot the iMac using the Mac OS X install DVD. In the tools menu I selected the disk tool, and then I performed the repair disk operation on the disk. It found a few errors and fixed them. After I had done this I rebooted into Mac OS X and retried step 3. This time it did work.

I also got some problems in step 6. I think the source of this was that also the Windows partition of the disk had some problems and that these problems were transfered to the backup created in step 1. After performing step 1 you should verify that the created disk image does not contain any errors. You can do this with hdiutil (where Path is the path to where you created the backup and Windows is the name of the backup):
  /usr/bin/hdiutil verify /Path/win-vista.winclone/Windows.dmg

But I didn't do this, and restoring the Windows partition failed. The Log window of Winclone showed my when things went wrong (and the operation it performed). I tried to fix it by ignoring the fact that it was impossible to verify the Windows disk image. I attached it without verifying it first (adding the ignorebadchecksums and noverify flags):
  /usr/bin/hdiutil attach -nomount -ignorebadchecksums -noverify /Path/win-vista.winclone/Windows.dmg

Then I performed the actual cloning (adding the rescue flag):
  sudo /Applications/Winclone.app/Contents/Resources/ntfsclone -f -f -f --rescue -O /dev/disk0s3 /dev/disk4

NB: /dev/disk0s3 is the new empty Windows partition (it might have a different name on your system, check the Winclone log) and /dev/disk4 was the name given when the Windows image was attached (see the response from the hdiutil attach comand above). But now I had an incomplete Windows partition, and who knows if it will be able to boot. Well, I had to try it.
Page status: draft  |   Last updated: July 18, 2009
Number of visits: 0  |  2024-11-07: 1/1