# mounting HFS+

## Wizumwalt

I'm trying to save some data from a mac and therefore, would like to somehow mount the drive (it won't boot up) to my gentoo box. I've included HFS+ in my kernel, but I don't know how to find the device to mount. I've connected the mac to my gentoo box via firewire.

Anyone know how to find the device to mount on?Last edited by Wizumwalt on Fri Dec 26, 2008 6:39 am; edited 1 time in total

----------

## NeddySeagoon

Wizumwalt,

It will appear as a SCSI device. As well as HSF+ you will need the mac partition table driver.

Run 

```
ls /dev/sd?
```

now connect the drive and run it again.

If all is well, you will have a new drive.

It will show in the end of dmesg too.

----------

## Wizumwalt

Ok, I think I've got most of my kernel issues cleared up. But now when I run ...

```

# mount -t hfsplus /dev/sdb /mnt/mac

```

... it hangs and I see this in my /var/log/messages output ...

```

Dec 25 21:29:24 Tux ieee1394: sbp2: aborting sbp2 command

Dec 25 21:29:24 Tux sd 4:0:0:0: [sdb] CDB: Read(10): 28 00 00 04 1e 82 00 00 01 00

Dec 25 21:30:28 Tux ieee1394: sbp2: aborting sbp2 command

Dec 25 21:30:28 Tux sd 4:0:0:0: [sdb] CDB: Read(10): 28 00 00 04 1e 82 00 00 01 00

Dec 25 21:30:34 Tux INFO: task mount:5782 blocked for more than 120 seconds.

Dec 25 21:30:34 Tux "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

Dec 25 21:30:34 Tux mount         D ffffffff8059d3a0     0  5782   5481

Dec 25 21:30:34 Tux ffff8100690ad938 0000000000000086 0000000000000000 ffffffff80431334

Dec 25 21:30:34 Tux ffff81007d2f99d0 ffffffff80713480 ffff81007d2f9c08 000000007e4e6fc0

Dec 25 21:30:34 Tux 00000000ffffffff 0000000000000000 0000000000000000 0000000000000000

Dec 25 21:30:34 Tux Call Trace:

Dec 25 21:30:34 Tux [<ffffffff80431334>] scsi_request_fn+0x2d1/0x325

Dec 25 21:30:34 Tux [<ffffffff8029d6b6>] sync_buffer+0x0/0x3f

Dec 25 21:30:34 Tux [<ffffffff80581002>] io_schedule+0x28/0x34

Dec 25 21:30:34 Tux [<ffffffff8029d6f1>] sync_buffer+0x3b/0x3f

Dec 25 21:30:34 Tux [<ffffffff80581227>] __wait_on_bit+0x40/0x6e

Dec 25 21:30:34 Tux [<ffffffff8029d6b6>] sync_buffer+0x0/0x3f

Dec 25 21:30:34 Tux [<ffffffff805812c1>] out_of_line_wait_on_bit+0x6c/0x78

Dec 25 21:30:34 Tux [<ffffffff8023df33>] wake_bit_function+0x0/0x23

Dec 25 21:30:34 Tux [<ffffffff8029ee89>] __bread+0x68/0x7c

Dec 25 21:30:34 Tux [<ffffffffa0833c29>] :hfsplus:hfsplus_read_wrapper+0x1cd/0x384

Dec 25 21:30:34 Tux [<ffffffffa082c797>] :hfsplus:hfsplus_fill_super+0xa8/0x4b1

Dec 25 21:30:34 Tux [<ffffffff803688c6>] string+0x34/0x93

Dec 25 21:30:34 Tux [<ffffffff80368c41>] vsnprintf+0x31c/0x5be

Dec 25 21:30:34 Tux [<ffffffff802a1c1e>] do_open+0x223/0x2b1

Dec 25 21:30:34 Tux [<ffffffff802a1d1c>] __blkdev_get+0x70/0x82

Dec 25 21:30:34 Tux [<ffffffffa082c6ef>] :hfsplus:hfsplus_fill_super+0x0/0x4b1

Dec 25 21:30:34 Tux [<ffffffff80368fed>] snprintf+0x44/0x4c

Dec 25 21:30:34 Tux [<ffffffff8058204f>] __down_write_nested+0x12/0x93

Dec 25 21:30:34 Tux [<ffffffff80291604>] get_filesystem+0x12/0x32

Dec 25 21:30:34 Tux [<ffffffff8027fdd1>] sget+0x356/0x365

Dec 25 21:30:34 Tux [<ffffffff8027f83c>] set_bdev_super+0x0/0xf

Dec 25 21:30:34 Tux [<ffffffffa082c6ef>] :hfsplus:hfsplus_fill_super+0x0/0x4b1

Dec 25 21:30:34 Tux [<ffffffff80280754>] get_sb_bdev+0xf8/0x145

Dec 25 21:30:34 Tux [<ffffffff802801c0>] vfs_kern_mount+0x4f/0x96

Dec 25 21:30:34 Tux [<ffffffff8028025a>] do_kern_mount+0x43/0xdc

Dec 25 21:30:34 Tux [<ffffffff80294267>] do_new_mount+0x5b/0x95

Dec 25 21:30:34 Tux [<ffffffff8029442a>] do_mount+0x189/0x1b6

Dec 25 21:30:34 Tux [<ffffffff8025be43>] __alloc_pages_internal+0xe2/0x3bd

Dec 25 21:30:34 Tux [<ffffffff802944e1>] sys_mount+0x8a/0xd9

Dec 25 21:30:34 Tux [<ffffffff8020b00b>] system_call_after_swapgs+0x7b/0x80

Dec 25 21:30:34 Tux 

```

