Can not access or mount external encrypted APFS disk

I have an external disk that was encrypted with a password (I know the password) that was incorrectly disconnected from USB at some point. Ever since I am unable to mount the disk. I have tried mounting through Disk Utility and diskutil mountDisk command, but no success.


When I connect the disk, Finder asks for the password. After typing it in, it waits a very long time and then nothing. The disk shows up in diskutil list.


When I try to do a disk copy with Disk Utility it gives an

error 16: Resource Busy. 


diskutil apfs list gives:

+-- Container disk4 <hex nr>
    ====================================================
    APFS Container Reference:     disk4
    Size (Capacity Ceiling):      999995129856 B (1000.0 GB)
    Capacity In Use By Volumes:   289369083904 B (289.4 GB) (28.9% used)
    Capacity Not Allocated:       710626045952 B (710.6 GB) (71.1% free)
    |
    +-< Physical Store disk3s2 <hex nr>
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk3s2
    |   Size:                       999995129856 B (1000.0 GB)
    |
    +-> Volume disk4s1 <hex nr>
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk4s1 (No specific role)
        Name:                      Black (werk) (Case-sensitive)
        Mount Point:               Not Mounted
        Capacity Consumed:         289161928704 B (289.2 GB)
        FileVault:                 Yes (Locked)


diskutil RepairVolume disk3 gives:

Error starting file system repair for disk3: Invalid request (-69886)


What can I do to figure out what is the problem and how can I solve this?


Posted on Mar 1, 2021 10:39 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 1, 2021 8:27 PM

You tried to "repair" the entire "disk3" which I'm not sure you can do. I think you need to specify a partition/volume such as "disk3s2".


Try using the command line to unlock the Filevault without mounting the volume. If the volume is unlocked, then try using the command line to mount the volume read-only. macOS can get into a weird state after attempting to mount a volume as evidenced by the "disk4s1" listing here. I would reboot the Mac, then try to manually unlock and mount the drive read-only. Assuming the external drive is still "disk3" after the reboot the commands should be:

diskutil  ap  unlockVolume  -nomount  disk3s2


diskutil  mount  readOnly  disk3s2


Note: Or the mount device may need to be "disk4s1" (double-check the information from diskutil ap list to see if "disk4s1" or another drive identifier is linked to "disk3s2" like it is shown in your screenshot).


When I've encountered APFS Filevaulted drives that could not be mounted I've never been able to manually mount them read-only as there is always file system corruption preventing the unlocked APFS volume from mounting read-only.


There is a possibility your external drive is failing. You can attempt to check the health of the external drive by running DriveDx. You will need to install a special USB driver so that DriveDX can communicate properly with the USB drive. Even with this special driver DriveDx may not be able to access the health information on the external drive because some USB controllers used by external drives don't allow the necessary communication. Post the DriveDx report for the external drive here using the "Additional Text" icon which looks like a piece of paper. If DriveDx reports any failures, then stop using the drive immediately or you risk the failure getting worse.


As @steve626 mentions there are no third party utilities to repair the APFS file system. After that you will need to contact a professional data recovery service such as Drive Savers or Ontrack. Both vendors provide free estimates and both are recommended by Apple.


You should have frequent & regular backups of any external media that contains important and unique information as well as your boot drive.

Similar questions

8 replies
Question marked as Top-ranking reply

Mar 1, 2021 8:27 PM in response to ignitemymac

You tried to "repair" the entire "disk3" which I'm not sure you can do. I think you need to specify a partition/volume such as "disk3s2".


Try using the command line to unlock the Filevault without mounting the volume. If the volume is unlocked, then try using the command line to mount the volume read-only. macOS can get into a weird state after attempting to mount a volume as evidenced by the "disk4s1" listing here. I would reboot the Mac, then try to manually unlock and mount the drive read-only. Assuming the external drive is still "disk3" after the reboot the commands should be:

diskutil  ap  unlockVolume  -nomount  disk3s2


diskutil  mount  readOnly  disk3s2


Note: Or the mount device may need to be "disk4s1" (double-check the information from diskutil ap list to see if "disk4s1" or another drive identifier is linked to "disk3s2" like it is shown in your screenshot).


