I’ve been using an OS X Leopard (That’s 10.5) machine at work since the last few days for a project that I’m working on. I’ve been a Unix user for a long time so I’m pretty comfortable with the Unix side of OS X including the file system and the BSD underpinnings.
For those who haven’t used OS X, it uses a proprietary file system called HFS+ as the default file system. Because it is a proprietary file system and Apple hasn’t really released any specs for it yet, there aren’t too many utilities to read or write to HFS+ volumes (That’s what Apple calls their partitions) from operating systems other than Apple’s own.
Why would I want to do that ? Well, I normally wouldn’t … but yesterday I was in a hurry to get back home from work and needed to copy some files from the OS X machine so that I could work on them at home. What I forgot in a hurry was that the USB stick that I was using had been formatted as an HFS+ volume. I came home and plugged in the USB stick to my home PC and waited and waited for it to get recognized. Windows recognized the stick but refused to read it. That is when I realized my mistake.
I searched online for tools which would let me get my data off the flash drive and let me work on it from my Windows machine.
HFSExplorer is one such small utility designed to do that.
You can choose to download either the Windows based Installer or the standalone zip file. I chose the zip file, downloaded and extracted the contents to a folder on my PC and plugged in the flash drive that I wanted to read the data from.
When you run hfsexplorer.exe for the first time, you’ll see an empty windows explorer styled two pane window. hfsexplorer displays only HFS/HFS+ volumes (and not your regular windows filesystem) and so you need to first point it to the volumes you want it to read.
Click on File->Load file sytem from device.
I’ve found that HFSExplorer is pretty good at auto detecting HFS volumes and so click on autodetect and when it detects your HFS volume,Click on Load.
That’s it. HFSExplorer will now display a list of all the files on the HFS volume that you selected. You can click on Extract to copy the files from the HFS volume to your local disk.
The only feature missing from HFSExplorer right now is the ability to write to HFS/HFS+ volumes. So, what you see above is basically a read-only view of the file system. If you need write access to your files, though, you’re out of luck here – Atleast if you use Windows.
If you use Linux, on the other hand, things are slightly better.
Most Linux distributions (I use Debian) come with a driver to read (and optionally write to) HFS+ volumes. The driver is called hfsplus and to use it you have to give the following command.
mount –t hfsplus <HFS volume device name> <mount point>
The volume name will be something of the form of /dev/sdb1, sdb2 or something else depending on the configuration of your machine. You can see the exact name on your system by using the fdisk –l command. That’ll show you a list of all the drives connected to your system.
The above mount command will give you only read access to the HFS+ volume. Write access is still experimental but (in my limited tests), I’ve found it to work pretty well. To enable write access, use the mount command with the force option.
mount –t hfsplus –o force <HFS volume device name> <mount point>
That is all there is to read (and write) Mac volumes on Windows and Linux.