APFS partition missing
I'm running macOS Big Sur on a MacBook Pro 2021 16" 2TB device. I have no additional OS, its just pure macOS installed on a single partition.
Yesterday I was doing some regular work, then left my MacBook Pro running and walked away for a few minutes. When I heard the MacBook Pro boot sound I returned back and saw the message guiding me to an Apple support web page regarding boot issues. So all of a sudden it restarted and was not booting anymore.
I tried booting in Recovery Mode and running Disk Utility, I could only see the physical disk, no partitions underneath. I tried first aid several times in Recovery Mode without any luck. Then I've found two applications online, TestDisk and Disk Drill, both of them couldn't find any partitions in my hard drive.
I'm not familiar with macOS partitions or anything related, so appreciate if I could get some help on fixing this issue. Here are outputs of two commands that might be useful to start with.
gpt -r show disk0
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 4 Pri GPT table
6 488552519
488552525 4 Sec GPT table
488552529 1 Sec GPT header
diskutil list disk0
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *2.0 TB disk0
export LC_CTYPE="ASCII"; dd if=/dev/disk0 count=1 skip=614448 bs=512 | vis -cfw
1+0 records in
1+0 records out
512 bytes transferred in 0.000778 secs (657930 bytes/sec)
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\
Your drive has experienced idiopathic catastrophic corruption. There are many possible explanations I could offer but it won't do any good trying to root-cause right now. The only priority is to save your data.
If you have a recent backup of your data, you can stop reading now. Go format your drive, restore from your backup, and then carefully monitor your system for further misbehavior because something like this is often the result of hardware failure and can easily reoccur.
If you don't have a backup, your situation becomes a lot less pleasant.
There are no readily available tools that I know of which will recover your data in a straightforward fashion. My go-to tool for filesystem repair, DiskWarrior, doesn't have APFS support. But even if it did, as far as the system is concerned, there is no filesystem on your drive. The 2TB partition just looks like free space.
But - presumably - the bulk of your filesystem actually remained intact after the failure sequence, and the corruption is likely localized to a critical region of your disk. What this means is that a heuristic scavenging algorithm can probably identify and recover a large portion of your data.
I'm only aware of one service that has the capabilities to recover your data from an APFS volume: DriveSavers. And they ain't cheap. So now the question becomes: How much is your data worth to you?
(If you are going to attempt to rescue your data, immediately turn off and do not power up again your computer! Every second that the drive is receiving power, there is an increased opportunity for further corruption.)