You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't format former Boot Camp partition

So I stupidly erased my Boot Camp partition using Disk Utility rather than in the Boot Camp Assistant. And now I the partition is stuck as free space and i can't change it. When i select the free space in Disk Util, I can change it to Mac OS Extended and ExFAT as usual, but when I press apply, the progress bar appears for a brief second and disappears. Then it acts as if I never pressed apply; when I close the window, it says that I have unsaved changes. The free space does not appear as a drive in the left sidebar.


I have tried reinstalling OS X, I've tried returning to a time machine backup, I've verified and repaired the disk, but nothing has worked.

I'm left with 67GB of space unusable on my macbook now.

MacBook Pro with Retina display, OS X Mavericks (10.9.4)

Posted on Oct 11, 2014 9:36 AM

Reply
239 replies

Jul 31, 2015 2:24 PM in response to Loner T

please I don't know where I am getting the keys wrong.
control what I keyed in please


-bash-3.2# sudo gpt -w -r show /dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt-w-r show/dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt -w -r show /dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt -w -r show /dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt -vv -r show /dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt-w-r show /dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo gpt -w -r show/dev/disk1

-bash: sudo: command not found

-bash-3.2# sudo fdisk /dev/disk1

-bash: sudo: command not found

-bash-3.2#

-bash-3.2# sudo fdisk /dev/disk1

-bash: sudo: command not found

-bash-3.2#

Jul 31, 2015 2:39 PM in response to Loner T

Ok, I got the terminal report. I removed (sudo)...


-bash-3.2# gpt -vv -r show /dev/disk1

gpt show: /dev/disk1: mediasize=1000204886016; sectorsize=512; blocks=1953525168

gpt show: /dev/disk1: PMBR at sector 0

gpt show: /dev/disk1: Pri GPT at sector 1

gpt show: /dev/disk1: Sec GPT at sector 1953525167

start size index contents

0 1 PMBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 1404036160 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC

1404445800 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

1405715336 1144

1405716480 547807232 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

1953523712 1423

1953525135 32 Sec GPT table

1953525167 1 Sec GPT header

-bash-3.2#

-bash-3.2# fdisk /dev/disk1

