My primary MacOS partition got corrupted and I can not repair it or make it bootable.
Here's the breakdown of the situation:
I had this MacOS Sierra partition, 450 GB, and a second partition with MacOS High Sierra, 50 GB. I booted as usual on Sierra and tried creating a new partition using Disk Utility by reducing the size of the 450 GB partition in 50 GB. The goal was to later enlarge the High Sierra one. The operation failed so I restarted, held CMD+R > Disk Utility and tried to First Aid my primary 450 GB partition. It failed as well.
The High Sierra one still boots fine but when I try to repair the Sierra partition, Disk utility gives me this message:
Repairing file system.
Volume is already unmounted.
Performing fsck_hfs -fy -x /dev/rdisk0s2
Checking Journaled HFS Plus volume.
Invalid number of allocation blocks
The volume could not be verified completely.
File system check exit code is 8.
Restoring the original state found as unmounted.
File system verify or repair failed.
Operation failed…
Also, a new dummy partition called disk0s4 showed up with the exact same size of those 50 GB I tried creating on the first place. Disk Utility will not allow me to delete it.
Can you guys please help me out? I do believe this should be "easily" fixable via some sort of high level Terminal command.
sudo gpt -r show disk0
results:
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 782652408 2 GPT part - 48465300-0000-11AA-AA11-
00306543ECAC
783062048 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-
00306543ECAC
784331584 96124576 4 GPT part - 48465300-0000-11AA-AA11-
00306543ECAC
880456160 262144
880718304 96124576 5 GPT part - 48465300-0000-11AA-AA11-
00306543ECAC
976842880 262147
977105027 32 Sec GPT table
977105059 1 Sec GPT header
sudo df
:
Filesystem 512-blocks Used Available
Capacity iused ifree %iused Mounted on
/dev/disk0s2 782652408 712293504 69846904 92%
1236092 4293731187 0% /
devfs 390 390 0 100%
676 0 100% /dev
/dev/disk0s5 96124576 306608 95817968 1%
146 4294967133 0% /Volumes/Untitled
map -hosts 0 0 0 100%
0 0 100% /net
map auto_home 0 0 0 100%
0 0 100% /home
localhost:/oH1iUNq0m11UpXt--bqLKM 782652408 782652408 0 100%
0 0 100% /Volumes/MobileBackups
/dev/disk2s2 253044736 23065088 229979648 10%
90098 898358 9% /Volumes/128 GB
/dev/disk1s3 1269760 1101624 168136 87%
215 4294967064 0% /Volumes/HDM Recovery
/dev/disk1s4 974759168 830544520 144214648 86%
653486 4294313793 0% /Volumes/ART
/dev/disk1s2 975396824 704192064 271204760 73%
1104809 4293862470 0% /Volumes/CCC
sudo gpt -r show disk0
in Terminal.app to your question. Related: Partition on HFS+ external drive: “Invalid number of allocation blocks”, file system check exit code 8. Unable to repair, even in recovery mode. – klanomath Nov 22 '17 at 19:10gpt show: unable to open device 'disk0': Operation not permitted
– Allan Nov 22 '17 at 19:30df
additionally. – klanomath Nov 23 '17 at 20:43