Recovering a disk with “The disk you attached was not readable by this computer” on Mac
My scenario: Old Synology NAS drive with photos and history on it. Purchased new external SSD, hooked it up to the NAS as a mounted drive and then moved (not copied) all files to the external SSD. Checked the files were there, I could open them. Great! So easy! Then I format the NAS drive. Later I plugin the external SSD in to my Mac (MacBook M2), and… DISASTER…
The disk you attached was not readable by this computer.
What. The. Hell. OK, try not to panic, it’s not like this disk holds the only copy of 40-odd years of memories of my life…
How I recovered my data
Important data points:
- I am using a MacBook M2 Silicon or whatever they call it.
- My NAS wrote the files as Linux format
- The data on the SSD exceeded the size of my computer disk drive size.
Because of 3) I first had to purchase another disk drive – I just bought the same drive again (Sandisk Extreme Pro 2TB). Once that arrived, I tried to recover the data.
Warning: This is not easy if you are not technical as there are a few steps in this process which could confuse a basic computer user. If you get stuck, try to find someone to help you, otherwise this is a potential wormhole of steps to deal with.
Prepare
- Open your Terminal app and get that ready.
- Confirm you have Homebrew installed. Run
brew -vto see if you have it or not. If you dont have it, install it. - Have your MacBook login password available.
- You have plugged in your broken disk (Disk A) and pressed “Ignore” on the pop-up.
- Your new disk is ready to be plugged in or you have space on your Mac disk drive (Disk B). Do not plug it in yet.
Now let’s make some directories on your Mac. Using Terminal, run the following:
cd ~/– this will take you to your users directorymkdir ~/restoration– this will create a directory called restoration where we will keep some filesmkdir ~/ext4_mount– this will create a directory that will use later to mount Disk Acd ~/restoration– this will take you to the restoration directory
Let’s recover your data
From the restoration directory, install macos-fuse-t using Homebrew by running the following:
brew install macos-fuse-t/homebrew-cask/fuse-t
When you run this command you will be prompted for your password – enter your MacBook login password. It needs this to install a kernel extension.
Now run:
git clone https://github.com/macos-fuse-t/ext4fuse.git && cd "$(basename "$_" .git)"
then run this command:
make
Some information should be printed to the screen – but no errors or success messages. At this point I thought it was going wrong, but stick with it.
Now we need to identify your Disk A. Run this command to list all drives:
diskutil list
This should list all your disks. You are looking for Disk A that should be called something like external or physical.
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1
2: Apple_APFS Container disk3 994.7 GB disk0s2
3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3
/dev/disk8 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *2.0 TB disk8
1: Linux 2.0 TB disk8s1
For my computer, the disk is the last one. /dev/disk8 and the partition is called disk8s1 – so you need to remember or write down somewhere this name – the path and the partition name. So for me, I need to use /dev/disk8s1. For you it might be slightly different.
Now we are going to mount that Disk A to the directory we created earlier:
sudo ./ext4fuse /dev/disk8s1 ~/ext4_mount -o allow_other
Lets break this command down:
sudo lets you run with the highest permissions on your system. ./ext4fuse is the program we just compiled with the make command. /dev/disk8s1 is the partition on the external drive we want to see. ~/ext4_mount is the directory we setup earlier. -o allow_other are some flags to help mount it.
At this point, you may be asked for your logic password again and your Mac may pop-up some messages that you want to allow, or follow the prompts to allow. For example:
I had to restart my Mac at this point to change permission. Depending on your setup, you may not have to.
If you do restart, type the following to get yourself back to where you were in Terminal:
cd ~/restoration/ext4fuse
and then run the mount again:
sudo ./ext4fuse /dev/disk8s1 ~/ext4_mount -o allow_other
Can you see your files?
Disk A should now be “mounted” on the directory you setup earlier.
You can run this command to see if you can see the files:
ls ~/ext4_mount
or open Finder on your Mac, go to your root home directory (normally your name) and look for the directory called ext4_mount.
If you can see your files, this has worked for you.
Now you just need to copy these to your Disk B, be it another external SSD or your Mac disk drive.
How can I quickly and reliably copy the files?
You can use rsync from Terminal.
Plugin in your Disk B if you have another external disk.
Run:
ls /Volumes
This should list all your drives, you are looking for the name of your new Disk B. In my case it was “Extreme SSD”.
Now you can run the following to do a dry run copy all files from the mounted Disk A to Disk B.
rsync -avh --progress --dry-run ~/ext4_mount/ "/Volumes/Extreme SSD/"
This should complete and let you know if any files had errors. If you are happy with what it found, repeat the line without –dry-run:
rsync -avh --progress ~/ext4_mount/ "/Volumes/Extreme SSD/"
You should see all the file names scrolling past as they copy across.
If you are copying the files to your Mac disk drive, you can run something like this to copy all the drives files and folders to your desktop:
rsync -avh --progress --dry-run ~/ext4_mount/ ~/Desktop/
Unmounting the drive
Once you have finished extracting the files from the drive, you can undo all the steps above:
sudo unmount ~/ext4_mount
brew uninstall macos-fuse-t/homebrew-cask/fuse-t
rm -rf ~/ext4_mount ~/restoration
This will unmount the drive, remove the brew package and delete the mount and restoration files.