How to fix partition scheme? (Retina 2012, became MBR)

I recently used bootcamp to install Windows 7 on my MacBook retina (2012).


Later, I realized I needed more space in the hard drive. I booted back into OS X and shrunk my OS X volume using disk utility and added a third partition since disk utility doesn't give you the option to leave it as free space anymore. I then lost the ability to boot into Windows, so I booted using my USB Windows install drive and was able to delete the new partition and allow Windows to boot up properly again.


The problem I had, was that the unallocated space from creating a third partition was to the 'left' of my BOOTCAMP drive on the partition table, or starting at a later address.


I tried using a third party tool to 'move' my Windows partition to the left to be able to use the unallocated memory, leaving some space inbetween for good measure. I thought the other volumes would be left untouched.


Now however, I see a "prohibition symbol" both when I attempt to boot from the OSX or recovery partition. Windows 7 still boots fine, and in the default Windows partition tool, both OS X volumes appear to be untouched.


I was able to boot into internet recovery however and get info on the disk. "Disk0s1" is my OS X partition, greyed out, unmountable and I can't see its name. The entire disk seems to now have a Master Boot Record partition scheme now. Within terminal, I type 'diskuril list' to find the TYPE: Apple_Boot for the NAME: 'Recovery HD' and TYPE: 0xAC for my OS X disk and it is un-named.


Also, via terminal, I can mount the recovery disk but not the OSX disk. (But recovery disk still not shown in disk utility)


Is there a possibility to restore the scheme to GPT without erasing the volume? What is preventing me from accessing my OS X volume?


Please let me know if there are any solutions. Again, I can still boot into Windows 7 if there is a tool that works with mac partitions. My mac is a mid 2012 retina with a SSD drive, with OSX sierra on the main volume and currently running mavericks 10.9.3 via the internet recovery tool.


Cheers,

Max


Message was edited by: Mad Maxx

Posted on Jan 8, 2017 4:50 PM

Reply
27 replies

Jan 10, 2017 3:58 AM in response to Mad Maxx

Step A - Creates a blank GPT. Choose 2 for GPT, if prompted. (Do not enter such text, it is for informational purpose).


sudo gdisk /dev/rdisk0

o (Create new GPT and Protective MBR)

p (Print)

w (Write)

y (Confirm write)

q (Quit Gdisk)


Step B. Create individual entries. For entry 4 (Windows), we use offset notation, because the MBR uses size, while Gdisk reports end sector. This is entered as size with '+' notation, not end of the partition.


sudo gdisk /dev/rdisk0

x (Experts Menu)

l (This is is lower case L )

1 (This is digit 1 - sets the sector alignment to 1 sector)

m (Go to main menu)


n (New GPT)

1 (Part 1)

40 (Start)

409639 (End)

EF00 (EFI)


n

2

409640 (Start)

684728431 (End)

AF05 (CoreStorage containing JHFS+)


n

3

684728432 (Start)

685997967 (End)

AB00 (Apple Boot - Recovery HD)


n

4

686514176 (Start)

+290177024 (+Size)

0700 (Microsoft Basic Data)


p (Print)

w (Write)

y (Confirm Write)


Reboot. At this point you can/should see Windows files in Finder, but Windows will not boot. If this is successful, then we can create the MBR to make Windows boot.

Jan 8, 2017 11:25 PM in response to Mad Maxx

Boot into Internet Recovery - About macOS Recovery - Apple Support - and click on Utilities -> Terminal and run


diskutil list

diskutil cs list


Copy the output using Command+C, quit Terminal, start Safari, Paste the output using Command+V as a reply to this discussion.


