3

I've a dual-boot OSx 10.11.4 El Capitan and Ubuntu 17.04 machine. Ubuntu can't mount or read the HFS+ partition, which was changed to Apple Core Storage in an upgrade from a previous version of the OSx.

I tried the method proposed elsewhere; use TestDisk to calculate the size of the partition and then mount with that sizelimit:

sudo mount /dev/sda2 -t hfsplus -o ro,sizelimit=99349995520 /media/john/Macintosh\ HD/

But that didn't work.

TestDisk's output looks confused:

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org

Disk /dev/sda2 - 99 GB / 92 GiB - CHS 12078 255 63

The harddisk (99 GB / 92 GiB) seems too small! (< 197 GB / 184 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partitions can't be recovered:
     Partition               Start        End    Size in sectors

   Mac HFS                 32506717  225824604  193317888
   Mac HFS                 32509088  225826975  193317888
   Mac HFS                 32509450  225827337  193317888
   Mac HFS                 37794538  231112425  193317888
   Mac HFS                 37795008  231112895  193317888
   Mac HFS                 47884256  241202143  193317888
   Mac HFS                 66287730  259605617  193317888
   Mac HFS                 66290352  259608239  193317888
   Mac HFS                193317884  386635771  193317888


[ Continue ]
HFS+ blocksize=4096, 98 GB / 92 GiB

Then a long list of partitions, when there should be only one:

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org

Disk /dev/sda2 - 99 GB / 92 GiB - CHS 12078 255 63
     Partition               Start        End    Size in sectors
 P Mac HFS                  3068371    3523578     455208
 P Mac HFS                  3532137    3919232     387096
 P Mac HFS                 19672082   20135673     463592
 P Mac HFS                 35261920   35266959       5040
 P Mac HFS                 35722612   35727651       5040
 P MS Data                 38833644   38838315       4672 [NO NAME]
 P MS Data                 54286448   54291119       4672 [NO NAME]
 P Mac HFS                 57141877   57606636     464760
 P MS Data                 70557232   70561775       4544 [NO NAME]
 P MS Data                 75463104   75467647       4544 [NO NAME]
 P MS Data                 81491476   81496019       4544 [NO NAME]
 P MS Data                 81822352   81827023       4672 [NO NAME]
 P MS Data                 82479724   82484395       4672 [NO NAME]
 P MS Data                 88272720   88277263       4544 [NO NAME]
 P Mac HFS                126793108  127257883     464776
 P Mac HFS                160057997  160603188     545192
 P Mac HFS                170316910  170862261     545352
 P MS Data                191392340  191396883       4544 [NO NAME]

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
                P=Primary  D=Deleted
Keys A: add partition, L: load backup, T: change type,
     Enter: to continue
HFS+ blocksize=4096, 233 MB / 222 MiB

I tried calculating the beginning to end sectors with actual sector size 4096 bytes, but that suggested a size which is much too large. 512 bytes is about the right size but didn't work:

$ dmesg | tail
[ 5166.088902] hfsplus: unable to find HFS+ superblock
[ 5268.134439] hfsplus: invalid secondary volume header
[ 5268.134441] hfsplus: unable to find HFS+ superblock
[ 6464.570205] testdisk: sending ioctl 30d to a partition!
[ 6464.570208] testdisk: sending ioctl 2285 to a partition!
[ 6464.570224] testdisk: sending ioctl 31f to a partition!
[ 6464.570225] testdisk: sending ioctl 31f to a partition!
[ 7845.081895] perf: interrupt took too long (3939 > 3925), lowering kernel.perf_event_max_sample_rate to 50750
[ 9071.727354] hfsplus: invalid secondary volume header
[ 9071.727355] hfsplus: unable to find HFS+ superblock

How can I calculate the correct maximum size of the partition? Or is there a direct way to mount it?

6
  • It sounds like you’re trying to mount a Core Storage partition as if it’s HFS+, which it isn’t. I doubt Ubuntu supports macOS Core Storage format, so it won’t be able to mount it. Your previous HFS+ partition is now a virtual partition inside a Core Storage container. It is no longer guaranteed to be a contiguous range of blocks on disk. You need Core Storage-aware software to mount it.
    – Spiff
    Commented Aug 8, 2017 at 7:39
  • Do you know of any such Linux-compatible software? I found one project but it required the same maximum size measurement. In any case my storage is all contiguous.
    – user173283
    Commented Aug 8, 2017 at 8:46
  • I booted into OSx and ran
    – user173283
    Commented Aug 8, 2017 at 23:12
  • I booted into OSx and ran [code]diskutil cs list[/code] which returned 98978758656 as the size of the core storage logical volume. This is the 193317888 repeated by TestDisk 'can't be recovered' multiplied by 512. Using this figure as the sizelimit, the partition mounted: [code]sudo mount /dev/sda2 -t hfsplus -o ro,sizelimit=98978758656 /media/john/Macintosh\ HD/[/code]
    – user173283
    Commented Aug 8, 2017 at 23:27
  • It's probably best to post that last comment as a real Answer, and then click the checkmark outline next to your Answer so the system shows this question as having been resolved.
    – Spiff
    Commented Aug 8, 2017 at 23:36

0

You must log in to answer this question.

Browse other questions tagged .