Device does not contain a valid APFS container

I have a 4TB external drive. There are two partitions, 1 is 3TB and was converted from HFS+ Encrypted to APFS Encrypted (worked fine, it did have old Time Machine backups on it though), and I created a second bootable Sierra 10.12 install via createinstallmedia on the other one. After using the disk to install Sierra on a Macmini, the other partition no longer shows up.


In 10.13 in Disk Utility, it shows it's an APFS on the pie chart, but the format is blank/not recognised. It's not recognised, won't mount or anything because something is corrupted. In fsck_apfs below you can see the hex "Invalid partition table. Error loading operating system Missing operating system" which doesn't make sense to me at all. So I don't know what happened to the container. Would createinstallmedia cause the issue?


diskutil list


/dev/disk2 (external, physical):
  #:                      TYPE NAME                    SIZE      IDENTIFIER
  0:      GUID_partition_scheme                        *4.0 TB    disk2
  1:                        EFI EFI                    209.7 MB  disk2s1
  2:                Apple_APFS                        3.0 TB    disk2s2
  3:                Apple_Boot Boot OS X              134.2 MB  disk2s3
  4:                        EFI NO NAME                104.9 MB  disk2s4
  5:                        EFI NO NAME                104.9 MB  disk2s5
  6:                Apple_APFS                        799.8 GB  disk2s6
/dev/disk3 (synthesized):
  #:                      TYPE NAME                    SIZE      IDENTIFIER
  0:      APFS Container Scheme                        +799.8 GB  disk3
/dev/disk3s1 (external, virtual):
  #:                      TYPE NAME                    SIZE      IDENTIFIER
  0:                APFS Volume Empty                  +880.6 KB  disk3s1


sudo fsck_apfs /dev/disk2s2


0000:  33c0 8ed0 bc00 7c8e c08e d8be 007c bf00       |3...............|
0010:  06b9 0002 fcf3 a450 681c 06cb fbb9 0400       |.......Ph.......|
0020:  bdbe 0780 7e00 007c 0b0f 8510 0183 c510       |................|
0030:  e2f1 cd18 8856 0055 c646 1105 c646 1000       |.....V.U.F...F..|
0040:  b441 bbaa 55cd 135d 720f 81fb 55aa 7509       |.A..U...r...U.u.|
0050:  f7c1 0100 7403 fe46 1066 6080 7e10 0074       |....t..F.f.....t|
0060:  2666 6800 0000 0066 ff76 0868 0000 6800       |.fh....f.v.h..h.|
0070:  7c68 0100 6810 00b4 428a 5600 8bf4 cd13       |.h..h...B.V.....|
0080:  9f83 c410 9eeb 14b8 0102 bb00 7c8a 5600       |..............V.|
0090:  8a76 018a 4e02 8a6e 03cd 1366 6173 1efe       |.v..N..n...fas..|
00a0:  4e11 0f85 0c00 807e 0080 0f84 8a00 b280       |N...............|
00b0:  eb82 5532 e48a 5600 cd13 5deb 9c81 3efe       |..U2..V.........|
00c0:  7d55 aa75 6eff 7600 e88a 000f 8515 00b0       |.U.un.v.........|
00d0:  d1e6 64e8 7f00 b0df e660 e878 00b0 ffe6       |..d........x....|
00e0:  64e8 7100 b800 bbcd 1a66 23c0 753b 6681       |d.q......f..u.f.|
00f0:  fb54 4350 4175 3281 f902 0172 2c66 6807       |.TCPAu2....r.fh.|
0100:  bb00 0066 6800 0200 0066 6808 0000 0066       |...fh....fh....f|
0110:  5366 5366 5566 6800 0000 0066 6800 7c00       |SfSfUfh....fh...|
0120:  0066 6168 0000 07cd 1a5a 32f6 ea00 7c00       |.fah.....Z2.....|
0130:  00cd 18a0 b707 eb08 a0b6 07eb 03a0 b507       |................|
0140:  32e4 0500 078b f0ac 3c00 74fc bb07 00b4       |2.........t.....|
0150:  0ecd 10eb f22b c9e4 64eb 0024 02e0 f824       |........d.......|
0160:  02c3 496e 7661 6c69 6420 7061 7274 6974       |..Invalid.partit|
0170:  696f 6e20 7461 626c 6500 4572 726f 7220       |ion.table.Error.|
0180:  6c6f 6164 696e 6720 6f70 6572 6174 696e       |loading.operatin|
0190:  6720 7379 7374 656d 004d 6973 7369 6e67       |g.system.Missing|
01a0:  206f 7065 7261 7469 6e67 2073 7973 7465       |.operating.syste|
01b0:  6d00 0000 0062 7a99 90e1 0713 0000 0000       |m....bz.........|
01c0:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
. . .
01f0:  0000 0000 0000 0000 0000 0000 0000 55aa       |..............U.|
0200:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
. . .
03d0:  0000 0000 0000 0000 385b 3d00 0000 0000       |........8.......|
03e0:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
. . .
04f0:  0400 0000 0000 0000 4b6e 0000 0000 0000       |........Kn......|
0500:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
0510:  bb6e 0000 0000 0000 0100 0000 0000 0000       |.n..............|
0520:  0100 0400 0800 0000 0000 0000 0000 0000       |................|
0530:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
. . .
0ff0:  0000 0000 0000 0000 0000 0000 0000 0000       |................|
error: Device does not contain a valid APFS container.

Replies

I have the same issue.

The raw data is still there, but the APFS container (or it's partition table) is apparently broken. Happened many times to me now.

I use iBoysoft Data Recovery, because it indeed detects lost APFS volumes, can even restore encrypted ones!

The question is: How to recover the original APFS partition map? iBoysoft's app is apparently able to reconstruct that, but it will only offer data recovery, no partition repair. I habe searched everywhere but still not found any solution.

Any news on this?

My Fusion Drive in my iMac is now unreadable, the iMac rebooted and then the Fusion Drive with APFS is now only shown as greyed out "APFS Physical Store disk0s2", "APFS Physical Store disk1s2" ... all data must still be there, but the APFS container seems to have currupted, like it has happened to me a myriad times before on external HDDs.

Since there is still no tool available that can repair APFS containers, how can I fix my drive? I'm coing to report this to Apple.

I deleted my backup shortly before since it was faulty and I needed a new one, and now I have NO Backup!

Apple, what's going on there? Why does your APFS keep crashing randomly on my HDDs and now my Fusion Drive, making all APFS Volume in the respective containers vanish?


As I see it, the partitions are still shown as being APFS-partitions, but there are no valid containers found.

Hence, the normal partition map seems intact, the APFS-partition map (I guess that's how the containers work) seems to have gone corrupt.

fsck_apfs would only return what rsnowden posted here.


HELP!

Hi

Ehm, what?

Same issue with an external 8TB APFS SSD. Looks like it did not get fixed.