Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mount HFS+

746 views
Skip to first unread message

webjay

unread,
Nov 11, 2007, 2:00:15 AM11/11/07
to
How do I mount a hfsplus GUID partition table drive in Debian Etch?
It's a LaCie 500gb USB drive. I can mount and rw on my Mac.

# mount -t hfsplus -r /dev/sda /mnt/usbdisk
mount: wrong fs type, bad option, bad superblock on /dev/sda,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

# dmesg | tail
hfs: unable to find HFS+ superblock

#fdisk -l:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 60802 488386583+ ee EFI GPT


Thanks, Jacob


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Kevin Mark

unread,
Nov 11, 2007, 2:10:07 AM11/11/07
to
On Sat, Nov 10, 2007 at 10:49:00PM -0800, webjay wrote:
> How do I mount a hfsplus GUID partition table drive in Debian Etch?
> It's a LaCie 500gb USB drive. I can mount and rw on my Mac.
>
> # mount -t hfsplus -r /dev/sda /mnt/usbdisk
> mount: wrong fs type, bad option, bad superblock on /dev/sda,
> missing codepage or other error
> In some cases useful info is found in syslog - try
> dmesg | tail or so
>
> # dmesg | tail
> hfs: unable to find HFS+ superblock
>
> #fdisk -l:
> Disk /dev/sda: 500.1 GB, 500107862016 bytes
> 255 heads, 63 sectors/track, 60801 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/sda1 1 60802 488386583+ ee EFI GPT
>
>
IIRC you need to load a kernel modules for HFS+ file system support. Not
sure which one as I've no mac at the moment.
-K
--
| .''`. == Debian GNU/Linux == | my web site: |
| : :' : The Universal |mysite.verizon.net/kevin.mark/|
| `. `' Operating System | go to counter.li.org and |
| `- http://www.debian.org/ | be counted! #238656 |
| my keyserver: subkeys.pgp.net | my NPO: cfsg.org |
|join the new debian-community.org to help Debian! |
|_______ Unless I ask to be CCd, assume I am subscribed _______|

Kelly Harding

unread,
Nov 11, 2007, 2:20:09 AM11/11/07
to
On 11/11/2007, Kevin Mark <kevin...@verizon.net> wrote:
On Sat, Nov 10, 2007 at 10:49:00PM -0800, webjay wrote:
> How do I mount a hfsplus GUID partition table drive in Debian Etch?
> It's a LaCie 500gb USB drive. I can mount and rw on my Mac.

Make sure hfsplus module is loaded with modprobe hfsplus.

It should work, as I mounted my HFS+ drive on Debian.

One gotcha, make sure you disable journalling on the HFS+ partition in OS X if you wish to mount it rw on Linux.

Kelly


webjay

unread,
Nov 11, 2007, 5:50:07 AM11/11/07
to
On Nov 11, 8:20 am, "Kelly Harding" <kelly.hard...@gmail.com> wrote:

I have loaded the kernel module with:
# modprobe hfsplus

I think the problem might be that the partition table is GUID.

Jacob

Davide Mancusi

unread,
Nov 11, 2007, 6:00:11 AM11/11/07
to
webjay ha scritto:

> # mount -t hfsplus -r /dev/sda /mnt/usbdisk
^^^
Shouldn't this be sda1? Just a thought, I do not use
HFS+.

Davide

--
A tautology is a thing which is tautological.
--
Time flies like an arrow. Fruit flies like a banana.

Kevin Mark

unread,
Nov 11, 2007, 6:40:07 AM11/11/07
to
Interesting thing to note. If you keep the journalling, what's the
result? Corruption for both linux and mac r/w attempts?
TIA,

webjay

unread,
Nov 11, 2007, 7:50:08 AM11/11/07
to
On Nov 11, 12:00 pm, Davide Mancusi <are...@gmail.com> wrote:
> webjay ha scritto:> # mount -t hfsplus -r /dev/sda /mnt/usbdisk
>
> ^^^
> Shouldn't this be sda1? Just a thought, I do not use
> HFS+.

No, I tried that with the same result.
I think mount picks the first available.

/Jacob

Sjoerd Hiemstra

unread,
Nov 11, 2007, 11:40:06 AM11/11/07
to
webjay wrote:
> On Nov 11, 12:00 pm, Davide Mancusi <are...@gmail.com> wrote:
> > webjay ha scritto:>
> > # mount -t hfsplus -r /dev/sda /mnt/usbdisk
> >
> > ^^^
> > Shouldn't this be sda1? Just a thought, I do not use HFS+.
>
> No, I tried that with the same result.
> I think mount picks the first available.

Note that Apple partitioning is different from PC partitioning.
When mounting a hfs+ partition, it looks like you have 4 or 10
partitions, only one of them (possibly sda2 or sda4) is usable, all the
others appear to have zero length.

I once saw this in a partitioning program of another distro; in Debian
I haven't found a way yet to make these partitions visible.

Christian Jaeger

unread,
Nov 11, 2007, 12:40:05 PM11/11/07
to
Sjoerd Hiemstra wrote:
> webjay wrote:
>
>> On Nov 11, 12:00 pm, Davide Mancusi <are...@gmail.com> wrote:
>>
>>> webjay ha scritto:>
>>> # mount -t hfsplus -r /dev/sda /mnt/usbdisk
>>>
>>> ^^^
>>> Shouldn't this be sda1? Just a thought, I do not use HFS+.
>>>
>> No, I tried that with the same result.
>> I think mount picks the first available.
>>