If your disk was converted to a MBR disk from a GPT disk using Windows tools, you may also want to install OS X on an external disk using How to set up and use an external Mac startup disk - Apple Support and upgrade it to match the version on the internal disk. You will also need GPT Fdisk (https://sourceforge.net/projects/gptfdisk/).


Do not use Mavericks to manipulate Sierra partitions.

Jan 8, 2017 11:24 PM in response to Loner T

Thank you for the reply; I can try working on a bootable OS tomorrow if necessary. For now, I threw my laptop into Target Disk Mode and attached it to another mac via thunderbolt.


Here is the output of "diskutil list", disk 2 being the troubling computer:

mmbp:~ a$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *1.0 TB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Macintosh HD 949.9 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data WINDOWS HD 49.4 GB disk0s4

/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Macintosh HD +949.5 GB disk1

Logical Volume on disk0s2

EF209FAC-3358-4271-9DD6-7E5F9840C3D8

Unencrypted

/dev/disk2 (external):

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme 500.3 GB disk2

1: 0xAC 350.4 GB disk2s1

2: Apple_Boot Recovery HD 650.0 MB disk2s2

3: Windows_NTFS BOOTCAMP 148.6 GB disk2s3

I hope the second command still works using target disk... The output of "diskutil cs list" is as follows:

mmbp:BOOTCAMP a$ diskutil cs list

CoreStorage logical volume groups (1 found)

|

+-- Logical Volume Group 1CD4B3CA-D070-42B4-909C-0E9AD7BD4518

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

Name: Macintosh HD

Status: Online

Size: 949860909056 B (949.9 GB)

Free Space: 18931712 B (18.9 MB)

|

+-< Physical Volume 3DC3E59F-CB17-4081-9AAC-D7E894211778

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

| Index: 0

| Disk: disk0s2

| Status: Online

| Size: 949860909056 B (949.9 GB)

|

+-> Logical Volume Family AF329912-4E63-4000-B872-EC6FE4C659BF

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

Encryption Type: None

|

+-> Logical Volume EF209FAC-3358-4271-9DD6-7E5F9840C3D8

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

Disk: disk1

Status: Online

Size (Total): 949489655808 B (949.5 GB)

Revertible: Yes (no decryption required)

LV Name: Macintosh HD

Volume Name: Macintosh HD

Content Hint: Apple_HFS

mmbp:BOOTCAMP a$


~~~

Earlier I read a reply of yours on an earlier thread regarding the gdisk tool. I was able to successfully download it on the windows 7 volume and now I also have it on the external mac.


Max

Jan 8, 2017 11:50 PM in response to Mad Maxx

Also, I tried verifying both the RecoveryHD volume and the OS X volume.

I got two different results..:


mmbp:Volumes a$ diskutil verifyvolume /dev/disk2s2

Started file system verification on disk2s2 Recovery HD

Verifying file system

Checking Journaled HFS Plus volume

Checking extents overflow file

Checking catalog file

Checking multi-linked files

Checking catalog hierarchy

Checking extended attributes file

Checking volume bitmap

Checking volume information

The volume Recovery HD appears to be OK

File system check exit code is 0

Finished file system verification on disk2s2 Recovery HD

mmbp:Volumes a$ diskutil verifyvolume /dev/disk2s1

Error starting file system verification for disk2s1: Unrecognized file system (-69846)

mmbp:Volumes a$

Where Disk2s1 is the OS X volume and disk2s2 is the RecoveryHD

Jan 9, 2017 7:55 AM in response to Loner T

mmbp:~ a$ sudo gpt -vv -r show /dev/disk2

Password:

gpt show: /dev/disk2: mediasize=500277790720; sectorsize=512; blocks=977105060

gpt show: /dev/disk2: MBR at sector 0

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

gpt show: error: bogus map

gpt show: unable to open device '/dev/disk2': Undefined error: 0

mmbp:~ a$

Gdisk is also now installed.

Jan 9, 2017 4:43 PM in response to Loner T

mmbp:~ a$ sudo gdisk -l /dev/disk2

Password:

GPT fdisk (gdisk) version 1.0.1


Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

MBR: MBR only

BSD: not present

APM: not present

GPT: present


Found valid MBR and GPT. Which do you want to use?

1 - MBR

2 - GPT

3 - Create blank GPT


Your answer:


Jan 9, 2017 5:04 PM in response to Loner T

Using GPT and creating fresh protective MBR.

Disk /dev/disk2: 977105060 sectors, 465.9 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): C9FE6C58-9225-486C-8FFB-7ED3CFB232CB

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 977105026

Partitions will be aligned on 8-sector boundaries

