7

My Macbook (Snow Leopard OS) was giving me the rainbow wheel of death so I tried booting into safe mode and repairing the disk, with no luck. So I decided to pull the drive out and plug it into my Ubuntu 12.04 desktop with a SATA to USB cable to recover some data before reinstalling the OS. I'm having a lot of trouble trying to mount the drive. I have installed hfsplus hfsprogs and hfsutils and run the following command.

sudo mount -t hfsplus /dev/sdd1 /mnt/"AppleMount"

Which gives me this error.

wrong fs type, bad option, bad superblock on /dev/sdd1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail  or so

Running dmesg tells me this.

[39666.815423] end_request: critical target error, dev sdd, sector 536
[39666.815429] Buffer I/O error on device sdd1, logical block 62
[39670.526393] sd 6:0:0:0: [sdd] Unhandled sense code
[39670.526397] sd 6:0:0:0: [sdd]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE
[39670.526402] sd 6:0:0:0: [sdd]  Sense Key : Medium Error [current]
[39670.526407] sd 6:0:0:0: [sdd]  Add. Sense: Unrecovered read error
[39670.526412] sd 6:0:0:0: [sdd] CDB: Read(10): 28 00 00 00 02 18 00 00 08 00
[39670.526422] end_request: critical target error, dev sdd, sector 536
[39670.526427] Buffer I/O error on device sdd1, logical block 62
[39763.562415] hfs: unable to find HFS+ superblock

So I think I'm stuck at this point. Can anyone guide me in the right direction? Thank you!

Thomas
  • 6,223
phandolin
  • 451
  • 1
  • 5
  • 12
  • According to this post partition is either not formatted or formatted from a recent OSX version with options currently unknown to the hfs+ driver.So unluckily you need to run OSX disk utility . – g_p Feb 21 '14 at 03:19
  • 1
    Medium error = dead drive. Or at least somewhat damaged. Check the SMART health status in the disk utility. – psusi Feb 21 '14 at 04:31
  • Yes @psusi, dead drive it was. The good news to come out of this is that I ditched Apple and have been full on ubuntu ever since. – phandolin Nov 05 '16 at 14:28

5 Answers5

6

just for the records, here is the way I found to mount a Mac disk image created with dd.

1) Get the start and sector size

fdisk -l /path/to/image.dd

You get X for start and Y for size.

2) mount the partition

mount -t hfsplus -o ro,offset=$((512*X)),sizelimit=$((512*Y)) /path/to/image.dd /mnt/macMount

It's a mix of solution that I found. Hope this would help someone.

Ralph
  • 61
  • 1
  • 2
2

I had the same issue after duplicating an HFS+ partition so I though I might share my solution.

I solved it by running a Disk repair from Mac Os Disk Utility application. You can run it from a Macos install or the Recovery DVD.

bpavot
  • 21
  • ah, so the partition is damaged somehow. that makes sense. it would sure be nice if there was a way to do the repair within linux, esp. if the original mac is dead. – stochastic Jan 02 '16 at 20:32
2

Not a direct solution, but if you have destroyed HFS+ partition you may want to take a look at hfs+rescue. It would allow you to get the files even with broken partition. It even works nicely on ubuntu!

Unlike photorec it also provides filenames and directory structure.

neutrinus
  • 211
1

Can't mount HFS+ drive, bad superblock?

More frequent than not, this error means you are trying to mount the whole drive rather than just the HFS+ partition.

Run this command to show you which partition you should mount:

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

example output: sda

├─sda1 vfat 300M EFI
|
└─sda2 hfsplus 100G VolumeName

So don't mount sda, but mount sda2 in that example.

If you are looking at how to write to an HFS+ partition, I have a guide posted here:

Guide

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
0

For reference, something that didn't work.

(I'm on Ubuntu 14.04.3)

If I open the disk with sudo gparted, I get this message:

The journal is not empty.  Parted must replay the transactions before opening the file system.  This will modify the file system.

I can cancel or fix. I clicked fix, and then tried mounting by specifying the start point and size:

mount -v -t hfsplus -o ro,offset=,sizelimit= /dev/sdd2 /media/macdrive