Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an OSX partition that does not take up the whole drive. Somehow, I managed to damage the unallocated space in a way that disk utility does not let me use it even though it is labeled "free space" in diskutility.

When I try and format my partition that I intended to use as windows, i get this message:

Partition failed with the error:

MediaKit reports not enough space on device for requested operation.

enter image description here My goal is to have a windows partition alongside my current OSX one.

Option 1:

What tools should I use and what should I try to format that partition without touching my OSX one?

Option 2: Should I instead try to create an image of the disk and clean everything then restore the partition after i install windows? How would I do that?

share|improve this question
    
Is this on a mac? –  ohope5 May 11 '13 at 19:51
    
yes its on mac . –  stackOverFlew May 11 '13 at 19:52
    
Do not think of installing windows before osx at all then. –  ohope5 May 11 '13 at 19:53
    
hm ok. what should I do then? –  stackOverFlew May 11 '13 at 20:01
    
Does Disk Utility let you create any other kind of partition in the free space? Can you create a JHFS+ ("Mac OS Extended, Journaled") in that space? What if you set it to just 100 GB instead of the full 107? –  Spiff May 11 '13 at 22:31
show 3 more comments

4 Answers

up vote 1 down vote accepted

First, back up all your important data! Partitioning operations in general are inherently risky, and an error message that seems strange could be a sign of a serious problem lurking somewhere that will jump out and bite you.

With that done, I recommend the following:

  1. Boot a Linux live CD, such as Parted Magic or System Rescue CD.
  2. In the Linux live CD, open a Terminal window.
  3. Launch gdisk on the disk, as in gdisk /dev/sda.
  4. In gdisk, type v to verify the disk structures. This is a precautionary diagnostic. If gdisk reports any errors, please add its output to your original post and do not continue with this procedure! I'll assume that gdisk won't find errors....
  5. Exit from gdisk by typing q.
  6. Launch GParted on the disk by typing gparted /dev/sda or by launching GParted from a menu.
  7. Using GParted, create an NTFS partition in your free space, but leave at least 128MiB of unpartitioned space between it and your OS X partition.
  8. Exit from GParted.
  9. Launch gdisk on the disk again.
  10. In gdisk, type p to view your partition table. Chances are you'll have three partitions: an EFI System Partition (ESP), a Windows (NTFS) partition, and an OS X partition. If they're out of order, you can optionally type s to sort them; be sure to type p again to verify the change if you do this.
  11. In gdisk, type r to enter the recovery & transformation menu.
  12. In gdisk, type h to create a new hybrid MBR. gdisk will ask for partition numbers. Enter the numbers for the NTFS and OS X partitions. It will ask a number of other questions. For the most part, you can use the defaults. I recommend setting the boot flag on the NTFS partition, though. See the gdisk documentation on hybrid MBRs for more information.
  13. in gdisk, type w to save your changes and exit.

At this point, you should be able to install Windows.

share|improve this answer
    
wow. this is the post i have been looking for. I will report back to you after i finish the backup. (creating an image of my hdd) –  stackOverFlew May 12 '13 at 4:01
    
this worked great. thank you so much. i dont know why someone minus one'd you –  stackOverFlew May 17 '13 at 4:38
add comment

You can try to edit the partitions in a free OS like ubuntu using a tool named GParted Partition Editor (it should already be included with ubuntu. Use the first link below to find out how to start it). This may eliminate your issue. You can then change your partitions by booting up a LiveUSB of ubuntu into your mac.

This link may help you (its for dual-boot with windows/ubuntu but you can probably fill in the blanks)

I don't have a mac and I don't know if you tried this, but this link may help as well.

I hope that this helps (if it does, please confirm or at least vote up my answer)

share|improve this answer
add comment

You will have to free up enough disk space in order for the requested partitions to hold what they do.

Make sure that you are giving enough room for OSX.

share|improve this answer
    
He added a picture showing he has over 100 GB of free space there. –  Spiff May 11 '13 at 20:23
    
As the memory required for the new partition increases, the memory supplied to the other partition (OSX) decreases. –  HelpingHand May 11 '13 at 20:30
    
If my answer showed your problem, please confirm it. Thank you. –  HelpingHand May 11 '13 at 23:35
add comment

In Disk Utility, you can repair the partition table itself by selecting the drive itself (i.e. NOT an indented partition) and doing a first aid repair on that.

If that doesn't work, consider growing or shrinking your working JHFS+ partition slightly (this is a non-destructive procedure) to force the partition table to get rewritten.

Update: One last thought, Boot Camp used to have a restriction where the Windows partition had to be the last of the first 5 (or was it 3?) partitions on the drive, or something like that. Maybe it still has that restriction. It could be that something's giving the wrong error code or misinterpreting the error code and giving an incorrect/unhelpful error.

share|improve this answer
    
here is what happened when i clicked first aid:Checking prerequisites Checking the partition list Adjusting partition map to fit whole disk as required Checking for an EFI system partition Checking the EFI system partition’s size Checking the EFI system partition’s file system Checking all HFS data partition loader spaces Reviewing boot support loaders Checking Core Storage Physical Volume partitions Updating Windows boot.ini files as required The partition map appears to be OK –  stackOverFlew May 11 '13 at 20:22
    
looks like the everything is fine with the disk. I am now shrinking the partition a couple gigs like you said. do you know if i can solve tihs issue by using gparted booted from a live cd? –  stackOverFlew May 11 '13 at 20:23
    
@stack You left out a detail here. Did you try making a partition again after repairing the partition table? –  Spiff May 11 '13 at 20:48
    
yes i did. nothing has changed so far –  stackOverFlew May 11 '13 at 21:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.