Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

toke lahti

macrumors 68040
Original poster
Apr 23, 2007
3,293
510
Helsinki, Finland
So,
my external APFS drive corrupted.
It contains my Photos library, all music and lots of other stuff.
I do have a 3 weeks old TM backup of it.
Checked the S.M.A.R.T and all is well in physical side.
Disk Utility's First Aid can't find any problems when checking the disk.

If there's a way to repair, I'd much rather use that, than restore from TM.
The disk also acts as a just-in-case boot drive, the container also has a Preboot, Recovery and VM volumes.

(And yes, it is a spinning disk and also ssd, as it is a hybrid disk. I know about apfs fragmentation, but since I want to be able to boot from it, I guess hfs+ is out of game?)

Anybody having experience with this "Unable to perform deferred repairs without full space verification" problem?
How do you do "full space verification"?

Running for the container it says this:
Code:
Running First Aid on “AppleAPFSMedia” (disk5)

Checking storage system and repairing if necessary and if possible
Performing fsck_apfs -y -x /dev/disk4s2
Checking the container superblock.
Checking the EFI jumpstart record.
Checking the space manager.
Checking the space manager free queue trees.
Checking the object map.
Checking the encryption key structures.
Checking volume /dev/rdisk5s1.
Checking the APFS volume superblock.
Checking the object map.
Checking the snapshot metadata tree.
Checking the snapshot metadata.
Checking snapshot 1 of 1 (com.apple.TimeMachine.2023-06-03-145419.local)
error: directory record (id 3026446): invalid hash (0x0, expected 0x389494) of name (3000374D-0649-4286-94BB-822F17147F4E.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3dbb46) of name (30110B23-F3CD-4B2F-845D-363FE1B08746.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x38ed6d) of name (30B4DB49-FCE7-4D74-9C48-C517DA8EA4CD.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3a200b) of name (30FF1F02-A576-40AD-8C39-2F4606C0F427.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x38f38c) of name (35548B1C-ABA1-4733-8BA3-F4CEFA45584A.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3e1b45) of name (36861292-51CB-495B-9399-15C15E2B68EC.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x37439c) of name (374327F0-56D6-498E-B3E2-3E61FBA9327F.JPG)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3f85ad) of name (38399C4F-277B-4B61-A8F6-8AABAD01B9F9.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3ab72e) of name (3BC3E761-6610-412D-824A-D6D0BD578023.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x36f708) of name (3D4084BA-3A3B-48FC-A18E-A630C073A89C.jpeg)
error: (oid 0x76022) apfs_root: btn: invalid o_oid (0x8c49d)
error: (oid 0x76022) apfs_root: btn: invalid o_xid (0xc47e1, expected 0xc480e)
Checking the document ID tree.
Checking the fsroot tree.
error: directory record (id 3026446): invalid hash (0x0, expected 0x389494) of name (3000374D-0649-4286-94BB-822F17147F4E.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3dbb46) of name (30110B23-F3CD-4B2F-845D-363FE1B08746.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x38ed6d) of name (30B4DB49-FCE7-4D74-9C48-C517DA8EA4CD.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3a200b) of name (30FF1F02-A576-40AD-8C39-2F4606C0F427.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x38f38c) of name (35548B1C-ABA1-4733-8BA3-F4CEFA45584A.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3e1b45) of name (36861292-51CB-495B-9399-15C15E2B68EC.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x37439c) of name (374327F0-56D6-498E-B3E2-3E61FBA9327F.JPG)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3f85ad) of name (38399C4F-277B-4B61-A8F6-8AABAD01B9F9.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x3ab72e) of name (3BC3E761-6610-412D-824A-D6D0BD578023.jpeg)
error: directory record (id 3026446): invalid hash (0x0, expected 0x36f708) of name (3D4084BA-3A3B-48FC-A18E-A630C073A89C.jpeg)
error: (oid 0x76022) apfs_root: btn: invalid o_oid (0x8c49d)
error: (oid 0x76022) apfs_root: btn: invalid o_xid (0xc47e1, expected 0xc480e)
warning: aborting jobj validations for current fsck pass - trying to repair fsroot tree with invalid nodes
error: (oid 0x75583) apfs_root: btn: invalid o_oid (0x8c7db)
error: (oid 0x75583) apfs_root: btn: invalid o_xid (0xc47da, expected 0xc480e)
error: (oid 0x767fc) apfs_root: btn: invalid o_oid (0x75e79)
error: (oid 0x767fc) apfs_root: btn: invalid o_xid (0xc47b2, expected 0xc480e)
error: (oid 0x8c801) apfs_root: btn: invalid o_oid (0x26f1f0)
error: (oid 0x8c801) apfs_root: btn: invalid o_xid (0xc47e3, expected 0xc480e)
error: (oid 0x8c801) apfs_root: btn: invalid o_subtype (0xb, expected 0xe)
error: (oid 0x8c801) apfs_root: btn: invalid o_type (0x40000003, expected 0x3)
Checking the extent ref tree.
Verifying volume object map space.
The volume /dev/rdisk5s1 was found to be corrupt and needs to be repaired.
Checking volume /dev/rdisk5s2.
Checking the APFS volume superblock.
Checking the object map.
Checking the snapshot metadata tree.
Checking the snapshot metadata.
Checking the fsroot tree.
Checking the extent ref tree.
Verifying volume object map space.
The volume /dev/rdisk5s2 appears to be OK.
Checking volume /dev/rdisk5s3.
Checking the APFS volume superblock.
Checking the object map.
Checking the snapshot metadata tree.
Checking the snapshot metadata.
Checking the fsroot tree.
Checking the extent ref tree.
Verifying volume object map space.
The volume /dev/rdisk5s3 appears to be OK.
Checking volume /dev/rdisk5s4.
Checking the APFS volume superblock.
Checking the object map.
Checking the snapshot metadata tree.
Checking the snapshot metadata.
Checking the fsroot tree.
Checking the extent ref tree.
Verifying volume object map space.
The volume /dev/rdisk5s4 appears to be OK.
Verifying allocated space.
Performing deferred repairs.
error: Unable to perform deferred repairs without full space verification
The container /dev/disk4s2 could not be verified completely.
Storage system check exit code is 8.
Storage system verify or repair failed. : (-69716)

