Read HFS filesystem on FreeBSD

Looking at the picture below from BSDCan 2008 FreeBSD Developer Summithttps://people.freebsd.org/~bz/200805DevSummit/ – You may get impression that FreeBSD developers does not use FreeBSD on their desktops and/or laptops, which was often true in 2008. Ten years later this seem to have changed and more FreeBSD developers use FreeBSD. At least more then in 2008 πŸ˜‰

BSDCan-2008-FreeBSD-Developer-Summit

For those ones that still use Mac OS X on their desktops/laptops instead of FreeBSD there is now possibility to mount HFS+ filesystem volumes under FreeBSD in read only thanks to FUSE subsystem. The project that allows this – FUSE driver for HFS+ filesystemshttps://github.com/0x09/hfsfuse – states that its “Created for use on FreeBSD which lacks a native driver (…)”.

Thanks to Tobias Kortkamp this driver is now available in the FreeBSD Ports tree as sysutils/fusefs-hfsfuse port.

The installation is simple:

# pkg install fusefs-hfsfuse

My buddy that uses Mac OS X created a new HFS+ volume for me and put a file on it, lets mount it for a test.

# gpart show da0
=>      34  15356093  da0  GPT  (7.3G)
        34         6       - free -  (3.0K)
        40    409600    1  efi  (200M)
    409640  14684336    2  apple-hfs  (7.0G)
  15093976    262151       - free -  (128M)

Lets verify that with file(1) command.

# file -s /dev/da0p2
/dev/da0p2: Macintosh HFS Extended version 4 data last mounted by: 'HFSJ', created: Wed Mar 14 16:59:41 2018, last modified: Wed Mar 14 15:00:44 2018, last checked: Wed Mar 14 14:59:41 2018, block size: 4096, number of blocks: 1835542, free blocks: 1827692

Yep, that’s the one, lets mount it.

# /usr/local/bin/hfsfuse --force -o noatime /dev/da0p2 /mnt

# mount
sys/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
/dev/fuse on /mnt (fusefs.hfs, local, noatime, read-only, synchronous)

Now lets try to list and access its contents.

# ls /mnt
new-document.pdf
# cp /mnt/new-document.pdf ~
# echo $?
0
# ls ~/new-document.pdf
new-document.pdf
# mupdf new-document.pdf

Everything seems to work flawlessly. If time permits I would update sysutils/automount port to add HFS filesystem support for convenient automount.

EOF

2 thoughts on “Read HFS filesystem on FreeBSD

  1. Pingback: [How-To] Read HFS filesystem on FreeBSD - FreeBSDNews.com

  2. Pingback: Home | vermaden

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s