The reason I was deleting the partition was to do a complete format of my hard drive and a clean install of Lion.
If your doing a complete drive reformat, this includes/deletes ALL the partitions on the drive including
1: EFI (hidden)
2: MacintoshHD partition (OS X, programs and files)
3: Bootcamp partition
To do this you hold commmand option r keys down and boot the Mac into Internet Recovery which loads from Apple's servers.
Next you select your internal boot drive on the left in Disk Utiliy, click Partition and 1, Option: GUID, Format: OS X Extended Journaled and click Apply. All the partitions will be erased.
If you have a boot hard drive (no SSD), it's a good idea to also Erase > and move the slider one spot to the right (Zero) and also do that. to map off bad sectors on the drive before putting data on them.
Quit and install OS X with your AppleID and password, then upgrade later.
If you don't have Internet Recovery, you use the 10.6 install disks and hold c or option/alt to boot from those and do the same thing.
So since your removing Lion and BootCamp anyway, you can do both at the same time.
Couldn't modify partition map because file system verification failed.
"couldn't unmount disk"
You have failed sector or corruption in your GUID Partition Table , this is the scheme that tells the hardware what partitions and their locations on the boot drive. It appears first then all your other partitions come afterwards.
What we will try to do is get a alternative Partition Map scheme to install there and get it to erase it, and once that's completed then we can set it back to the GUID that OS X needs.
Try both on the whole drive:
1: Click on Option: MBR Format: MSDOS and click Apply
2: Click on Erase Tab, then move the slider one spot to the right (Zero erase) and click Apply. (this will take some time to complete)
If you could only do #2, then do #1 and see if it now works. The object is to see if you can regain control of changing your Partition Map Scheme or not.
#2 needs to be completed to map off the failed bad sector and the whole drive gets done in the process. why it takes so long to complete.
3: Click back on the Partition tab and Partition Layout: 1, then click the Box and click Option: GUID and Format OS X Extended Journaled and give it a name MacintoshHD.
4: Quit and install OS X using your AppleID and password.
Partition failed "couldn't unmount disk"
Even if you did #2 on the whole drive you still get the "couldn't unmount disk"?
And you are booted from Internet Recovery correct?
Did you try using First Aid > Repair Disk on the entire drive? Try from #2 again, else continue below.
Guess we will have to use Terminal then. Quit Disk Utility and under the menu is Terminal.
type in each and press return:
Get the identifier for your boot drive say it's "disk0"
diskutil unmount force disk0
diskutil erase disk0
diskutil mountDisk disk0
Should be rather quick and painless.
Next Quit Terminal and head back to Disk Utiltiy and click on the entire drive again and click Erase and move the slider one spot to the right (for Zero) and click Erase. Come back after a spell when it's finished.
When finished head to Partition tab, then Partition Layout and click 1, then option: GUID and Format: OS X Extended Journaed and the name MacintoshHD and click Apply.
Quit and install OS X using your AppleID and password.
If this don't work, I don't know what will.
Forgive me if this seems to be taking a lot of time, it's not like a Partition Map scheme gets screwed up often, in fact it's very rare as it only takes a tiny portion on the drive.
If this doesn't work I hope you don't have to replace the drive.
Getting there, after what Terminal command I gave you that this message appeared?
These are the commands for ownership
diskutil enableOwnership disk0
diskutil disableOwnership disk0
You can open a new Terminal window and enter
to see the list of commands.
If you need to clear the Terminal screen
At this point I'm experimenting
If all you have to do is mount the drive, then you can simply reboot back into Internet Recovery and it will mount the drive in Disk Utility again.