Jump to content

Fix apfs partition not recognised after windows resizing


3 posts in this topic

Recommended Posts

if you happen to resize your apfs volume in windows you will break mac os x partition

 

to fix it:

 

- boot using a recovery cd image (use the most recent basesystem.img you can find and burn it to a usb pen)

open diskutility (you will see the bugged disk with the unselectable apfs broken partition)

 

- open terminal

 

this is a sample  - you need to figure out which disk and partition to recover

let's say diskutility says your broken os x partition is disk0s2

 

gpt -r show /dev/disk0

 

          40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      409640   736324336      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
   736733976  1216529008      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  1953262984      262150         
  1953525134          32         Sec GPT table
  1953525166           1         Sec GPT header

 

gpt remove -i 2 /dev/disk0

gpt add -i 2 -b 409640 -s 736324336 -t apfs /dev/disk0

 

this doesn't delete partition contents

 

this applies if you haven't delete any partition from gpt table

what this does is recover the correct partition type so os x can recognise it and boot

 

before using this commands make sure you use umount /dev/disk0sx

e.g umount /dev/disk0s1  umount /dev/disk0s3

you might need to unmount again if any command fails

 

Edited by jalavoui
Link to comment
Share on other sites

Use mac OS disktool to resize partitions and make a backup of your partition table before resizing.

 

Alternatively you can use gparted live boot iso on USB to resize windows partitions.

Link to comment
Share on other sites

 Share

×
×
  • Create New...