Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rampfox/a7014877cac9e97076d9bef18d11b9dd to your computer and use it in GitHub Desktop.

Select an option

Save rampfox/a7014877cac9e97076d9bef18d11b9dd to your computer and use it in GitHub Desktop.

Revisions

  1. @berkedel berkedel revised this gist Jun 26, 2021. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion mount-hfsplus-in-raspberry-pi.md
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,16 @@ Check the drive with HFS+ filesystem.
    sudo fdisk -l
    ```

    For instance, the HFS+ drive located in `/dev/sda2`. We will mount this to `/media/hfsplus`.
    For instance, the HFS+ drive located in `/dev/sda2`. We will mount this to `/media/hfsplus` as read-only.
    ```sh
    sudo mount -t hfsplus -o noowner /dev/sda2 /media/hfsplus
    ```

    Or, for writable partition you need to run the command below
    ```sh
    sudo mount -t hfsplus -o force,rw /dev/sda2 /media/hfsplus
    ```

    The following steps is optional if you encounter file permission and not able to access particular folders or files.
    We will need `bindfs`
    ```sh
  2. @berkedel berkedel created this gist Jun 26, 2021.
    37 changes: 37 additions & 0 deletions mount-hfsplus-in-raspberry-pi.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    The first thing to do before we access HFS+ drive, ensure our board is running lastest software.
    ```sh
    sudo apt update
    sudo apt upgrade
    ```

    Install all HFS packages we need.
    ```sh
    sudo apt-get install hfsplus hfsutils hfsprogs gdisk
    ```

    Decide your device's mounting path for instance we will use `/media/hfsplus`.
    ```sh
    sudo mkdir /media/hfsplus
    ```

    Check the drive with HFS+ filesystem.
    ```sh
    sudo fdisk -l
    ```

    For instance, the HFS+ drive located in `/dev/sda2`. We will mount this to `/media/hfsplus`.
    ```sh
    sudo mount -t hfsplus -o noowner /dev/sda2 /media/hfsplus
    ```

    The following steps is optional if you encounter file permission and not able to access particular folders or files.
    We will need `bindfs`
    ```sh
    sudo apt install bindfs
    ```

    Now take mounted file system before and provide a view of it with any uid you'd like.
    ```sh
    mkdir ~/anyfolder
    sudo bindfs -u $(id -u) -g $(id -g) /media/hfsplus ~/anyfolder
    ```