As I mentioned in a previous post, I tend to make backups of entire disks before destroying them.

In this particular case, I made a 1:1 copy of a partition from an Apple MacBook Pro using dd and wanted to ensure I could access the data before wiping and donating the machine. The image is located at /mnt/server/dd_images/mbp_laptop_sda1.img. Unlike with the ext4 partition I mounted in the my previous post, this isn’t a full disk image, so I won’t need to determine the offset of the partition within the image file. Instead, I can install the latest version of hfsprogs and just mount it directly:

root@debian:/home/todd# apt-get install hfsprogs
apt-get install hfsprogs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 120 not upgraded.
Need to get 133 kB of archives.
After this operation, 324 kB of additional disk space will be used.
Get:1 squeeze/main hfsprogs amd64 332.25-8 [133 kB]
Fetched 133 kB in 0s (268 kB/s)  
Selecting previously deselected package hfsprogs.
(Reading database ... 132092 files and directories currently installed.)
Unpacking hfsprogs (from .../hfsprogs_332.25-8_amd64.deb) ...
Processing triggers for man-db ...
Setting up hfsprogs (332.25-8) ...

Next, mount the partition read-only, and you should be good to go:

root@debian:/home/todd# root@debian:/home/todd# mount -t hfsplus -o loop,ro /mnt/server/dd_images/mbp_laptop_sda1.img /mnt/hfsplus_partition/

Once you’ve got your partition mounted, you can access it just as you would normally access any other filesystem.

Comments are closed.