It hangs and just seems to repeat that output in /var/log/messages every few minutes or so.

Any ideas?

update: I got a bit further ... if I run 'hmount /dev/sdb' ... I see information about my drive (volume name, date created, last modified, etc...) and what my problem was. The drive has 0 bytes free. 

But I still don't know how to mount it.

----------

## Wizumwalt

I'm still just trying to copy the contents of this disk onto my drive ... This is how far I get. If anyone has ideas, much appreciated.

```

# hfs /dev/sdb

hfsutils version 3.2.6 - Copyright (C) 1996-1998 Robert Leslie

This is free software but comes with ABSOLUTELY NO WARRANTY.

Type `license' for details.

/dev/sdb contains 1 HFS partition

partition unspecified; selecting number 1

Volume name is "hasely" (locked)

Volume was created on Fri Jun  2 21:31:25 2006

Volume was last modified on Fri Jun  2 21:31:25 2006

Volume has 0 bytes free

hfs> 

```

And most any command at the hfs> prompt give output like this ...

```

hfs> stat

*** glibc detected *** hfssh: munmap_chunk(): invalid pointer: 0x0000000000656720 ***

======= Backtrace: =========

/lib/libc.so.6[0x7fb88c259aad]

hfssh[0x403e02]

/usr/lib/libtcl8.4.so(TclInvokeStringCommand+0x69)[0x7fb88cbf9eb5]

/usr/lib/libtcl8.4.so(TclEvalObjvInternal+0x341)[0x7fb88cbfb5a4]

/usr/lib/libtcl8.4.so[0x7fb88cc228c3]

/usr/lib/libtcl8.4.so(TclCompEvalObj+0x8d)[0x7fb88cc25c8e]

/usr/lib/libtcl8.4.so(TclObjInterpProc+0x1fb)[0x7fb88cc4abba]

/usr/lib/libtcl8.4.so(TclEvalObjvInternal+0x341)[0x7fb88cbfb5a4]

/usr/lib/libtcl8.4.so(Tcl_EvalEx+0x387)[0x7fb88cbfba59]

/usr/lib/libtcl8.4.so(Tcl_EvalObjEx+0x10d)[0x7fb88cbfc45e]

/usr/lib/libtcl8.4.so(Tcl_EvalObjCmd+0x57)[0x7fb88cc01f8b]