Disk: /dev/disk1 geometry: 121601/255/63 [1953525168 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 1023 254 63 - 1023 254 63 [ 1 - 1953525167] <Unknown ID>

2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

-bash-3.2#

Jul 31, 2015 3:03 PM in response to ralphejims

Can you boot normally and run GPT Fdisk and the following steps to create the MBR?


Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR. Use defaults for other questions (like partition codes). The only values that need modifications are the Boot flags and step 10. Accept all other defaults that Gdisk offers. Please see thesample Q&A as an example. These steps can be repeated if you make a mistake before you get to Step 12, otherwise start from Step 1 for these steps. Step 6 has numbers which are typed with a space between the numbers.

  1. Sudo gdisk /dev/rdisk0
  2. P (Print list of parts)
  3. R (Recover)
  4. O (print current Hybrid MBR)
  5. H (chooses Hybrid)
  6. Partitions numbers to be hybridized: 2 3 4
  7. Y (Good for GRUB question)
  8. N (part 2 boot flag)
  9. N (part 3 boot flag)
  10. N (part 4 boot flag)
  11. O (print current Hybrid MBR)
  12. W (Write the new MBR)
  13. Y (Yes! write the new MBR)
  14. Reboot


Here is sample Q&A for this section. Please notice the Press Enter/Return.


Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y


Creating entry for GPT partition #2 (MBR partition #2)

Enter an MBR hex code (default AF): Press Enter/Return

Set the bootable flag? (Y/N): N


Creating entry for GPT partition #3 (MBR partition #3)

Enter an MBR hex code (default AB): Press Enter/Return

Set the bootable flag? (Y/N): N


Creating entry for GPT partition #4 (MBR partition #4)

Enter an MBR hex code (default 07): Press Enter/Return

Set the bootable flag? (Y/N): Y

Jul 31, 2015 3:48 PM in response to Loner T

Hi Loner

I posted this on another thread but it doesn't seem to be showing up yet, so excuse me for posting here too :


I have been trying to install Windows 8.1 all day and have just found this thread. Have a 27"iMac 5k with 3Tb fusion drive and have been getting the GPT errors.

I followed your terminal instructions, but I got unexpected messages when i entered "h" then 2 3 4

Here is the output from Terminal :

Recovery/transformation command (? for help): h


WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,

just hit the Enter key at the below prompt and your MBR partition table will

be untouched.


Type from one to three GPT partition numbers, separated by spaces, to be

added to the hybrid MBR, in sequence: 2 3 4

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y


GPT partition #2 does not exist or is too big; skipping.


GPT partition #3 does not exist or is too big; skipping.


GPT partition #4 does not exist or is too big; skipping.


No partitions converted; original protective/hybrid MBR is unmodified!


Recovery/transformation command (? for help): n

b use backup GPT header (rebuilding main)

c load backup partition table from disk (rebuilding main)

d use main GPT header (rebuilding backup)

e load main partition table from disk (rebuilding backup)

f load MBR and build fresh GPT from it

g convert GPT into MBR and exit

h make hybrid MBR

i show detailed information on a partition

l load partition data from a backup file

m return to main menu

o print protective MBR data

p print the partition table

q quit without saving changes

t transform BSD disklabel partition

v verify disk

w write table to disk and exit

x extra functionality (experts only)

? print this menu


Recovery/transformation command (? for help): n

b use backup GPT header (rebuilding main)

c load backup partition table from disk (rebuilding main)

d use main GPT header (rebuilding backup)

e load main partition table from disk (rebuilding backup)

f load MBR and build fresh GPT from it

g convert GPT into MBR and exit

h make hybrid MBR

i show detailed information on a partition

l load partition data from a backup file

m return to main menu

o print protective MBR data

p print the partition table

q quit without saving changes

t transform BSD disklabel partition

v verify disk

w write table to disk and exit

x extra functionality (experts only)

? print this menu


Recovery/transformation command (? for help): y

b use backup GPT header (rebuilding main)

c load backup partition table from disk (rebuilding main)

d use main GPT header (rebuilding backup)

e load main partition table from disk (rebuilding backup)

f load MBR and build fresh GPT from it

g convert GPT into MBR and exit

h make hybrid MBR

i show detailed information on a partition

l load partition data from a backup file

m return to main menu

o print protective MBR data

p print the partition table

q quit without saving changes

t transform BSD disklabel partition

v verify disk

w write table to disk and exit

x extra functionality (experts only)

? print this menu


Recovery/transformation command (? for help): o


Disk size is 5860533168 sectors (2.7 TiB)

MBR disk identifier: 0x00000000

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 4294967294 primary 0xEE


Recovery/transformation command (? for help): w


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!


Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT) to /dev/disk1.

Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Warning: The kernel may continue to use old or deleted partitions.

You should reboot or remove the drive.

The operation has completed successfully.


From

diskutil list

diskutil cs list

sudo gpt -vv -r show /dev/disk1

sudo fdisk /dev/disk1


I now get :

diskutil list

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *121.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage 121.0 GB disk0s2

3: Apple_Boot Boot OS X 134.2 MB disk0s3

/dev/disk1

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *3.0 TB disk1

1: EFI EFI 209.7 MB disk1s1

2: Apple_CoreStorage 2.3 TB disk1s2

3: Apple_Boot Recovery HD 650.0 MB disk1s3

4: Microsoft Basic Data BOOTCAMP 700.9 GB disk1s4

/dev/disk2

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Macintosh HD *2.4 TB disk2

Logical Volume on disk0s2, disk1s2

51210933-CA61-4132-99DA-14284FB36473

Unencrypted Fusion Drive

Wherry-iMac:~ Wherrys$ diskutil cs list

CoreStorage logical volume groups (1 found)

|

+-- Logical Volume Group 04F51976-32DF-4C3F-9296-6ADADC7EEBAA

=========================================================

Name: Macintosh HD

Status: Online

Size: 2419855843328 B (2.4 TB)

Free Space: 376832 B (376.8 KB)

|

+-< Physical Volume D5D20091-CCC3-48F2-85F9-0207EFE7304A

| ----------------------------------------------------

| Index: 0

| Disk: disk0s2

| Status: Online

| Size: 120988852224 B (121.0 GB)

|

+-< Physical Volume A6AD4A38-FCA2-4543-9CD8-5525D9C2639F

| ----------------------------------------------------

| Index: 1

| Disk: disk1s2

| Status: Online

| Size: 2298866991104 B (2.3 TB)

|

+-> Logical Volume Family 2B272C20-609F-42F6-AB2E-219AEE481B7E

----------------------------------------------------------

Encryption Status: Unlocked

Encryption Type: None

Conversion Status: NoConversion

Conversion Direction: -none-

Has Encrypted Extents: No

Fully Secure: No

Passphrase Required: No

|

