How to access/view MacOS files from Ubuntu 18.04?

9,733

Before I begin, it may be best to take your MacBook Air to an Apple Store if you have Apple Care and it's still in effect.

If your MacBook Pro was running 10.11 or earlier and is using hfs+ then Ubuntu can read hfs+ by default but you may need a bit more in your case. Make sure that you have somewhere to mount the MacBook Air disk.

apt-get install hfsprogs

That will allow you write and repair the MacBook Air disk.

sudo fsck.hfsplus -f /dev/sdXY

That will repair the disk if needed.

sudo mount -t hfsplus -o force,rw /dev/MacBookAir drive /the/mountpoint

Finally, that will mount it with read/write permissions in case you need them.

If your MacBook Air was running High Sierra and using APFS then the only way to read it is to compile apfs-fuse from Github. The instructions are in the link but I'll post the necessary steps here in case the link changes.

https://github.com/sgan81/apfs-fuse

First you'll need have or apt-get install the following packages:

git gcc gcc-c++ gcc-dev libfuse-dev libattr1-dev icu-devtools libicu-dev libicu52 cmake

Next:

cd /opt
mkdir aptfuse
cd aptfuse
mkdir src 1.0
cd src

Clone the software:

git clone https://github.com/sgan81/apfs-fuse.git

cd into the apfs-fuse directory that was just created containing the source code and run the following commands to register Apple's lzfse library which is included in the source code as a submodule.

git submodule init
git submodule update

cd ../../1.0
cmake ../src/apfs-fuse
make

Afterwards, add the /opt/apfsfuse/1.0/bin directory to your path and start a new session:

export PATH=$PATH:/opt/apfsfuse/1.0/bin
bash

To mount your MacBook Air drive:

apfs-fuse /dev/MacBookAirDrive /your/mountpoint

I successfully built this myself with my Debian VM (I haven't gotten around to installing a Ubuntu VM). The instructions on the Github page for creating the repos is different but I cleaned up the structure here a bit. Keep in mind that this software isn't anything official and hasn't worked perfectly for everyone. Again, it may be better to take it to an Apple Store if you've got Apple Care.

Share:
9,733

Related videos on Youtube

arieljannai
Author by

arieljannai

Updated on September 18, 2022

Comments

  • arieljannai
    arieljannai over 1 year

    A few days ago my Macbook Air's disk partitions messed up or something and from what I've gathered off the internet, it seems that the boot.efi file cannot be found.
    Thankfully I have a PC and could download Ubuntu 18.04 onto a flash drive and boot from that, and do the "Try Ubuntu" option.

    In the Disks application I can see my 121 GB APPLE SSD and I would like to view/make copies of my important files (i.e. photos, documents, and videos) and either upload them to my PC via the internet or move them to an external Hard drive or Flash drive and transfer them to my PC (I have a 128GB flash drive and a 2TB Seagate hard drive).

    • Spiff
      Spiff almost 6 years
      What model (especially model-year) of MacBook Air are you running? What version of macOS was it running before the problem? Both of these pieces of basic info may be critical to getting you a good answer to your question.
  • Spiff
    Spiff almost 6 years
    These instructions would have been useful before late 2017 when macOS 10.13.x High Sierra came out (free!) and almost everyone who installed it got migrated to APFS automatically. If OP is running High Sierra on his MBA, these instructions won't help.
  • Nasir Riley
    Nasir Riley almost 6 years
    The questioner didn't specify which OS his MacBook is running so we can't be certain unless the question is updated but there is software on Github which can be compiled to read APFS. I'll add that to my answer.