It's likely that the HFS volume is not mounting because the HFS partition is wrapped in a CoreStorage volume (the default since OS X 10.10). You can verify if this is the case with the output of fdisk -l
:
HFS+ uses two volume headers, one 1024 into the device and the secondary 1024 from the end of the device. Per the spec, when mounting a partition the secondary header is expected to be to be exactly 1024 bytes from the partition's end, but with CoreStorage wrapping the HFS volume that's no longer the case so it aborts. You can pass -o sizelimit=N
to mount
to manually specify the HFS volume size and fix this, but how does one get the magic value for N
?
The testdisk
utility can scan for partitions, hinting at where the HFS partition really ends. Be wary - selecting the wrong options in testdisk can damage your partition table!
- Launch TestDisk with
testdisk /dev/sdX
, and thenOK
to select the drive - Select
Intel
for MBR orEFI GPT
for GPT formatted drives - Press
Analyse
and thenQuick Search
After a few moments it should print it the partitions found:
The partition indicated looks awfully close to (but slightly smaller) than the real partition size of 623463232 sectors reported by
fdisk -l
earlier.Because the TestDisk output uses sectors, we'll need to multiply it by the drive's logical sector size (typically 512 or 4096 bytes) to get the HFS volume size in bytes. That's the value for
N
we'll use for-o sizelimit=N
when mounting the HFS volume.If you don't know your drive's logical sector size, check the output of the
secondfirst number reported byfdisk -l
on the line shown below:Press
q
several times to exit the program- Mount the disk:
mount /dev/sdXn -t hfsplus -o ro,sizelimit=N