Using Ubuntu to access Mac HDD

28,202

Read the drive

So first of all, to be able to read mac drives in Ubuntu you need hfsprogs.

sudo apt-get install hfsprogs

NOTE: if you get an error like E: Unable to locate package hfsprogs then you may need to enable the universe repository - see How do I enable the universe repository?

When this is installed, you should be able to open the drive with the file explorer (nautilus), just by clicking on the drive.

However, in your case, the disk is probably damaged. Ubuntu can try to fix some things, but there is no guarantee this will work, and it is a lot trickyer.

Fix the drive

Run the following command (replacing XY with the correct device) to fix the drive:

sudo fsck.hfsplus -f /dev/sdXY

Replace XY with the correct device. From your error message, I gather it is sda2, although it might be different on your iMac

If this doesn't fix your drive, I think it's hopeless. If the system files are corrupted, that means the drive is dying really fast. It could already be to late...

Share:
28,202

Related videos on Youtube

Sudzy1225
Author by

Sudzy1225

I'm a long time .Win user, recently switched to OSx, and trying to Learn ubuntu, and some minor coding. I'm a Photographer, Drummer, and Id like to believe that I'm a fast learner Don't be afraid to be blunt, I probably need it

Updated on September 18, 2022

Comments

  • Sudzy1225
    Sudzy1225 over 1 year

    Edited

    What i want to Do : Run ubuntu via a DVD-r on an iMac to retrieve data, because a system file has corrupted

    What I've Done: Put the ubuntu disk in my working Macbook Pro to try retrieving data off of it.

    What i did to get the error below: tried to Mount and read my Macbook Pro HDD while running (not installed) ubuntu

    `Error mounting /dev/sda2 at /media/ubuntu/Corbans MBP: Command-line `mount -t "hfsplus" -o "uhelper=udisks2,nodev,nosuid" "/dev/sda2" "/media/ubuntu/Corbans MBP"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so`
    

    I Tried on my Macbook Pro and not the iMac because i have the Pro with me. the iMac is elswhere, and i wanted to experiment with how it would work

    so if there is a way around this, id appreciate any help i can get

    Try to make your answer or fix as simple as possible please =)

    Thanks in Advance

    • Merlijn Sebrechts
      Merlijn Sebrechts over 9 years
      I'm sorry but I really can't understand your question. Could you edit your answer to make some parts clearer? State clearly what you are trying to do. How far you got. When exactly do you get that error. It's also best to put the error in a code block (in the editor, select the text and click on <$>)
    • Idaho06
      Idaho06 over 9 years
    • Sudzy1225
      Sudzy1225 over 9 years
      Edited, let me know if i need to explain anything further, and ill gladly try my best to do so. sorry for any confusion.
    • Merlijn Sebrechts
      Merlijn Sebrechts over 9 years
      Thanks, much better now! I'll try to give an easy solution
  • Sudzy1225
    Sudzy1225 over 9 years
    ok, when i put in the first command, i get : 'Reading package lists... Done Building dependancy tree Reading state information... Done E: Unable to locate package hfsprogs'
  • steeldriver
    steeldriver over 9 years
    @Sudzy1225 what version is the Ubuntu disk that you are using?
  • steeldriver
    steeldriver over 9 years
    @Galgalesh I think it may be necessary to enable the universe repository in order to get hfsprogs (so it might be easier via Software Center / Synaptic)
  • Merlijn Sebrechts
    Merlijn Sebrechts over 9 years
    @steeldriver feel free to edit my answer, otherwise I will change it tomorrow.
  • steeldriver
    steeldriver over 9 years
    @Galgalesh thanks, I have added a note with a link to instructions for enabling the repository
  • Sudzy1225
    Sudzy1225 over 9 years
    @steeldriver Im running 14.04.1
  • steeldriver
    steeldriver over 9 years
    @Sudzy1225 OK that's good - just checking you weren't trying to install the package from an unmaintained repo. Did the updated instructions (enabling the universe repository) help?
  • Sudzy1225
    Sudzy1225 over 9 years
    @steeldriver I got the repositories downloaded and updated, but I'm getting the same error still when i try to open the Macbooks hard drive
  • Sudzy1225
    Sudzy1225 over 9 years
    Error mounting /dev/sda2 at /media/ubuntu/The OSx Brain: Command-line `mount -t "hfsplus" -o "uhelper=udisks2,nodev,nosuid" "/dev/sda2" "/media/ubuntu/The OSx Brain"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
  • Sudzy1225
    Sudzy1225 over 9 years
    @steeldriver I Did. I think i ran 3 commands total. 1 was the repository command, 2 was the update repository command, and then 3, the "hfsprogs" command. All of which went threw without issue, or error. But i still cant access the internal HDD
  • steeldriver
    steeldriver over 9 years
    @Sudzy1225 TBH I'm not sure exactly which hfs package contains the mount commands: in the absence of @Galgalesh I can only suggest trying sudo apt-get install hfsplus as well
  • rcruz
    rcruz over 3 years
    You can download and install the HFSprogs .dev package directly from the site: packages.ubuntu.com/search?keywords=hfsprogs