Unable to boot Mac OS and disk utility unable to repair disk after bootcamp delete windows partition
I’am not so sure whether it is related to bootcamp. after deleting the windows partition by bootcamp,the second day the computer can not boot and there is just question mark folder on the screen. when i follow the instructions on https://support.apple.com/zh-cn/HT204904 to enter the recovery mode and there is no startup disk can be found.
my mac version is MacBook Pro (Retina, 13-inch, Early 2015). Here is some information may help.
output of diskutil list /dev/disk0
:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 372.0 GB disk0s2
output of gpt -v -r show /dev/disk0
:
gpt show: /dev/disk0: mediasize=500277790720; sectorsize=512; blocks=977105060
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 726562776 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
726972416 250132611
977105027 32 Sec GPT table
977105059 1 Sec GPT header
output of fdisk /dev/disk0
:
Disk: /dev/disk0 geometry: 60821/255/63 [977105060 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 977105059] <Unknown ID>
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
output of diskuti apfs list
:
|
+-- Container ERROR -69808
| ======================
| APFS Container Reference: disk1
| Size (Capacity Ceiling): ERROR -69620
| Capacity In Use By Volumes: ERROR -69620
| Capacity Not Allocated: ERROR -69620
| |
| +-< Physical Store disk0s2 F31C2BCB-9CEA-4449-9CAD-4893BBF532A5
| | -----------------------------------------------------------
| | APFS Physical Store Disk: disk0s2
| | Size: 372000141312 B (372.0 GB)
| |
| +-> No Volumes
output of diskutil info /dev/disk0
:
Device Identifier: disk0
Device Node: /dev/disk0
Whole: Yes
Part of Whole: disk0
Device / Media Name: APPLE SSD SM0512G
Volume Name: Not applicable (no file system)
Mounted: Not applicable (no file system)
File System: None
Content (IOContent): GUID_partition_scheme
OS Can Be Installed: No
Media Type: Generic
Protocol: PCI
SMART Status: Verified
Disk Size: 500.3 GB (500277790720 Bytes) (exactly 977105060 512-Byte-Units)
Device Block Size: 512 Bytes
Read-Only Media: No
Read-Only Volume: Not applicable (no file system)
Device Location: Internal
Removable Media: Fixed
Solid State: Yes
Virtual: No
Hardware AES Support: No
output of fsck_apfs -y /dev/disk0s2
warning: nx_block_count is 122086923, while device block count is 90820347
error: object (oid 0x1): o_cksum (0x27828005f8de019d) is invalid for object
** Checking the container superblock.
warning: checkpoint<->superblock disagree for xp 113
warning: checkpoint<->superblock disagree for xp 111
warning: checkpoint<->superblock disagree for xp 109
warning: checkpoint<->superblock disagree for xp 107
warning: checkpoint<->superblock disagree for xp 105
warning: checkpoint<->superblock disagree for xp 103
warning: checkpoint<->superblock disagree for xp 101
warning: checkpoint<->superblock disagree for xp 99
warning: checkpoint<->superblock disagree for xp 97
warning: checkpoint<->superblock disagree for xp 95
warning: checkpoint<->superblock disagree for xp 93
warning: checkpoint<->superblock disagree for xp 91
warning: checkpoint<->superblock disagree for xp 89
warning: checkpoint<->superblock disagree for xp 87
warning: checkpoint<->superblock disagree for xp 85
warning: checkpoint<->superblock disagree for xp 83
warning: checkpoint<->superblock disagree for xp 81
warning: checkpoint<->superblock disagree for xp 79
warning: checkpoint<->superblock disagree for xp 77
warning: checkpoint<->superblock disagree for xp 75
warning: checkpoint<->superblock disagree for xp 73
warning: checkpoint<->superblock disagree for xp 71
warning: checkpoint<->superblock disagree for xp 69
warning: checkpoint<->superblock disagree for xp 67
warning: checkpoint<->superblock disagree for xp 65
warning: checkpoint<->superblock disagree for xp 63
warning: checkpoint<->superblock disagree for xp 61
warning: checkpoint<->superblock disagree for xp 59
warning: checkpoint<->superblock disagree for xp 57
warning: checkpoint<->superblock disagree for xp 55
warning: checkpoint<->superblock disagree for xp 53
warning: checkpoint<->superblock disagree for xp 51
warning: checkpoint<->superblock disagree for xp 49
warning: checkpoint<->superblock disagree for xp 47
warning: checkpoint<->superblock disagree for xp 45
warning: checkpoint<->superblock disagree for xp 43
warning: checkpoint<->superblock disagree for xp 41
warning: checkpoint<->superblock disagree for xp 39
warning: checkpoint<->superblock disagree for xp 37
warning: checkpoint<->superblock disagree for xp 35
warning: checkpoint<->superblock disagree for xp 33
warning: checkpoint<->superblock disagree for xp 31
warning: checkpoint<->superblock disagree for xp 29
warning: checkpoint<->superblock disagree for xp 27
warning: checkpoint<->superblock disagree for xp 25
warning: checkpoint<->superblock disagree for xp 23
warning: checkpoint<->superblock disagree for xp 21
warning: checkpoint<->superblock disagree for xp 19
warning: checkpoint<->superblock disagree for xp 17
warning: checkpoint<->superblock disagree for xp 15
Too many warnings of this type generated; suppressing subsequent ones.
error: no valid checkpoint
Most recent checkpoint is invalid.
** The volume /dev/disk0s2 could not be verified completely.
the output of disk utility:
while when i enter command+option+r
the disk utility shows the same diagnosis as above,
when i enter command+r
the disk utility shows the disk is good.
Can anyone help to fix this problem or give any suggestions? many thanks. The data in the disk is really important to me.
The value of 726562776 in the GPT might be wrong. My guess would be to change the value to 976695384. I would wait and see if someone else has a better idea.
The command to do this are given below. Here, I assume you have booted to a newer version of macOS Recovery.
gpt -f remove -i 2 disk0
gpt -f add -i 2 -b 409640 -s 976695384 -t apfs disk0
The older versions of macOS Recovery would require the longer commands given below.
diskutil unmountDisk /dev/disk0
gpt remove -i 2 /dev/disk0
diskutil unmountDisk /dev/disk0
gpt add -i 2 -b 409640 -s 976695384 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0
Why 976695384?
-
Reason 1: The error message from your question, which is repeated below.
warning: nx_block_count is 122086923, while device block count is 90820347
Since the device block size is 4096 bytes and the sector size is 512 bytes, the conversion requires multiplying by 8, as shown below.
122086923 blocks * 8 sectors per block = 976695384 sectors
-
Reason 2: This is the largest sector size that will hold complete blocks. If you take 976695387 sectors and convert to whole blocks by dividing by 8 and discarding the remainder of 3, you get the following.
976695387 sectors / 8 blocks per sector = 122086923 blocks
Next, convert back to sectors, as shown below.
122086923 blocks * 8 sectors per block = 976695384 sectors
This can be computed in your head. Basically, you divide the last three digits of 976695387 by 8 to get the remainder. In other words,
387 / 8 = 48
with remainder of 3. Next, subtract the remainder from 976695387 to get the result. In other words,976695387 - 3 = 976695384
. Why the last three digits? Well, 976695387 can be written as976695 * 1000 + 387
. Since 1000 is always evenly divisible by 8, you only need the last three digits to get the remainder.