Debian – Mounting a multi-partition (GPT/HFS+) USB 2.0 harddrive on Debian

debianfilesystemsgptmount

I have a 3TB USB 2.0 hard-drive which has two HFS+ (Mac) partitions using GUID partition table for the partition records. It was partitioned with macOS Disk Utility. How can I mount these partitions on a Debian system, specifically a Netgear ReadyNAS?

Running

mount -t hfsplus /dev/sda1 /mnt/usbtemp/

reports the following:

*mount: /dev/sda1 is not a valid block device*

Running

fdisk -l

raises the following issue:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Running

parted /dev/sda print

reports the following:

Error: Unable to open /dev/sda – unrecognised disk label.
Information: Don't forget to update /etc/fstab, if necessary.

Is it possible to mount these partitions on my Debian system?

Best Answer

Gnu/Linux is supposed to mount HFS+ automatically, and 'just work'--it even has all the packages pre-installed typically. You may need to install hfsprogs and any other "hfsp..." packages you are missing. I've seen disks like yours plug-n-play into Debian.

The support for hfs+ has reportedly (I will post a link, can't find it at the moment) been troublesome, in the most recent kernels, since around Linux 2.7 times, so the workaround is to use the -t hfsplus and -o [all options needed] for mount. Your kernel is probably already telling you to possibly use the force option, and is explaining that this is risky.

There is a really great explanation of how to do this, in this post, and of course more information is on on the man pages for mount and hfsplus.

This greatly assumes that your disk is not messed up, for example containing data from old installations or being otherwise corrupted.

Since you created the disk on a Mac, be sure also the table is actually GPT, and not an apple partition map or even some type of other table or hybrid-table; user sourcejedi recently pointed this out to me.

If you'd like to post an update, I will gladly follow-up on this answer and/or provide more research if you can post the output of viewing the disk in gparted (or gdisk as mgorven suggested above), as well also post information from dmesg from just after all of the above commands and trying to mount the specific partition /dev/sda1 using the correct offset and sizelimit, as I mentioned.

Related Question