Recover non-bootable Mac HFS partition from Linux partition

1

I have a MacBook Air early 2015 with two partitions: the HFS one for Mac and another for GNU/Linux.

I wanted to delete the Linux partition since Mac OS had little free space, but the disk utility had the partition edition buttons grayed out. So I booted from recovery mode (cmd + R) and tried to do the same without luck. I then fired a terminal in recovery mode and used gpt erase to delete the Linux partition.

I am completely sure that I selected the right partition to delete, but the HFS partition somehow got messed up and started showing FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF as partition type, and Mac OS didn't boot.

Also, once rebooted, the recovery mode didn't boot and passed directly to Internet recovery mode, which ends after a few minutes with a error -2003F screen. So I re-installed Linux on the partition it was installed before (I did not touch the HFS lost one) and used TestDisk to search for corrupted partitions. TestDisk in fact located the HFS partition and I let it rewrite the partition table to try to recover it. I ended with the HFS partition in its correct place, but smaller than it was, with two small EFI partitions and a lot of unassigned space in between, so I used GParted to merge again all these to end with the original HFS partition.

This new partition won't boot, once again. I then used

fsck.hfs -r -d /dev/sda3

and the tool applied a minor repair to the volume header (still not booting nor appearing on the boot selection mode). Now I'm able to mount the partition on /mnt but it appears empty. I don't remember if I had FileVault enabled (I don't think so but I'm not sure). What I need is to recover a few files and the re-install Mac OS to use the full disk. Is there any recommendation on how to do it? Would it be possible to access these files from Linux or would it be better to try to fix the Mac partition to be bootable?

I also thought of using Target Mode with another MacBook Pro late 2016 I have here, but I'm not sure that will work with a messed up partition, or if a USB-A to USB-C will do the job, as the latter computer does not have a FireWire interface.

Summary:

  1. Mac OS won't boot.
  2. Recovery mode won't boot.
  3. Internet recovery mode ends with -2003F error.
  4. Only Linux distro is bootable.

Edit:

I analysed the drive again with TestDisk and now it shows:

The harddisk (251GB / 233 GiB) seems too small! (< 411GB / 383 GiB)
Check the harddisk size: HD jumper settings, BIOS detection...

The following partitions can't be recovered:
Partition            Start           End      Size in sectors
> Mac HFS          490233852      803981307      313747456

derkomai

Posted 2019-05-12T12:32:52.410

Reputation: 151

No answers