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
Best Answer
Since you can execute a live version of Ubuntu, you have access to the
gdisk
command. Once booted to Ubuntu, you will need to open a Terminal window. From the Ubuntu desktop, press the control+option+T keys. A Terminal window should appear, as shown below.You can confirm partition
/dev/sda2
is a possible "Mac OS Extended" (Journaled)" volume by entering the command given below.The output at offset
00000400
should appear similar to what is shown below. What is important find is the charactersHFSJ
.The interactive command
gdisk
can be used to change the type id of a partition. The example below assumes the partition where macOS resides is a single Mac OS Extended (Journaled) volume. The example will change type id for partition 2 to48465300-0000-11AA-AA11-00306543ECAC
. The command to enter is shown below.The interactive input/output is shown below.