Skip to content

HFSProgs Utility

hfsprogs offers tools for Apple's HFS and HFS+ filesystems, such as mkfs.hfsplus for formatting and fsck.hfsplus for checking, aiding Mac-Linux file exchange.

This guide will go over the numerous tools this software suite has to offer, basic and advanced filesystem and recovery options.

Information

hfsprogs is one of the preinstalled packages for our r/Techsupport Rescue Media. If you are using this live image, you can skip the installation section.

How to install hfsprogs

Refer below for installation instructions if you are not using our live image or want to install it on your own system.

Installing hfsprogs

Debian / Ubuntu / Linux Mint:

Terminal window
sudo apt update && sudo apt install hfsprogs

Fedora / RHEL / CentOS / AlmaLinux:

Terminal window
sudo dnf install hfsprogs

Arch / Manjaro / CachyOS: Install from AUR or similar AUR helper.

Terminal window
yay -Syu hfsprogs

The rest of the guide will be going over the different methods and tools available. Note, it is best to have a basic understanding of what stuff like /dev/sdb and /dev/sdb1 represent. A guide to understanding it can be found here.

Basic check:

Terminal window
# Unmount first
sudo umount /dev/sdb2
# Check filesystem
sudo fsck.hfsplus /dev/sdb2
# Force check
sudo fsck.hfsplus -f /dev/sdb2

Automatic repair:

Terminal window
# Answer yes to all repairs
sudo fsck.hfsplus -y /dev/sdb2
# Verbose output
sudo fsck.hfsplus -yfv /dev/sdb2

Advanced repair:

Terminal window
# Rebuild catalog B-tree
sudo fsck.hfsplus -r /dev/sdb2
# Force rebuild of entire filesystem structures
sudo fsck.hfsplus -yf /dev/sdb2

Read-write mount:

Terminal window
# Standard mount
sudo mkdir -p /mnt/mac
sudo mount -t hfsplus /dev/sdb2 /mnt/mac
# Force mount (ignore journal)
sudo mount -t hfsplus -o force,rw /dev/sdb2 /mnt/mac

Read-only mount (safe):

Terminal window
# Mount read-only to prevent changes
sudo mount -t hfsplus -o ro /dev/sdb2 /mnt/mac

Disable Journaling (for better Linux support)

Section titled “Disable Journaling (for better Linux support)”
Terminal window
# Disable HFS+ journal (makes Linux access easier)
sudo mount -t hfsplus -o force /dev/sdb2 /mnt/mac
sudo umount /mnt/mac
sudo hfsplus /dev/sdb2
# Inside hfsplus tool:
> attribute B /dev/sdb2
# Look for kHFSVolumeJournaledBit and unset it
Terminal window
# Format as HFS+
sudo mkfs.hfsplus -v "MacDrive" /dev/sdb2
# With case-sensitive option
sudo mkfs.hfsplus -v "MacDrive" -s /dev/sdb2