I am on an early 2015 MacBook Pro with macOS Sierra, dual boot with Ubuntu 16.04.
In macOS, I did dd if=/dev/disk1s3 of=disk2s2
(if i remember correctly). It succeeded and I proceeded to shrink the macOS partition using Disk Utility. That succeeded too. I proceeded to reboot and found myself unable to boot into any systems. Going into recovery mode, I am unable to restore from a backup or reinstall a new macOS.
I see the partitions as they are supposed to be, though their health would be suspect. I have
210mb EFI partition as /dev/sda1 FAT
182GB macOS parition as /dev/sda2 ffffffff-ffff-ffff-ffff-ffffffffffff
30GB free space partition as /dev/sda
30GB Ubuntu PArtition as /dev/sda4 Ext4
4GB Linux Swap as /dev/sda5 Swap
Would anyone know how I could restore things as they are? I am looking to install rEFInd so my MacBook would provide the option without me having to hold the Option key everytime.
diskutil list
returns:
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF 181.8 GB disk0s2
3: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 30.0 GB disk0s4
4: LINUX SWAP 4.0 GB disk0s5
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *1.3 GB disk0
1: Apple_partition_map 30.7 KB disk0s1
2: Apple_HFS OSX X Base System 1.3 GB disk0s2
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk2
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk3
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk4
/dev/disk5
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk5
/dev/disk6
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk6
/dev/disk7
#: TYPE NAME SIZE IDENTIFIER
0: untitled *6.3 MB disk7
/dev/disk8
#: TYPE NAME SIZE IDENTIFIER
0: untitled *2.1 MB disk8
/dev/disk9
#: TYPE NAME SIZE IDENTIFIER
0: untitled *1.0 MB disk9
/dev/disk10
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk10
/dev/disk11
#: TYPE NAME SIZE IDENTIFIER
0: untitled *524.3 KB disk11
/dev/disk12
#: TYPE NAME SIZE IDENTIFIER
0: untitled *1.0 MB disk12
Update: removed/destroyed disk0 via gpt. just before I gpt add
partitions back.
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *251.0 GB disk0
1: 0xEE 209.7 MB disk0s1
2: 0xDA 181.8 GB disk0s2
3: Linux 30.0 GB disk0s4
Update 2: Adding back the partitions. (I neglected adding back -i 3 and -i 2 respectively)
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.....
409640 226802864 3 GPT part - 5374GF72.....
227212504 1269536 2 GPT part - 426F6F74.....
228482040 261752679
490234719 32 SEC GPT table
490234751 1 SEC GPT header
On
gpt remove -i 3 disk0
I had the error: Suspicious MBR at sector0.diskutil umount disk0s0
returned Unmount failed for disk0s0. – EraserPencil 9 hours ago – EraserPencil Nov 29 '17 at 15:32diskutil umountDisk disk0
and to unmount a volume/partitiondiskutil umount disk0s2
. – klanomath Nov 29 '17 at 16:21diskutil umountDisk disk0
was sucessful,gpt remove -i 3 disk0
gave: Suspicious MBR at sector 0. Since it was an error not listed in the provided solution, I interpretated it as "if I get an error message, unmount the disk again or unmount stubborn volumes withdiskutil umount disk0sX
" in a desperate vain attempt. – EraserPencil Nov 29 '17 at 16:29gpt -r show disk0
matches your output on the solution, howeverdiskutil verifyDisk disk0
outputs: Problems were found with the partition map which might prevent booting. Error: -69808: Some information as unavailble during an interval lookup. I proceeded only with you instruction and did not explore rEFInd. Update: I neglected to add "-i 3" and "-i 2" respectively. – EraserPencil Nov 29 '17 at 17:36gpt -r show disk0
shouldn't match the output of the answer over there, but your previousgpt -r show disk0
except that the MBR was replaced with a pMBR and the FFFFFF.. partition was replaced with a corestorage or hfs+ partition with the same size as the FFFF partition! – klanomath Nov 29 '17 at 17:40