Is there a way to recover the deleted APFS Container?

Hi,


I accidentally deleted the wrong container and can't boot my Mac now, wondering is it possible to recover/restore it, any suggestion is very appreciate!


So the story is I am trying to clean up the drive after removing the bootcamp, but end up typing

sudo diskutil apfs deleteContainer disk0s1 with the wrong container. I abort the command when I

notice I have done a stupid thing but I guess it is too late.


Attached is the diskutil list, I think there is a Container disk1 in my disk0 if I remember it correctly, is the a way to restore the deleted container, or like overwrite (re-install) to grab it?


This is the disk0 info


This is the disk3 info


My drive looks similiar like this before I made the command in disk utility


Also not sure if the info helps, when power on the OS cannot load and will stuck in the middle of progress bar


Thanks for taking time reading!

iMac Line (2012 and Later)

Posted on Jun 25, 2022 11:57 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 26, 2022 2:29 AM

Will the computer boot to Internal Recovery Mode ?


With computer fully off and no external drive attached.


For best results connect to Router via Ethernet Cable, to avoid the iffy Wifi Manual input password aspect


Restart and immediately hold the Option +Command + r ( three key combination )


If works a Spinning Globe will start loaded from the Apple Servers.


Depending on the Internet Speed and Apple Servers it will eventually present as per image below



Because aspect of the Drive Content / Structure has been badly modified, would suggest the below instructions.


Understand - this next step will remove everything from the Drive and there is no recovery - period.


It will present options >> Disk Utilities >> View >> View ALL attached Drives. 


Choose the Upper Most Drive ( not the volumes indented and list below ).


The drive normally is called Apple Media or Apple SSD - that is the drive to Erase and format as APFS with the GUID Partition Map. This applies to macOS 10.14 Mojave and above. 


Once that is done >> backup out of Disk Utilities and choose install macOS. 


Follow the prompts and it may automatically reboot several time. 


Upon a final reboot - Setup Assist will present with the newer version of macOS.

Similar questions

1 reply
Question marked as Top-ranking reply

Jun 26, 2022 2:29 AM in response to KevinLien

Will the computer boot to Internal Recovery Mode ?


With computer fully off and no external drive attached.


For best results connect to Router via Ethernet Cable, to avoid the iffy Wifi Manual input password aspect


Restart and immediately hold the Option +Command + r ( three key combination )


If works a Spinning Globe will start loaded from the Apple Servers.


Depending on the Internet Speed and Apple Servers it will eventually present as per image below



Because aspect of the Drive Content / Structure has been badly modified, would suggest the below instructions.


Understand - this next step will remove everything from the Drive and there is no recovery - period.


It will present options >> Disk Utilities >> View >> View ALL attached Drives. 


Choose the Upper Most Drive ( not the volumes indented and list below ).


The drive normally is called Apple Media or Apple SSD - that is the drive to Erase and format as APFS with the GUID Partition Map. This applies to macOS 10.14 Mojave and above. 


Once that is done >> backup out of Disk Utilities and choose install macOS. 


Follow the prompts and it may automatically reboot several time. 


Upon a final reboot - Setup Assist will present with the newer version of macOS.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is there a way to recover the deleted APFS Container?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.