When I've encountered APFS Filevaulted drives that could not be mounted I've never been able to manually mount them read-only as there is always file system corruption preventing the unlocked APFS volume from mounting read-only.


There is a possibility your external drive is failing. You can attempt to check the health of the external drive by running DriveDx. You will need to install a special USB driver so that DriveDX can communicate properly with the USB drive. Even with this special driver DriveDx may not be able to access the health information on the external drive because some USB controllers used by external drives don't allow the necessary communication. Post the DriveDx report for the external drive here using the "Additional Text" icon which looks like a piece of paper. If DriveDx reports any failures, then stop using the drive immediately or you risk the failure getting worse.


As @steve626 mentions there are no third party utilities to repair the APFS file system. After that you will need to contact a professional data recovery service such as Drive Savers or Ontrack. Both vendors provide free estimates and both are recommended by Apple.


You should have frequent & regular backups of any external media that contains important and unique information as well as your boot drive.

Mar 2, 2021 5:10 PM in response to ignitemymac

Try using DriveDx before you unlock the Filevault as unlocking the drive and attempting to mount the drive may be interfering.


You can try unlocking the Filevault as I described earlier to try using a data recovery app such as Data Rescue.


The best way to perform a bit for bit clone of a drive is by using the command line utility GNU ddrescue which is similar to "dd", but is able to handle errors thrown up by a failing drive plus it can resume an interrupted clone and is able to show you the progress. However, the command line utilities are dangerous to use as it is very easy to mix up the source & destination locations and destroy what you are trying to save. You will need an equal or larger size drive if you perform a bit for bit clone (not all 1TB drives have the exact same storage area -- probably not a big deal in most cases).


As long as the external drive is not throwing physical errors, then you can use macOS and GNU ddrescue by installing GNU ddrescue by using Homebrew. If the drive is throwing errors, then performing the clone using a Linux boot disk is best since macOS cannot handle the errors. You need to use the GNU ddrescue logging/mapping file in order to resume an interrupted clone. If a clone is interrupted you must always re-verify the source & destination drive identifiers before resuming the clone and make any appropriate adjustments.


If the physical drive is causing the problem in mounting the file system, then most times it is possible to mount the clone with good hardware, although if the file system is corrupt and Disk Utility is unable to repair it, then you are stuck since there are no third party utilities for repairing the APFS file system.


A bit for bit can easily copy an encrypted drive without issues. The encryption key is stored on the drive and is copied along with everything else. As long as the encryption key is not damaged it should be possible to unlock the Filevaulted clone. I've recovered data from hundreds of failing encrypted macOS hard drives using this technique (I've actually used a Linux system to perform the clone).

Mar 1, 2021 12:52 PM in response to ignitemymac

