Hardrive will not mount after deleting Linux partition. Can’t boot into Mac OS X [duplicate]
I tried to delete a Linux partition on my hard drive. My hard drive was no longer bootable and the type turned into FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF. I tried to follow some of the other instructions on here to resolve the issue but have not had any success. Running diskutil list returns the following:
Would really appericiate any help. Thanks in advance.
EDIT
I performed gpt -r show /dev/disk0
And got the following:
And dd if=/dev/disk0s2 count=3 | vis -c
Returned
EDIT 2
After running diskutil verifyDisk disk0
I got the following errrors
A bootable OS X partition (except the Recovery HD) either has the GUID 48465300-0000-11AA-AA11-00306543ECAC for a standard OS X partition, the GUID 53746F72-6167-11AA-AA11-00306543ECAC for a CoreStorage partition or the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC for an APFS volume. The FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF is an unknown partition type (but not no partition like the 000000-0000-0000.... one).
Your dd if=/dev/disk0s2 count=3 | vis -c
output shows that it is a CoreStorage partition because it contains the string ...\0CS\^A... near the middle of the second line.
The GUID partition table can be modified with gpt. You can only add, delete and modify GUID partition tables with gpt when all related disks are unmounted. To reconfigure your partitions boot to a third party drive (e.g. Internet Recovery or a OS X installer thumb drive).
Additionally your GUID partition table contains an MBR which has to be deleted
- Boot to Internet Recovery Mode (or a third party drive).
- Open Terminal in the menubar Utilities > Terminal
- Get an overview with
diskutil list
-
Get an overview of your internal disk with the disk identifier found in the previous command. Below I assume the disk identifier of your internal disk is disk0 (SSD) (replace it with the one you have found in your environment).
gpt -r show disk0
- Unmount disk0 with
diskutil umountDisk disk0
-
Then reset the GUID partition table and re-add the first and the second partition with the same size but proper type.
gpt destroy disk0 gpt create -f disk0 gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0 gpt add -i 2 -b 409640 -s 194016208 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0
-
Verify disk and volume:
diskutil verifyDisk disk0 diskutil verifyVolume disk0s2
If you want to extend your current macOS partition resize it with the diskutil cs resizeStack lvUUID size
command.
It's recommended to add a working Recovery HD partition which is missing on your disk at the moment.
If you did some undocumented repair attempts you may have forgotten the Recovery HD and added only one all-embracing partition accidentally which will result in diskutil verifyDisk errors.
You can then try to delete the current partition disk0s2 and re-add it slightly smaller and add an additional recovery partition:
diskutil umountDisk disk0
gpt remove -i 2 disk0
gpt add -i 3 -b 193156312 -s 1269536 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk0
gpt add -i 2 -b 409640 -s 192746672 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0
diskutil verifyDisk disk0
diskutil verifyVolume disk0s2
This is only a shot in the dark, because previous repair attempts might have changed partition sizes and file system types.
By booting to a full-fledged system on a second independent drive you may determine proper partition boundaries:
- Prohibitory sign on boot after Sierra update, can't mount disk anymore
- HFS+ invalid number of allocation blocks
- ASE search string