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 2, 2018 1:20 PM in response to langridgedean

Run

diskutil unmountDisk disk0

gpt remove -i 2 /dev/disk0

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

gpt add -i 3 -b 158748672 -s 78225408 -t windows /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

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


Now run


diskutil repairDisk disk0


Please post the output of the Terminal session.

Aug 2, 2018 2:32 PM in response to langridgedean

langridgedean wrote:


I did not get an error with "apfs."


Here's the latest output:


-bash-3.2# diskutil unmountDisk disk0

Unmount of all volumes on disk0 was successful

-bash-3.2# gpt remove -i 2 /dev/disk0

gpt remove: /dev/disk0: Suspicious MBR at sector 0

/dev/disk0s2 removed

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

usage: gpt add [-b lba] [-i index] [-s lba] [-t uuid] device ...

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

gpt add: /dev/disk0: Suspicious MBR at sector 0

gpt add: /dev/disk0: error: no space available on device

-bash-3.2# 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

Problems were encountered during repair of the partition map

Error: -69770: Partition map check failed because no slices were found

The highlighted commands did not work.


Reboot can renumber disks. Is disk0 still your internal disk? Change disk0 to appropriate disk, if it is not.


Run, using the appropriate disk,


diskutil unmountDisk disk0

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

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

gpt -vv -r show /dev/disk0


and post the output.

Aug 10, 2018 12:58 PM in response to langridgedean

Since you already have HS on the external disk, it would be faster to reboot and hold Alt/Option, select the Recovery HD from the external disk, and then click on re-install macOS and choose the internal disk's current APFS partition. If the internal partition was not converted during the original HS upgrade/install, you may not get any of your files back.


Update: Do you want to try and make this a CS LV/LVG and try to recover first?

Aug 11, 2018 9:50 AM in response to Loner T

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 Core Storage'

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

Changed type of partition to 'Apple HFS/HFS+'


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 AF00

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.


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

Preparing to create trailing loader space by shrinking the volume "" on disk0s2

Creating loader space, part 1 of 3: Verifying the file system

Problems were encountered during repair of the partition map

Error: -69763: Partition map repair failed file system check while creating loader space for a data partition. You should repair that specific partition and then try repairing the partition map again

Underlying error: -69845: File system verify or repair failed

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.