Have you tried First Aid through Disk Utility itself? Presumably yes and presumably did not work (as diskutil Repair failed, but I don't understand the "Invalid request" error message.) Have you tried First Aid at all levels of the drive?


With Filevault encrypted drives, the encryption is so strong that usually the only recovery possible is from a backup. Do you have one? Disconnecting the USB wire while still mounted could have left the drive in an unrecoverable state, the partition map may have been damaged. Normally repairable ... but often not with APFS or Filevault ...


Is this a mechanical drive? Is it USB powered? If yes to both questions, the situation may be grave because if it was actually accessing a platter when power was pulled the disk itself could be physically damaged beyond repair.


Even if unencrypted, there are very few APFS utilities that can repair APFS file system errors (Disk Utility has limited repair capabilities, tools like Disk Warrior are not yet APFS enabled.)


Returning to the time you entered the encryption password unsuccessfully ... Apple sets up an alternate way to unlock the drive when you first configure the drive and encrypt it. Did you have a recovery key, or did you use your iCloud account/password for that? Can you revert to that alternate way to unlock the drive?

Mar 1, 2021 4:13 PM in response to ignitemymac

ignitemymac wrote:
What might be a repair tool that can handle APFS drives?

I have looked into this in the past year and it seems that there has not been enough information released yet on Apple's APFS implementation for third party vendors to create utilities to repair the file systems in APFS analogous to what had been done for the earlier HFS+ file systems. I'm referring to the multiple often very powerful utilities such as Disk Warrior, TechTool Pro, Data Rescue, Disk Drill, etc. Some of these (Disk Warrior) state that at this time they cannot be used to repair damaged APFS drives, others claim to be able to do it (TechTool Pro). If you research this a bit online, you will see that even when manufacturers claim they can repair APFS damaged drives, in practice what they can do is reported by some to be a lot less than what used to be possible with HFS+. Most of these products offer a free trial download so you can sort of try it out with your situation before buying the product. I have TechTool Pro but have never tried it on an APFS drive as the opportunity has never arisen for me. APFS drives are supposed to be more resilient, but mishaps like yours will still occur. I always rely on multiple backups (of different types) for protection. For a drive that won't mount or appears to be irretrievably damaged, Apple always recommends an erase/reformat with restore from backup. If you don't have such a backup, then perhaps your best bet is to explore some of these disk repair utilities, but for APFS, the options are limited.


Is this an SSD or HDD? For HDD, there are other options, albeit expensive, where companies will take apart the drive platters and retrieve the bits (ones and zeroes) from the physical surfaces, and in this way some files can be reconstructed. The cost can run into thousands of dollars, however, as this is laborious work done in a clean room. For SSDs, I think the chances of recovery are much lower, either with a disk repair tool or a clean room recovery.


One last Hail Mary type effort might include taking the drive out of its current enclosure and putting it into a new one. This is relatively low cost and it would address the possibility of some electrical or firmware damage to the enclosure (with the drive itself still healthy) caused by the mishap. In other words, enclosure failure, not drive failure.

Mar 2, 2021 12:13 PM in response to ignitemymac

CCC used to have an option for block copying of drives, but I think that was on HFS+ drives in an older version. Maybe check their web site to see if this option still exists or if it exists for APFS.


You might also investigate the unix command dd as that might make a bit for bit copy of a drive. (Watch out for different block sizes on the source and destination drives, however.) I am not an expert user of dd, however, so research it first with the available documentation (use Terminal).


Problem is, since the source volume is Filevault encrypted, I think a bit for bit copy will be unreadable hash as it must be unlocked/decrypted to make any sense. If the partition maps were damaged on the source, not sure how that damage can be overcome on a duplicate copy.

Mar 9, 2021 6:16 AM in response to ignitemymac

Hi,


Good news. I finally decided to send the drive to a recovery service and they just got back to me that probably 90% of data can be recovered.


Thanks again for your answers.


Just in case someone else might need similar advice later on, do you have advice for:


  1. what to to do prevent a drive going into a locked state or lowering the chance of it getting corrupted when it might get disconnected accidentally (no clean eject)
  2. what to do if that happens to figure out what is going on and what especially not to do at that moment
  3. good housekeeping practices for backing up & securing your data


*moves on to order an extra backup drive*


Thanks,

Casper

Mar 2, 2021 11:16 AM in response to ignitemymac

Hi Steve626 and HWTech,


thank you so much for taking the time to answer my questions.


So far no luck. I have tried DriveDX. At first the drive was visible (greyed out) in the left bar, but now it does not appear anymore. I could not run a diagnostic with it yet.


Techtool Pro so far is producing errors.


diskutil repairVolume seems to do something:

diskutil repairVolume disk3s1
Started file system repair on disk3s1 Black
Repairing file system
Volume is already unmounted
Performing fsck_apfs -y -x /dev/rdisk3s1
[   \   \   \   \   \   \   \   \   \   \   \   \   \   \ ]

...however exits with:

error: mount_apfs exit status 73
File system check exit code is 78
Restoring the original state found as unmounted
Error: -69845: File system verify or repair failed
Underlying error: 78


Is there a way to at least make a 1-1 copy of the drive if it won't mount? Carbon Copy and Superduper aren't showing the disk.


The drive is a Seagate 1TB Model SRD0NF1.




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can not access or mount external encrypted APFS disk

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.