Total free space is 262281 sectors (128.1 MiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 684728431 326.3 GiB AF05 Naamloos

3 684728432 685997967 619.9 MiB AB00

4 685997968 781531135 45.6 GiB 0700

5 781793280 977104895 93.1 GiB 0700


mmbp:~ a$


...


Done.. Also, not sure why naamloos is the name of my volume.

Jan 9, 2017 9:29 PM in response to Mad Maxx

Yes, I can boot into windows just fine. If I hold down the option key on power-on, I see bootcamp AND the OSX volume. The OS X volume boots for some time but I later see the prohibitory symbol. Here is my fdisk terminal output...I wasn't sure if you meant to say disk2, so I copied over both.

-max

mmbp:~ a$ sudo fdisk /dev/disk0

Password:

Disk: /dev/disk0 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 - 409639] <Unknown ID>

2: AC 1023 254 63 - 1023 254 63 [ 409640 - 1855197088] <Unknown ID>

3: AB 1023 254 63 - 1023 254 63 [1855606728 - 1269536] Darwin Boot

4: 0B 1023 254 63 - 1023 254 63 [1856876264 - 96386720] Win95 FAT-32

mmbp:~ a$ sudo fdisk /dev/disk2

Disk: /dev/disk2 geometry: 60821/255/63 [977105060 sectors]

Signature: 0xAA55

Starting Ending

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

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

1: AC 25 127 15 - 1023 254 63 [ 409640 - 684318792] <Unknown ID>

2: AB 1023 254 63 - 1023 254 63 [ 684728432 - 1269536] Darwin Boot

*3: 07 1023 254 63 - 1023 254 63 [ 686514176 - 290177024] HPFS/QNX/AUX

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

mmbp:~ a$

Jan 10, 2017 3:34 AM in response to Mad Maxx

I need to consolidate relevant information in a single post. Assuming we need to address/correct the 500GB disk2, your MBR (manipulated by the third-party tool) is

Mad Maxx wrote:


mmbp:~ a$ sudo fdisk /dev/disk2

Disk: /dev/disk2 geometry: 60821/255/63 [977105060 sectors]

Signature: 0xAA55

Starting Ending

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

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

1: AC 25 127 15 - 1023 254 63 [ 409640 - 684318792] <Unknown ID>

2: AB 1023 254 63 - 1023 254 63 [ 684728432 - 1269536] Darwin Boot

*3: 07 1023 254 63 - 1023 254 63 [ 686514176 - 290177024] HPFS/QNX/AUX

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

mmbp:~ a$

Your GPT is

Using GPT and creating fresh protective MBR.

Disk /dev/disk2: 977105060 sectors, 465.9 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): C9FE6C58-9225-486C-8FFB-7ED3CFB232CB

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 977105026

Partitions will be aligned on 8-sector boundaries

Total free space is 262281 sectors (128.1 MiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 684728431 326.3 GiB AF05 Naamloos

3 684728432 685997967 619.9 MiB AB00

4 685997968 781531135 45.6 GiB 0700

5 781793280 977104895 93.1 GiB 0700


The MBR entry works

*3: 07 1023 254 63 - 1023 254 63 [ 686514176 - 290177024] HPFS/QNX/AUX

but is not valid on the GPT side, as it does not match either of the following entries.

4 685997968 781531135 45.6 GiB 0700

5 781793280 977104895 93.1 GiB 0700

We need to rebuild the GPT (4 and 5), but ensure that your working Windows stays working (MBR3). The next step is to re-build the GPT.

Jan 10, 2017 10:38 AM in response to Mad Maxx

Yes, it should be disk2 in your specific case. I took the values from your GPT and MBR. Please verify.


The GPT is a mapping of the physical disk addresses to a partition map. It will not touch any of your data, unless you decide to manipulate it after the reboot. I suggest not modifying any content till we can get a good backup. OSX Finder just reads the NTFS file system, so we are safe.


We first want to ensure OSX is visible and bootable. We can then re-create the MBR and get Windows to boot.

Jan 10, 2017 11:38 AM in response to Mad Maxx

Before we go further, can you post the output of


diskutil list

diskutil cs list

sudo gpt -vv -r show /dev/disk2


This is to prevent any future issues, if we make a mistake in next set of steps. Your GPT and partitions are now fixed and should not require any further modifications. I suggest a backup of the Mac, once we recreate the MBR.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to fix partition scheme? (Retina 2012, became MBR)

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