/usr/lib/libtcl8.4.so(TclEvalObjvInternal+0x341)[0x7fb88cbfb5a4]

/usr/lib/libtcl8.4.so[0x7fb88cc228c3]

/usr/lib/libtcl8.4.so(TclCompEvalObj+0x8d)[0x7fb88cc25c8e]

/usr/lib/libtcl8.4.so(Tcl_EvalObjEx+0x59)[0x7fb88cbfc3aa]

/usr/lib/libtcl8.4.so(Tcl_CatchObjCmd+0x7d)[0x7fb88cc0248d]

/usr/lib/libtcl8.4.so(TclEvalObjvInternal+0x341)[0x7fb88cbfb5a4]

/usr/lib/libtcl8.4.so[0x7fb88cc228c3]

/usr/lib/libtcl8.4.so(TclCompEvalObj+0x8d)[0x7fb88cc25c8e]

/usr/lib/libtcl8.4.so(Tcl_EvalObjEx+0x59)[0x7fb88cbfc3aa]

/usr/lib/libtcl8.4.so(Tcl_WhileObjCmd+0x79)[0x7fb88cc06d59]

/usr/lib/libtcl8.4.so(TclEvalObjvInternal+0x341)[0x7fb88cbfb5a4]

/usr/lib/libtcl8.4.so(Tcl_EvalEx+0x387)[0x7fb88cbfba59]

/usr/lib/libtcl8.4.so(Tcl_FSEvalFile+0x16f)[0x7fb88cc3b479]

/usr/lib/libtcl8.4.so(Tcl_Main+0x24a)[0x7fb88cc3e9d0]

hfssh[0x401c92]

/lib/libc.so.6(__libc_start_main+0xf4)[0x7fb88c20ab74]

hfssh[0x401bf9]

======= Memory map: ========

00400000-00417000 r-xp 00000000 08:05 236134159                          /usr/bin/hfssh

00616000-00617000 r--p 00016000 08:05 236134159                          /usr/bin/hfssh

00617000-00618000 rw-p 00017000 08:05 236134159                          /usr/bin/hfssh

00618000-0069d000 rw-p 00618000 00:00 0                                  [heap]

4076b000-4076c000 ---p 4076b000 00:00 0 

4076c000-40f6c000 rw-p 4076c000 00:00 0 

7fb88bfe0000-7fb88bfec000 r-xp 00000000 08:03 92281054                   /lib64/libgcc_s.so.1

7fb88bfec000-7fb88c1eb000 ---p 0000c000 08:03 92281054                   /lib64/libgcc_s.so.1

7fb88c1eb000-7fb88c1ec000 r--p 0000b000 08:03 92281054                   /lib64/libgcc_s.so.1

7fb88c1ec000-7fb88c1ed000 rw-p 0000c000 08:03 92281054                   /lib64/libgcc_s.so.1

7fb88c1ed000-7fb88c323000 r-xp 00000000 08:03 655098                     /lib64/libc-2.6.1.so

7fb88c323000-7fb88c522000 ---p 00136000 08:03 655098                     /lib64/libc-2.6.1.so

7fb88c522000-7fb88c526000 r--p 00135000 08:03 655098                     /lib64/libc-2.6.1.so

7fb88c526000-7fb88c527000 rw-p 00139000 08:03 655098                     /lib64/libc-2.6.1.so

7fb88c527000-7fb88c52c000 rw-p 7fb88c527000 00:00 0 

7fb88c52c000-7fb88c5ac000 r-xp 00000000 08:03 160                        /lib64/libm-2.6.1.so

7fb88c5ac000-7fb88c7ab000 ---p 00080000 08:03 160                        /lib64/libm-2.6.1.so

7fb88c7ab000-7fb88c7ac000 r--p 0007f000 08:03 160                        /lib64/libm-2.6.1.so

7fb88c7ac000-7fb88c7ad000 rw-p 00080000 08:03 160                        /lib64/libm-2.6.1.so

