TL;DR if your Mac hard drive won't mount and Disk Utility can't fix it, grab a PC and boot it into Parted Magic from the Ultimate Boot CD (UBCD). Attach the problem drive and try to mount it using the drive icon in the bottom left corner of the desktop. If it does, copy the files onto a different drive. There. Done.
File system check exit code is 8.
Don't Trust Hard Drives
That's the title of the article I wanted to write but here it's just a heading.
Although there is a massive list of potential failures that a hard drive is prone to, developing an error that results in the data being there but inaccessible is one of the least fatal, but most frustrating, problems. This article deals specifically with problems on Mac OS X, but also applies to other operating systems and can be adapted quite easily.
When you attach a storage device to a computer, the operating system takes a look at the file system in use. If it's recognised, the file system will be 'mounted' by the OS and you will be able to interact with the file system. Ideally you would have read & write access to the drive but in some cases you will have read-only access i.e. you can open and copy files, but you can't make any changes to the files. For example, Windows does not recognise Mac drives at all without installing additional (non-free) software. Windows drives, however, can be at least read on Macs. This depends on what file systems are in use. For Windows it's usually NTFS and for Mac it's usually HFS+ because these are their 'native' file systems, but there are many others available just to make things more complicated for you: FAT, FAT32, NTFS, APFS, HFS, HFS+, EXT, VFS, XFS, NFS, exFAT, ReFS, JFS, WBFS are just some of them.
Some drives have multiple 'partitions' on them and each can have a different file system. If you've ever installed a USB loader on a Wii console, you might have a drive with a FAT partition and a WBFS partition. Without extra software, you'll usually only be able to see the FAT partition.
Anyway, if you insert a disk with an unrecognised file system, you'll usually get a message explaining this. Most of the time you will simple be asked if you want to format the disk. Unless you've just installed a new, blank drive, you don't want to do this. You might even think that 'formatting' the drive will mean you can access the drive. No. Be cautious at all times because...
You are only ever one click away from losing your data!
Explaining all of the pitfalls involved requires me to write the whole other article I'm not currently writing. Trust me though, I'm an expert because I've made all the mistakes at some point in the past. Luckily I've also recovered from nearly all of them. Think of fire: it's pretty dangerous and it's very easy to start one. It takes a lot more effort to put one out, unless you have all the necessary safety equipment to hand. Think the same when it comes to data: easy to destroy, much harder to recover.
Mounting (Or Not)
So it's normal for an operating system to not mount a partition that's unsupported, but there are occasions where a filesystem that would normally be recognised becomes unrecognisable. This is usually due to the header data on the drive becoming corrupted in some way. If the metadata (data about the data) cannot be found, this results in an error state. You won't normally get a message telling you this though - all that will happen is that, when you plug the drive in, it doesn't show up.
This happened with me recently. I don't know what specifically caused the problem with this drive, but it was behaving weirdly before anyway. SMART data for the drive also indicated it was failing, so that's nice.
Background is that I have a MacBook Pro with a 256GB SSD as its internal drive (an upgrade I installed after the performance of the original drive tanked - featured in this video on YouTube). This doesn't leave me with much space left for data storage, so I've been using a 1TB external hard drive in a caddy connected via USB. One day it unplugged by accident while it was rendering a video and didn't mount when I plugged it back in. The first thing to do on a Mac when this happens is to open the Disk Utility that comes with Mac OS.
On the left you can see the list of physical drives attached to the computer.
- The Samsung at the top is the SSD, with partitions for the system and data within it. This is labelled as 'internal' so that the user knows what is what. Labelling your various partitions is important in this regard as it saves a bunch of confusion and avoids potentially embarrassing mistakes, too.
- The 'Mass Storage Device' is a hard drive that's connected externally and has a 'Restore' partition in it, which is mounted so I can access it from the Finder.
- The last drive shows a 'Time Machine' partition, but it's greyed out. This means it's not mounted. This is the problem drive.
At this point the first thing to try is to select the problem partition and then click the First Aid button.
More often than not, this process will fix the problem. In this instance it did not. If it doesn't, this usually implies a deeper problem with the drive. If the file system is having issues then you need to get the files off, as getting them fixed usually requires reformatting the drive. The specific errors I got were:
File system check exit code is 8.
File system verify or repair failed. : (-69845)
The first message is a general status thing meaning that the file system could not be checked and is corrupted somehow. The second error is amusing because, if you type it verbatim into Google with the minus sign attached, you're telling it NOT to include 69845, so search without minus signs unless you want to exclude it. You may have read elsewhere that booting into single user mode and running FSCK (Unix 'File System Check' utility) manually can fix it, but macOS Catalina won't let you do that. You could try it on another Mac with an older OS because external volumes in macOS and OS X tend to be HFS+, which has been supported in OS X forever. But let's say that didn't work. If you happen to own one of the (not free) file recovery tools available for Mac OS such as Disk Drill, DiskWarrior, Stellar, Data Rescue or TechTool Pro, then you're in luck. Paying upwards of $80 for such a piece of software, however, is a bit of a risk, especially if it doesn't even work in the end - these apps have a specific 'no refunds' policy for that reason.
The Ultimate Boot CD
Instead there are a number of free tools we can use but for this specific problem we're interested in Parted Magic in particular. This is an operating system in itself. More specifically it's a version of Linux which is designed with data recovery and diagnosis in mind. It's jam-packed with every free and open-source tool out there and it's really, really useful. It doesn't run on a Mac, however, so you're going to need a PC and if you on't own one it's time to call on one of your not-so-cool friends and hopefully you're on good terms with them. Although the latest version of Parted Magic itself costs (not very much) money, the free version included with the Ultimate Boot CD works just as well for most purposes. You're going to need to download it, install it on a USB thumb drive (or CD if you're into pain and time wasting), and boot your computer with it.
There are many other sources of information out there telling you how this is done so I'm not going there. Here's the link to the UBCD website. Come back when you're ready to boot a PC with it.
I used a PC laptop to run the UBCD. I also removed the internal hard drive from said laptop and replaced it with the drive I'm having problems with because a) it eliminates the risk of me messing up anything on the PC laptop and b) it means the problem drive is hooked up directly to the SATA bus, which is quicker than USB in most cases. You're also going to need a spare hard drive of the same or larger capacity for recovering any data onto. I attached this via a USB caddy but, if you're using a desktop PC, this can also be attached internally.
Some PCs are fussy about UBCD and I've had situations where it just won't boot. All you can really do in this situation is to try another PC. Sorry.
Once you're on the desktop, click on the drive icon which is second from the bottom-left. This will open a window showing physical drives and their mountable file systems. Yes, Linux can mount Mac partitions. Even better, it can mount them with read and write access. In this specific case, /dev/sda3 is the internal drive and this is indicated by the icon on the left. It's the only internal drive on this computer so I know it's the right one.
Make things as simple for yourself as possible when working with multiple drives.
You also want to mount the drive you're recovering to. I had already purchased a nearly identical drive to replace the problem one because I think it's got a mechanical issue, too. I also partitioned it on my Mac laptop before plugging it into the PC.
Now open the File Manager from the desktop and you will see your mounted partitions on the left. Choose 'New Window' from the 'File' menu to give you two side-by-side and then it's a simple case of drag-and-drop.
I couldn't quite believe it was this simple but, if it's a file system error rather than a mechanical or electrical error then this could save you a bunch of time and a bunch of money. For other more complicated problems, there's another article in the works.
I hope this helps.