1

I have an external SSD hard drive connected to my iMac via USB. I accidentally disconnected it while it was mounted, which caused a warning.

So I thought it would be prudent to run Disk Utility on the drive. When I do, fsck_apfs unmounts the disk, then complains that the disk is mounted and aborts:

Repairing file system.
Volume was successfully unmounted.
Performing fsck_apfs -y -x /dev/rdisk4s2
error: container /dev/rdisk4 is mounted.
File system check exit code is 65.
File system verify or repair failed. : (-69845)

And this is the top level message: "First Aid process has failed. If possible back up the data on this volume. Click Done to continue."

Any suggestions?

2 Answers 2

2

This is the result of a bug in Disk Utility. Disk Utility still can’t check and repair APFS volumes and containers by Howard Oakley describes in light detail how you can use a Terminal window to check these volumes and confirm if they really have problems. Warning: the method in the article asks you to execute commands in under sudo, with Administrator privileges. These commands have raw write access to the disk drives.

The bug is that Disk Utility doesn't know how to unmount an APFS volume. Unmounting is a requirement if you wish to repair the drive. You actually have two choices on this:

  • You can follow Howard Oakley's article linked above;
  • You can reboot your machine into Recovery Mode and use the embedded copy of Disk Utility.

Rebooting into Recovery Mode works because the mechanisms to auto-mount the drive are disabled there. If we are talking about Time Machine volumes they are usually structured as:

Physical disk drive
  |__container volume
      |__backup volume

All three need to be checked to make sure that the filesystem structure is okay. Disk Utility can sometimes unmount the backup volume but it can't unmount the container volume. In recovery mode, the Container Volume doesn't get auto-mounted so checking it works. Thus it consistently reports that the filesystem is broken and suggests that the best way to fix this is to reformat the whole thing. When you reformatted it as FAT, it all worked because, as I said before, this is an APFS-specific problem.

1

Exact same thing happened to my backup disk, exact same message from Disk Utility.

Erasing and reformatting in APFS would generate the same error. Erased and reformatted in FAT then reformatted back to APFS and the First Aid error went away.

If, following the first Time Machine backup, it doesn't appear in Finder, restart the computer in Safe Mode and perform initial Time Machine backup. Confirm it shows up in Finder then shut down and start back up normally, Time Machine will then perform normally for subsequent backups.

2
  • Thanks for your reply, I applied your suggestion and so far so good. Even when the error was evident, Time Machine backups ran and appeared normal. Do you know why the FAT reformat works?
    – richardsun
    Commented Jan 1, 2022 at 21:51
  • 1
    I don't know why it worked initially, but it has stopped working on my external drive. The same error is being generated again. The decision to try reformatting in FAT then back to APFS was out of desperation, I was going to reformat the drive on a Windows machine to see if that generated any errors but it wouldn't recognize the APFS drive (doh!). The thought occurred to me that I could reformat in FAT using Disk Utility. First Aid showed a healthy drive in FAT and initially when formatted back to APFS. Sadly, it's no longer the case.
    – Mike Coyne
    Commented Jan 3, 2022 at 6:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .