disk0s2 can't mount - Partition shows as "MBR part 255"

Something happened with my BootCamp configuration and now my MBP will only boot into windows. When I booted into recovery and checked the Disk Utility, the "disk0s2" was unmounted and couldn't be mounted. I tried to follow guides where people had similar issues, however, I believe I've dug my hole deeper.


I'm getting an error that there's a "suspicious" and "malformed" MBR at sector 0. I'm also getting an error the there is "no space available on device" when trying to add the partition back.


The image below shows my current gpt output. Can anyone help get my OSX partition back to bootable?


Thank you in advance!!!


User uploaded file

MacBook Pro

Posted on Jul 31, 2018 1:44 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 1, 2018 4:41 PM

Run


gpt remove -i 2 /dev/disk0

gpt add -i 2 -b 409640 -s 158339032 -t apfs /dev/disk0


If 'apfs' gives you an error, then


gpt add -i 2 -b 409640 -s 158339032 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0


Now run


diskutil repairDisk disk0


and reboot and test if macOS will boot properly.

Similar questions

81 replies

Aug 6, 2018 6:08 AM in response to Loner T

Here's the output of the latest... no errors!


-bash-3.2# diskutil unmountDisk disk0

Unmount of all volumes on disk0 was successful

-bash-3.2# gpt destroy /dev/disk0

-bash-3.2# gpt create -f /dev/disk0

-bash-3.2# diskutil unmountDisk disk0

Unmount of all volumes on disk0 was successful

-bash-3.2# gpt add -i 1 -b 40 -s 409600 -t efi /dev/disk0

/dev/disk0s1 added

-bash-3.2# diskutil unmountDisk disk0

Unmount of all volumes on disk0 was successful

-bash-3.2# gpt add -i 2 -b 409640 -s 158339032 -t

7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0

/dev/disk0s2 added

-bash-3.2# diskutil unmountDisk disk0

Unmount of all volumes on disk0 was successful

-bash-3.2# gpt add -i 3 -b 158748672 -s 78225408 -t windows /dev/disk0

/dev/disk0s3 added

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

gpt show: /dev/disk0: mediasize=121332826112; sectorsize=512; blocks=236978176

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

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

gpt show: /dev/disk0: Sec GPT at sector 236978175

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 158339032 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC

158748672 78225408 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

236974080 4063

236978143 32 Sec GPT table

236978175 1 Sec GPT header

-bash-3.2#

Aug 11, 2018 4:49 PM in response to Loner T

I just looked at some of the other hex codes using "L" and tried again with AF0A... no errors.


Does this help us?


sudo gdisk /dev/disk0

Password:

GPT fdisk (gdisk) version 1.0.4


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): t

Partition number (1-3): 2

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = af00): af0a

Changed type of partition to 'Apple APFS'


Command (? for help): p

Disk /dev/disk0: 236978176 sectors, 113.0 GiB

Sector size (logical): 512 bytes

Disk identifier (GUID): 5C089A2F-BA4F-4F7B-AE2A-5A03869F8148

Partition table holds up to 128 entries

Main partition table begins at sector 2 and ends at sector 33

First usable sector is 34, last usable sector is 236978142

Partitions will be aligned on 8-sector boundaries

Total free space is 4069 sectors (2.0 MiB)


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

1 40 409639 200.0 MiB EF00

2 409640 158748671 75.5 GiB AF0A

3 158748672 236974079 37.3 GiB 0700


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/disk0.

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.

Mikes-MacBook-Pro:~ mike$ diskutil repairDisk disk0

Repairing the partition map might erase disk0s1, proceed? (y/N) y

Started partition map repair on disk0

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 the EFI system partition's folder content

Checking all HFS data partition loader spaces

Checking booter partitions

Reviewing boot support loaders

Checking Core Storage Physical Volume partitions

The partition map appears to be OK

Finished partition map repair on disk0

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.

disk0s2 can't mount - Partition shows as "MBR part 255"

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