Operation failed…
 
I guess that the filesystem wizards are offline, but if the problem lies with snapshot, is the solution simply delete that snapshot from the disk?

Have I understood right, that "first snapshot" is still a copy of data and the volume does not disappear, when 1st snapshot is deleted? Or is the volume itself the 1st snapshot?

Btw, are there anywhere instructions, how to clone a VOLUME from TM to disk in use?
 
I would copy what is possible from it and reformat it all as HFS+. APFS is an unreliable work in progress.

Apple's instructions on how to “Delete an APFS snapshot”
https://support.apple.com/guide/disk-utility/view-apfs-snapshots-dskuf82354dc/mac
This is why the disk is APFS:
Code:
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                 Apple_APFS Container disk3         2.0 TB     disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.0 TB     disk3
                                 Physical Store disk2s2
   1:                APFS Volume HDDhomeDir              1.7 TB     disk3s1
   2:                APFS Volume Preboot                 45.3 MB    disk3s2
   3:                APFS Volume Recovery                510.3 MB   disk3s3
   4:                APFS Volume VM                      10.7 GB    disk3s4
I did put defragmentation on for the container and volume, so maybe this will make corruption less likely.
Is this really so, that the only problem with the container is corrupted snapshot?
And since I have TM-backups before and after, there no use for that snapshot?
 
"it is a spinning disk and also ssd, as it is a hybrid disk"

What kind of drive is this, that is not "just an HDD" or not "an SSD"?

I kind of remember a period of "hybrid" drives, but that was many years ago.

My advice:
You've got to get your stuff OFF OF this drive, and onto "non-hybrid" drives.
Otherwise, you may be headed for more trouble.

Sounds to me like you need TWO replacements:
- one (could be HDD) for the tm backups
and
- another (could be SSD) for your "other" storage.

Something tells me you're not going to "fix" this hybrid drive without a full reformat, if even that fixes it...
 
I would copy what is possible from it and reformat it all as HFS+. APFS is an unreliable work in progress.

Apple's instructions on how to “Delete an APFS snapshot”
https://support.apple.com/guide/disk-utility/view-apfs-snapshots-dskuf82354dc/mac
...and quite "apple style", with deleted (ALL) snapshots from the volume First Aid says:

Code:
Checking snapshot 1 of 1 (com.apple.apfs.purgatory.1da4cf)
error: directory record (id 3026446): invalid hash (0x0, expected 0x389494) of name (3000374D-0649-4286-94BB-822F17147F4E.jpeg)
...etc...
 
This "corruption" was in Photos Library.photoslibrary.
Where it got to a snapshot, which First Aid couldn't fix.
Deleting the snapshot wouldn't fix it either, since that doesn't really delete the snapshot, it remains in "purgatory" state.
And when "purgatory" state ends and snapshot disappears for real, there's already a new snapshot.

The key to fix the problem was to login with another account. Then delete the Photos Library.photoslibrary, because with the normal account, I guess, pholibraryd takes the ownership of Photos Library.photoslibrary and then you can't delete or replace it. At least I couldn't, maybe because of the corruption.

So deleted the Photos Library.photoslibrary, back to normal account, wait for new (Photos Library.photoslibrary free) snapshot, delete the corrupted one, back to alternative account, First Aid to Volume, then First Aid to Container, back to normal account, copying Photos Library.photoslibrary(only 180GB) from backup and then repairing the Photos Library.

Easy peasy, lucky that we have these macs that just works, a full week after trying the new "Duplicates" feature of the Photos, all is back and well and it took only 20 hours for Photos to repair the library. Maybe because the mac secided to go to sleep when repair was half way through.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.