I recently realised when that partitioning the drive on my Macbook Pro 50% OsX and 50% vista was not such a great plan. It turns out I use OsX for 90% of my work and Windows for 10%. So my OsX partition was rapidly filling, whereas my Vista partition was empty.
So I decided to try and shrink it. However all the instructions I found suggested you had to back up, resize vista, and then restore it. This sounded tedious - so knowing better :) I decided I would have a go at doing without doing backing up and restoring and instead using gparted. I have used gparted before several times (it is an open source equivalent of partition magic) and it has previously worked well.
The instructions below detail how to do this - and for me it did work. However this all comes with a huge health warning - I nearly lost my Vista partition doing this - and in
hindsight it would have been quicker (and easier to just back it up and restore). But for posterity I decided to write up the process anyhow.
Before you start
You will need
- a backup in case anything goes wrong
- Your Windows Disk
- A network connection to download stuff
- 2 CDRs (one for rEFIt and one for gparted)
- To be on the mains - don't even think about trying to do this on battery!
The Steps
- Run JKDefragGUI on the partition in 'Forced' mode -

This will force all the files to the end of the Vista partition so you can shrink it. Unfortunately this can't move some system files - hence the next step.
- (Optional but may be needed) Run page defrag.
On Vista this won't 'just' work and you need to do the following.- On the start menu find command prompt
- Right Click -> Run as administrator
- Run page defrag set it to run at next boot
- Restart
- (Optional but may be needed) Disable your windows swap file. This enusres the windows page file doesn't get in the way. This can be done as an alternative or as well as running pagedefrag above. Page defrag is still useful as it also defrags the registry.
- Start Control Panel
- Start System
- Click Advanced System Settings
- Click performance and change to the advanced tab
- Set all swap files to none
- Download the GParted Live CD and burn to a disk.
- Boot into gparted (hold ALT during startup) - the defaults should just work
- Shrink your Vista/XP partition (don't play with the osx one at all)
- Watch out for the laptop going to sleep.

If it can't resize the disk small enough for you either-- You need to delete something--
Or you have some files stuck in an annoying place on the partition
- Boot into gparted (hold ALT during startup) - the defaults should just work
Now we ned to grow Mac diskWe need to be 'root' so
sudo su -
discutil -list/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *186.3 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Apple_HFS Macintosh HD 91.9 Gi disk0s2
3: Microsoft Basic Data 58.6 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *183.8 Gi disk1
1: Apple_partition_map 31.5 Ki disk1s1
2: Apple_HFS ben 183.7 Gi disk1s2
will list your disks - find the name of the one you want to grow - in my case it is disk0s2
Now check the limits you can resize withindiskutil resizeVolume disk0s2 limits
For device disk0s2 Macintosh HD:
Current size: 98650030080 bytes
Minimum size: 73892048896 bytes
Maximum size: 136787914752 bytesPresuming you want the maximum run (substituting the size from above followed by a B)
diskutil resizeVolume disk0s2 136787914752B
Started resizing on disk disk0s2 Macintosh HD
Verifying
Resizing Volume
Adjusting Partitions
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ]
Finished resizing on disk disk0s2 Macintosh HDThis took 2-3 minutes - while it is doing it the screen may freeze. Don't panic. Just wait.
You now have a smaller bootcamp partition and a larger OSX one.
However bootcamp will now be very confused - this is to do with Vista/Linux/OSX having slightly different ideas of what a partition is.
So you need to 'fix' this - fortunately there is a free utility for this - refit.
- Download rEFIt and burn the DMG to a CD.
- It is bootable - so reboot and hold down Alt to boot off it.
- Once in the menu use the arrow key to select partition manager.It should fix your MBR.
Reboot and this time start Windows Via Bootcamp. It may fail horribly (it did for me) as the Windows bootloader couldn't find Vista. - Insert your windows CD
- Reboot and boot off it (by holding ALT)
- Select your language
- Select repair (at the bottom of the screen)This will fix vista.
Reboot again - this time boot into Vista
- Chkdsk will run and 'fix' stuff
- Vista should now be well again.
- If you deleted your swapfile above you will want to recreate it otherwise your vista will be v. slow and will break a lot. A helpful hint is NOT to let Vista manage it dynamically as that is how the page file gets fragmented in the first place and instead just create one at the recommended size.
If you use VMFusion (this may also be true for parallels) to boot the Vista partition inside OSX it won't work straight away. It seems to store some details that have changed. To fix this 'simply'
Start Terminalcd Library/Application\ Support/VMware\ Fusion/Virtual\ Machines/
rm -rf Boot\ CampThis will reset VMWare, it will now re-detect and configure your boot camp partition and it should all work again.

0 comments:
Post a Comment