No, it doesn't do that (well it never did for me, anyway).

I agree you certainly don't want to mount /dev/sda (without a number
appended).

>
> Note that Apple partitioning is different from PC partitioning.
> When mounting a hfs+ partition, it looks like you have 4 or 10
> partitions, only one of them (possibly sda2 or sda4) is usable, all the
> others appear to have zero length.
>

Well iirc they don't have zero length, but contain stuff like drivers or
so (I'm not sure whether that is just a relict of old pre-OSX MacOS
times, though, so nowadays hey could possibly really be empty).

> I once saw this in a partitioning program of another distro; in Debian
> I haven't found a way yet to make these partitions visible.
>

You just need kernel support (either as module or compiled in). The
kernel configuration variable is CONFIG_MAC_PARTITION (for mac
partitions, anyway), should you compile it yourself.
linux-image-2.6.18-5-486 does have that compiled in already, as can be
seen in /boot/config-2.6.18-5-486

If your /dev is being handled by udev (as is the case for etch), then
you can easily check whether the kernel understands the partition table:
if there's not only a /dev/sda, but also /dev/sda[1-9]* device files
present after attaching the disk, then the kernel understands the
partitioning just fine (you can also check kern.log).

I guess you mean that you haven't found a way to get a partition listing
with sizes. On Debian on Macs, the package "mac-fdisk" is being
installed automatically (at least that was the case with woody) which
provides an "fdisk" program which could handle mac partition tables;
packages.debian.org says that this package is only available for
powerpc; strange, I don't see any reason for this (maybe it has some
endianness bugs? maybe it's just because it provides a binary of the
same name as the x86 "util-linux" package? If it's just the latter, you
could probably recompile the mac-fdisk sources locally (not as .deb) and
use that).

I'd just do an ls /dev/sda?* and then try to mount every shown partition
in turn until you've found the right one.

Christian.

webjay

unread,
Nov 11, 2007, 8:10:05 PM11/11/07
to
The solution was:
# mount -t hfsplus /dev/sda2 /mnt/usbdisk

In /etc/fstab I have:
/dev/sda2 /mnt/usbdisk hfsplus rw,user,noauto 0 0

And to fix some ownership issues I did this:
# chgrp -R users /mnt/usbdisk

Thanks for your help everyone :)

Jacob

Sjoerd Hiemstra

unread,
Nov 12, 2007, 1:50:11 PM11/12/07
to
Webjay wrote:
> Christian Jaeger wrote:

> > Sjoerd Hiemstra wrote:
> > > Note that Apple partitioning is different from PC partitioning.
> > > When mounting a hfs+ partition, it looks like you have 4 or 10
> > > partitions, only one of them (possibly sda2 or sda4) is usable,
> > > all the others appear to have zero length.
> >
> > Well iirc they don't have zero length, but contain stuff like
> > drivers or so (I'm not sure whether that is just a relict of old
> > pre-OSX MacOS times, though, so nowadays hey could possibly really
> > be empty).
> >
> > > I once saw this in a partitioning program of another distro; in
> > > Debian I haven't found a way yet to make these partitions visible.
> >
> > If your /dev is being handled by udev (as is the case for etch),
> > then you can easily check whether the kernel understands the
> > partition table: if there's not only a /dev/sda, but also /dev/sda
> > [1-9]* device files present after attaching the disk, then the
> > kernel understands the partitioning just fine (you can also check
> > kern.log).
> >
> > I guess you mean that you haven't found a way to get a partition
> > listing with sizes.
>
> The solution was:
> # mount -t hfsplus /dev/sda2 /mnt/usbdisk
>
> In /etc/fstab I have:
> /dev/sda2 /mnt/usbdisk hfsplus
> rw,user,noauto 0 0
>
> And to fix some ownership issues I did this:
> # chgrp -R users /mnt/usbdisk
>
> Thanks for your help everyone :)

Yet, let me show things a little clearer.
I used to work with SUSE formerly, and in the Partitioner (part of
YaST, their configuration utility) my HFS+-formatted USB stick shows up
like this:

http://home.kpnplanet.nl/~shi...@kpnplanet.nl/suse_partitioner.png

Note that the USB stick has created sda1 through sda9, and it is
accessible through sda9 !

In Debian I found that gparted can make this visible, have a look at
this screenshot of gparted:

http://home.kpnplanet.nl/~shi...@kpnplanet.nl/gparted.png

The USB stick was partitioned with Mac's Disk Utility, with the option
to install drivers for OS9.
Without this option, only sda1`through sda4 are created, and the USB
drive used to be accessible through sda2.

But the Mac partitioner also offers the option to create a PC
compatible partition table, which is what I usually have. In this case,
only sda1 shows up, as usual.

> > You just need kernel support (either as module or compiled in). The
> > kernel configuration variable is CONFIG_MAC_PARTITION (for mac
> > partitions, anyway), should you compile it yourself.
> > linux-image-2.6.18-5-486 does have that compiled in already, as can
> > be seen in /boot/config-2.6.18-5-486

I just added the line 'hfsplus' to /etc/modules.
In /etc/fstab I have:

/dev/sda1 /media/sda1 auto rw,user,noauto 0 0

That's all what is needed to access the HFS+ drive.

Note that there's also the hfsplus package. Without the need for the
hfsplus module, it has commands such as hmount, hcopy etc., and it can
do mac <--> unix text conversion, and conversion from/to MacBin and
BinHex formats.

0 new messages