Raspberry Pi

How to Enable Support for HFS on the Raspberry Pi

Like NTFS and exFAT, the HFS is also a file system whose abbreviation stands for the “Hierarchical File System” and is used to read/write and transfer files from the storage devices like USB and CD ROMs to the Apple computers having the older version of macOS.

When the storage devices having HFS filesystem format are attached to the Raspberry Pi operating system, the OS is unable to read the data stored in the storage device, so to read data from HFS storage devices, we have to enable support of HFS on Raspberry Pi, whose method has been discussed in this guide.

How to enable support for HFS on the Raspberry Pi operating system

To enable the support of HFS on Raspberry Pi OS, we will install some packages of HFS and their dependencies from the default repository of Raspberry Pi OS using the apt package manager:

$ sudo apt install hfsplus hfsutils hfsprogs gdisk -y

When the packages are installed on HFS using the above command, by default the support is enabled on HFS on Raspberry Pi and the storage devices of HFS format can be readable by Raspberry Pi OS.

How to mount the HFS storage device manually on Raspberry Pi

If the Raspberry Pi does not mount the HFS-based storage devices automatically, then there is no need to be worried, we will discuss another manual method to mount such devices on the Raspberry Pi. First, we will make a directory with the name of hfsplus so that all the data of the HFS storage device is stored in this newly created directory:

$ sudo mkdir /media/hfsplus

Now we will list down all the attached devices using the command mentioned-below:

$ sudo fdisk -l

The name of the device will be like sdb1 (you can find the name either by its name or size), here we are using the “<device-name>” instead of the exact name, so in the next command, replace the <device-name> with your device name:

$ sudo mount -t hfsplus /dev/<device-name> /media/hfsplus

How to format the HFS storage device on Raspberry Pi

To erase all the data from the HFS based storage device, run the command by replacing the “<device-name>” with your storage device name:

$ mkfs.hfsplus /dev/<device-name>

Conclusion

HFS is a file system that was used in the older versions of macOS before the OS X was released, but now the Apple devices also do not support this format. If you have storage devices of the HFS file system and you want to connect it with Raspberry Pi to read data, then you have to enable its support which has been discussed in this guide in detail.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.