macOS partitions are disappeared after disk utility first aid hanged for an hour
Thanks for your time.
I have an iMac 27 Late 2012 and have macOS 10.13.6 + macOS 11.6 + boot camp windows 7 installed.
I was on macOS10.13.6 and tried to run first aid on Disk Utility app and I got the message "First Aid needs to temporarily lock the boot volume.You are about to run First Aid against the volume that is currently booted. In order to run First Aid, the boot volume must be frozen. This will result in apps not responding during the operation. This is completely normal and apps will begin responding when the operation has completed. "
Then It hanged for about an hour and no respond from computer even mouse was not moving. I was low on storage too about 6 GB was left approximately.
So I turned off the mac and switched on and used "option" key while restarting to get to choosing startup disks and use "command R" to get to recovery mode and run the first aid from recovery mode.
When got to Disk Utility in recovery mode i saw disk0s2 can not be mounted!
I got through many articles and did following commands and got the following results and still I have the problem where the macOS partitions are disappeared:
diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI 209.7 MB disk0s1
2: Microsoft Basic Data BOOTCAMP 209.0 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *1.2 GB disk1
1: Apple_partition_map 30.7 KB disk1s1
2: Apple_HFS Mac OS X Base System 1.2 GB disk1s2
and once I ran code for gpt -r show /dev/disk0 I got below
409640 1544923096 2 GPT part - FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
**this code is written by myself not copied and pasted**
i ran into a youtube video(https://www.youtube.com/watch?v=kXfkSWLO380 )and in order to remove the FFFFFFFF ....
I ran this code
gpt remove -i 2 /dev/disk0
then it gave error disk resource busy and what I did I unmount the disk and ran again and it was successfully unmounted after removed
and i cannot run the next code which is
gpt add -i 2 -b 409640 -s 1544923096 -t 7C3457EF-0000-11AA-AA11-00306543ECAC /dev/disk0
first right after this code before restarting i got "255" infront of gpt part but after i restarted the computer when i run the following code i get the following result:
gpt -r show /dev/disk0
gpt show: /dev/disk0: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 1544923096
1545332736 408190976 2 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
1953523712 1423
1953525135 32 Sec GPT table
1953525167 1 Sec GPT header
I needed to stop trying and error and i hope the data is there and with few changes i can access them. as of now only boot camp is showing up .