How to fix my corrupted APFS container?
I'm using MBP late 11
running 10.13.2
on Samsung Evo 850 250GB
internally.
Everything was fine for months but few days ago something horrible occurred. I'm so shocked and urgently need your help.
Finder wasn't responding and I had to restart it by force. But it didn't boot again and just showed a black screen. Tried several times without success which finally I had to install another High Sierra on my 2nd drive (a healthy HDD)
• Here's few shots which convince me that the APFS container
is damaged (SSD=disk0):
Disk0s2 - part1
Disk0s2 - part2
Container
Weird thing called Synthesized
Diskutil list
Diskutil apfs list
Diskutil repairDisk/repairVloume
• Here's few notes which probably help you know where the error lies:
▸ Note1: Used a third party app and it found 4 partitions including VM
, Recovery
, macSSD
, Preboot
. Tried to recover data from macSSD
partition and fortunately almost all important data was intact and almost all files were healthy and readable/playable. That's why I think it may just be a corruption of the APFS container
.
4 lost partitions found by a recovery app
▸ Note2: diskutil verifyVolume disk2
MacBook-Pro:~ rainyhighsierra$ diskutil verifyVolume disk2
Started file system verification on disk2
Verifying storage system
Performing fsck_apfs -n -x /dev/disk0s2
Checking volume
Checking the container superblock
error: object (oid 0x1): o_cksum (0x7f23daf6f220955d) is invalid for object
warning: checkpoint 247 fsck_obj_phys failed
error: object (oid 0x107): o_cksum (0xe096dd51deca9041) is invalid for object
warning: checkpoint 262 fsck_obj_phys failed
error: object (oid 0x10b): o_cksum (0x661d289dd9202cbd) is invalid for object
warning: checkpoint 266 fsck_obj_phys failed
Checking the EFI jumpstart record
error: (oid 0x2aac6) nrl: invalid o_cksum (0x8eaa1aec711175bb)
error: verification/reading of the nx_reaper object failed
The volume /dev/disk0s2 could not be verified completely
Storage system check exit code is 0
Finished file system verification on disk2
▸ Note3: Trying to add an empty volume SAM
to synthesized container (disk2) to see what may happen
MacBook-Pro:~ rainyhighsierra$ diskutil ap addVolume disk2 apfs SAM
Exporting new APFS Volume "SAM" from APFS Container Reference disk2
Started APFS operation on disk2
Preparing to add APFS Volume to APFS Container disk2
Error: -69620: Unable to get capacity info for an APFS Container or APFS Volume
MacBook-Pro:~ rainyhighsierra$
▸ Note4: GPT strucure of disk0
MacBook-Pro:~ rainyhighsierra$ sudo gpt show /dev/disk0
Password:
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-F81F-11D2-BA4B-00A0C93EC93B
409640 487987488 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
488397128 7
488397135 32 Sec GPT table
488397167 1 Sec GPT header
MacBook-Pro:~ rainyhighsierra$
▸ Note5: I had ~3-5 GB free space on the SSD at the time of crashing
Please help me repair the disk and take back the OS. The drive looks like healthy and repairable.
Your GPT Structure looks ok but just to be sure, there are a few things you can do. However, before proceeding, back up all of your data (time machine works well). Then proceed to
- Download Gdisk for mac
- Install the package
- Open up your terminal application
- enter the command
sudo gdisk /dev/disk0
- Enter your administrator password
-
A message will appear. If something is broken it should auto-repair itself and look something like this
GPT fdisk (gdisk) version 1.0.3
Warning: Devices opened with shared lock will not have their partition table automatically reloaded! The protective MBR's 0xEE partition is oversized! Auto-repairing.
Press x, hit enter
Press p, hit enter
Press o, hit enter
Press q
Copy and paste the results in your answer.
Close terminal
Go to the App store
Download Mac OS High Sierra
Get a USB stick
Go to https://support.apple.com/en-us/HT201372 and follow the instructions on the site.
Restart your mac with your newly created bootable USB of High Sierra (or corresponding OS)plugged in, while holding down the 'Alt' key.
A boot screen will appear.
Select the option "Install Mac OS High Sierra"
Once in your installation screen, go to the "Utilities" menu and select "Disk Utility"
Click on your hard drive and hit the "First Aid" button. Then use the first aid button/tool on each of it's partitions/containters.
Exit Disk Utility. Reboot. Check if things are fixed. If not, continue with instructions....
Reboot with USB inserted again, and go back to "Install Mac OS High Sierra".
Once in the install screen, click the "Install Mac OS"
!IMPORTANT! - DO NOT FORMAT THE HARD DRIVE OR ITS PARTITIONS.
At the "Select the disk in which to install" screen, select your disk, but DO NOT FORMAT. Then hit the "Install" button.
Wait for the installer to finish.
Reboot.
Check and see if things are working. They should be. Done.