How to repair APFS container and recover lost data from APFS disk?

Posted by Molly to Mac Data Recovery on August 29th, 2018

I have an APFS container that won't mount or repair. In Disk Utility I have the external drive (disk3) with the "APFS Physical Store" unmounted below. (disk3s2). I then have a mystery drive listed "AppleAPFSMedia" (uninitialized) which lists as (disk4). Running "diskutil apfs list" in Terminal turns up the following which is listing disk3s2 under disk4. Any thoughts on how to repair this APFS container error?

APFS container allows all the volumes in the container (or partition) to share space, which largely improves the efficiency of file storage. Meanwhile, as a new file system, people are also complaining the lack of documentations to repair APFS container related problems, such as AppleAPFSMedia uninitialized, APFS "fsroot tree is invalid", "container superblock is invalid", etc. This article show you methods to repair APFS container errors on Mac without losing data.

How to repair APFS container?

Method 1: Repair APFS container with Disk Utility.

Disk Utility is designed to verify and repair disk or file system problems. So you can try to repair APFS containers with First Aid in Disk Utility.

Step 1: Go to Disk Utility.

Step 2: Select the APFS container you want to repair.

Step 3: Click First Aid on the top.

Wait till the APFS container reparation finishes.

Method 2: Repair APFS container error by formatting/erasing.

If Disk Utility can't repair APFS container/partition, this should be your final choice. As repair corrupted APFS container by formatting or erasing will remove all the data in it, please make sure you have a backup of the files. If unfortunately you haven't made backups, you need to firstly recover lost data from APFS container with APFS data recovery software.

iBoysoft Mac Data Recovery is professional data recovery software that supports APFS and encrypted APFS file systems. It's able to solve various APFS container or APFS volume related problems and recover lost data. For example, it recovers data from corrupted APFS partition, recovers lost data after deleting APFS container, recovers data from encrypted APFS external hard drives, USB drives, SD cards, memory cards, Pen drives and other external storage devices on macOS 10.15 Catalina, 10.14 Mojave and 10.13 High Sierra.

How to recover lost data and repair APFS container?

Step 1: Recover lost data from APFS container.

1. Download and install iBoysoft Mac Data Recovery on your Mac.

2. Launch iBoysoft Mac Data Recovery, and select the APFS container that you want to recover lost data from.

Recover lost data from APFS container with iBoysoft Mac Data Recovery

3. Click "Next" to scan for the lost data.

4. Preview the scanning results, choose files you want to get back and click "Recover" button to recover those lost data from the APFS container.

Step 2: Repair APFS container by formatting/erasing.

1. Go to Utilities > Disk Utility.

2. Select APFS container from the sidebar.

3. Click Erase on the top of the window and follow the instructions to finish the formatting process.

After repairing APFS container by formatting, you can copy back the files to the disk without error.

Still have questions?