+-> Logical Volume 51210933-CA61-4132-99DA-14284FB36473

---------------------------------------------------

Disk: disk2

Status: Online

Size (Total): 2414000209920 B (2.4 TB)

Conversion Progress: -none-

Revertible: No

LV Name: Macintosh HD

Volume Name: Macintosh HD

Content Hint: Apple_HFS

Wherry-iMac:~ Wherrys$ sudo gpt -vv -r show /dev/disk1

gpt show: /dev/disk1: mediasize=3000592982016; sectorsize=512; blocks=5860533168

gpt show: /dev/disk1: PMBR at sector 0

gpt show: /dev/disk1: Pri GPT at sector 1

gpt show: /dev/disk1: Sec GPT at sector 5860533167

start size index contents

0 1 PMBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 4489974592 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC

4490384232 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

4491653768 1400

4491655168 1368877056 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

5860532224 911

5860533135 32 Sec GPT table

5860533167 1 Sec GPT header

Wherry-iMac:~ Wherrys$ sudo fdisk /dev/disk1

Disk: /dev/disk1 geometry: 97451/255/63 [1565565872 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 1023 254 63 - 1023 254 63 [ 1 - 4294967294] <Unknown ID>

2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

Wherry-iMac:~ Wherrys$




Any help you could give would be much appreciated!


Cheers

Jul 31, 2015 5:27 PM in response to Loner T

Please have a look, I am about to enter the numbers. Am I on the right direction?


iMac:~ RalphImac$ Sudo gdisk /dev/rdisk0


WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.


To proceed, enter your password, or type Ctrl-C to abort.


Password:

Sorry, try again.

Password:

GPT fdisk (gdisk) version 1.0.0


Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help): p

Disk /dev/rdisk0: 236978176 sectors, 113.0 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): A1286177-A577-4A60-95DF-E3CB9AF2CFE7

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 236978142

Partitions will be aligned on 8-sector boundaries

Total free space is 13 sectors (6.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 236715991 112.7 GiB AF05 OSX-MacintoshLVG

3 236715992 236978135 128.0 MiB AB00 Booter


Command (? for help): r


Recovery/transformation command (? for help): o


Disk size is 236978176 sectors (113.0 GiB)

MBR disk identifier: 0x00000000

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 236978175 primary 0xEE


Recovery/transformation command (? for help): h


WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,

just hit the Enter key at the below prompt and your MBR partition table will

be untouched.


Type from one to three GPT partition numbers, separated by spaces, to be

added to the hybrid MBR, in sequence:

Jul 31, 2015 5:36 PM in response to Loner T

This is what I have before step 12. Should I go on to 12? Am I on the right track?


iMac:~ RalphImac$ Sudo gdisk /dev/rdisk0


WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.


To proceed, enter your password, or type Ctrl-C to abort.


Password:

Sorry, try again.

Password:

GPT fdisk (gdisk) version 1.0.0


Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help): p

Disk /dev/rdisk0: 236978176 sectors, 113.0 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): A1286177-A577-4A60-95DF-E3CB9AF2CFE7

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 236978142

Partitions will be aligned on 8-sector boundaries

Total free space is 13 sectors (6.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 236715991 112.7 GiB AF05 OSX-MacintoshLVG

3 236715992 236978135 128.0 MiB AB00 Booter


Command (? for help): r


Recovery/transformation command (? for help): o


Disk size is 236978176 sectors (113.0 GiB)

MBR disk identifier: 0x00000000

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 236978175 primary 0xEE


Recovery/transformation command (? for help): h


WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,

just hit the Enter key at the below prompt and your MBR partition table will

be untouched.


Type from one to three GPT partition numbers, separated by spaces, to be

added to the hybrid MBR, in sequence: 2 3 4

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y


Creating entry for GPT partition #2 (MBR partition #2)

Enter an MBR hex code (default AF): n

Set the bootable flag? (Y/N): n


Creating entry for GPT partition #3 (MBR partition #3)

Enter an MBR hex code (default AB):

Set the bootable flag? (Y/N): n


GPT partition #4 does not exist or is too big; skipping.


Unused partition space(s) found. Use one to protect more partitions? (Y/N): n


Recovery/transformation command (? for help): o


Disk size is 236978176 sectors (113.0 GiB)

MBR disk identifier: 0x00000000

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 409639 primary 0xEE

2 409640 236715991 primary 0x03

3 236715992 236978135 primary 0xAB


Recovery/transformation command (? for help):

Can't format former Boot Camp partition

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.