APFS file system not detected, but fsck_apfs says otherwise
Recently, I've been trying to dual boot Linux alongside macOS with my 2014 Macbook Air. After formatting a 2gb usb stick to exFAT via a Debian live disk, I found my Macintosh HD to no longer be availabe as a boot option. The recovery partition isnt detected either, as command + r takes me straight to internet recovery. I've been in internet recovery doing some probing (via option + command + r).
My drive should have 3 partitions. An ext4 partition (not readable by macOS I believe) that is 115gb, an APFS partition that is supposed to be around about 120gb, and a final exFAT partition that fills the rest of my 251gb.
Only the exFAT partition showes up in recovery mode disk utility.
"diskutil list" outputs the following for my drive:
/dev/disk0 (internal, physical):
#: 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 117.6 GB disk0s2
3: Microsoft Basic Data Share 17.7 GB disk0s3
4: Linux Filesystem 115.5 GB disk0s4
"diskutil mount disk0s2" fails to mount.
"diskutil verifyVolume" and "diskutil repairVolume" both fail due to an unrecognized filesystem (-69846).
"diskutil info disk0s2" outputs the following:
Device Identifier: disk0s2
Device Node: /dev/disk0s2
Whole: No
Part of Whole: disk0
Volume Name: Not applicable (no file system)
Mounted: Not applicable (no file system)
File System: None
Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
OS Can Be Installed: No
Media Type: Generic
Protocol: PCI
SMART Status: Verified
Disk / Partition UUID: 8AC659AB-FB54-4FEB-AACD-943227E69497
Partition Offset: 209735680 Bytes (409640 512-Byte-Device-Blocks)
Disk Size: 117.6 GB (117649367040 Bytes) (exactly 229783920 512-Byte-Units)
Device Block Size: 512 Bytes
Media OS Use Only: No
Media Read-Only: No
Volume Read-Only: Not applicable (no file system)
Device Location: Internal
Removable Media: Fixed
Solid State: Yes
Hardware AES Support: No
And despite all of this, "fsck_apfs /dev/disk0s2" outputs the following (trunkated where it says "** Checking <things>", lmk if the whole thing would be helpful, it detected all of my volumes)
...
warning: container has been mounted by APFS version 1677.141.3.7.2, which is newer than 1677.141.1
warning: disabling overallocation repairs by default; use -o to override
...
container_iouc:45: cannot find container /dev/rdisk0s2
warning: Unable to read apfs keylocker ranges: No such file or directory
...
...
** The volume /dev/disk0s2 appears to be OK.
So from my unerstanding (which is minimal, I really don't know much but I've come this far and willing to learn) all of it should still be there. But how do I fix this?
Earlier Mac models