7fb88c7ad000-7fb88c7c2000 r-xp 00000000 08:03 655102                     /lib64/libpthread-2.6.1.so

7fb88c7c2000-7fb88c9c2000 ---p 00015000 08:03 655102                     /lib64/libpthread-2.6.1.so

7fb88c9c2000-7fb88c9c3000 r--p 00015000 08:03 655102                     /lib64/libpthread-2.6.1.so

7fb88c9c3000-7fb88c9c4000 rw-p 00016000 08:03 655102                     /lib64/libpthread-2.6.1.so

7fb88c9c4000-7fb88c9c8000 rw-p 7fb88c9c4000 00:00 0 

7fb88c9c8000-7fb88c9ca000 r-xp 00000000 08:03 655100                     /lib64/libdl-2.6.1.so

7fb88c9ca000-7fb88cbca000 ---p 00002000 08:03 655100                     /lib64/libdl-2.6.1.so

7fb88cbca000-7fb88cbcb000 r--p 00002000 08:03 655100                     /lib64/libdl-2.6.1.so

7fb88cbcb000-7fb88cbcc000 rw-p 00003000 08:03 655100                     /lib64/libdl-2.6.1.so

7fb88cbcc000-7fb88cc83000 r-xp 00000000 08:05 88235                      /usr/lib64/libtcl8.4.so

7fb88cc83000-7fb88ce82000 ---p 000b7000 08:05 88235                      /usr/lib64/libtcl8.4.so

7fb88ce82000-7fb88ce83000 r--p 000b6000 08:05 88235                      /usr/lib64/libtcl8.4.so

7fb88ce83000-7fb88ce8c000 rw-p 000b7000 08:05 88235                      /usr/lib64/libtcl8.4.so

7fb88ce8c000-7fb88ce8d000 rw-p 7fb88ce8c000 00:00 0 

7fb88ce8d000-7fb88cea8000 r-xp 00000000 08:03 10087                      /lib64/ld-2.6.1.so

7fb88d07f000-7fb88d082000 rw-p 7fb88d07f000 00:00 0 

7fb88d0a5000-7fb88d0a7000 rw-p 7fb88d0a5000 00:00 0 

7fb88d0a7000-7fb88d0a8000 r--p 0001a000 08:03 10087                      /lib64/ld-2.6.1.so

7fb88d0a8000-7fb88d0a9000 rw-p 0001b000 08:03 10087                      /lib64/ld-2.6.1.so

7fff95094000-7fff950a9000 rw-p 7ffffffea000 00:00 0                      [stack]

7fff951ff000-7fff95200000 r-xp 7fff951ff000 00:00 0                      [vdso]

ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Aborted

```

----------

## NeddySeagoon

Wizumwalt,

Try mounting the partition sdb1 not the drive.

You have a kernel Oops or even a panic there.

edit  use the read only option (-o ro) to mount too, since you don't know the state of the filesystem

----------

## Wizumwalt

I don't have an sdb1 in my /dev. In fact, other than sda which is my local drive, sdb is the only other /dev/sd? I have.

----------

## NeddySeagoon

Wizumwalt,

is 

```
 [ ]   Macintosh partition map support (NEW) 
```

on, under  Partition Types  ---> ?

```
zgrep   MAC_PARTITION /proc/config.gz
```

will tell you if you have /proc/config.gz.

If its a module, it needs to be loaded.  Its needed to read Mac partition tables.

----------

## Wizumwalt

Ok, added that and it helped, I now have sdb1-9, and sdb11. Tried every one and all I get are the following results. Usually w/ kernel panics.

```

hfs: unable to find HFS+ superblock

```

----------

## NeddySeagoon

Wizumwalt,

Try

```
mount -t auto -o ro /dev/sdb1 /mnt/someplace
```

The kernel will try every file system it knows before it fails. If it succeeds, the partition will be read only.

Thats safe because if mount gets a successful rw mount with the wrong fs type, the results are ugly.

If this fails, start a new thread in the PPC forum. Explain what happened and what you have done so far.

----------

