Weblog entry #21 for lee
fscking hfsplus in both senses!
I have a 1TB Lacie disk attached to a PC running Ubuntu at work. It needs to be readable and writable under both Linux and OSX so I assumed that leaving it as HFS+ would be OK. The disk automounted under Gnome and had been running fine until it got removed without being unmounted. After that, dragging files to it via Nautilus resulted in the following warning:
Error while copying to "/media/archive". You do not have permissions to write to this folder
The permissions look fine, so I try from the command line.
$ touch /media/archive/test touch: cannot touch `/media/archive/test': Read-only file system $ mount | grep /media/archive /dev/sdg6 on /media/archive type hfsplus (rw,nosuid,nodev,uid=1000,gid=1000)
OK, apparently mount is lying about the disk being mounted read-write?
HFS+-fs warning: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.
I "eject" the disk from Gnome and run "fsck.hfsplus /dev/sdg6".
Well... I would. mkfs.hfsplus isn't installed and doesn't appear to be available in Ubuntu. There is a package, hfsplus, which contains "hpfsck" so I give that a try.
# hpfsck /dev/sdg6
*** Checking Volume Header:
Volume was not cleanly unmounted
Volume is inconsistent
Done ***
*** Checking Backup Volume Header:
Volume is inconsistent
Volume was last Mounted by unknnown implemenatation:
kcsf Done ***
*** Checking Extents Btree:
checkbtree_key_by_index: offset out of range E00 >= 400
*** Check stopped ***
hpfsck: hpfsck: no error (Success)
No change.
Checking search engines, I see that many Linux iPod users have this issue. However the fix usually involves reformatting to FAT32, something I'm not willing to do. Digging deeper, it seems that the hfsplus is out-of-date, unmaintained, and known not to work. Apparently the only tools that work with HFS+ are the disk tools ported from Darwin. They don't seem to have been packaged for debian (Sadly, the developer that opened the ITP, Bug#229769, later died in an accident) or Ubuntu, but I found some manual installation instructions on a Gentoo wiki.
wget http://darwinsource.opendarwin.org/tarballs/apsl/diskdev_cmds-332.14.tar.gz wget http://www.ecl.udel.edu/~mcgee/diskdev_cmds/diskdev_cmds-332.14.patch.bz2 tar zxf diskdev_cmds-332.14.tar.gz bunzip2 -c diskdev_cmds-332.14.patch.bz2 | patch -p0 cd diskdev_cmds-332.14 make -f Makefile.lnx sudo cp fsck_hfs.tproj/fsck_hfs /usr/local/sbin/fsck.hfsplus(yes, fsck programs shouldn't usually go anywhere except /sbin)
# fsck.hfsplus /dev/sdg6 ** /dev/sdg6 ** Checking HFS Plus volume. ** Checking Extents Overflow file. ** Checking Catalog file. ** Checking Catalog hierarchy. ** Checking volume bitmap. ** Checking volume information. ** The volume archive appears to be OK.
Resetting the device and allowing it to automount now allows writing. Hurrah.
Comments on this Entry
Thanks, keep up the great work!!
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
apt-get install build-essential
[ Parent | Reply to this comment ]
you can contact me at ciampagg- a t -lu.unisi.ch
|Giovanni
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
ftp://ftp.fi.debian.org/pub/gentoo/distfiles/diskdev_cmds-332.14. patch.bz2
sven
[ Parent | Reply to this comment ]
But I couldn't get the HFS+ partition to be mounted on Debian, so I tried to follow the instructions above, but when passing the command "bunzip2 -c diskdev_cmds-332.14.patch.bz2 | patch -p0" something strange appears to happen.
I've tried a couple of times, but I always get the same problem (asking me for a file to be patched...)
This is the message I get from the Terminal:
[quote]
debian:/home/fabiopanico# bunzip2 -c diskdev_cmds-332.14.patch.bz2 | patch -p0
patching file diskdev_cmds-332.14/Makefile.lnx
patching file diskdev_cmds-332.14/diskdev_cmds-332.11/Makefile.lnx
patching file diskdev_cmds-332.14/diskdev_cmds-332.11/fsck_hfs.tproj/Makefile.l nx
patching file diskdev_cmds-332.14/fsck_hfs.tproj/Makefile.lnx
can't find file to patch at input line 66
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur diskdev_cmds-332.14/fsck_hfs.tproj/cache.c diskdev_cmds-332.14.patched/fsck_hfs.tproj/cache.c
|--- diskdev_cmds-332.14/fsck_hfs.tproj/cache.c 2006-02-20 16:45:15.000000000 -0500
|+++ diskdev_cmds-332.14.patched/fsck_hfs.tproj/cache.c 2006-11-12 22:53:09.000000000 -0500
--------------------------
File to patch:
[/quote]
Does anyone know what I'm doing wrong? How can I get it to work?
Thank you very much,
Fabio > fabiopanico (at) gmail.com
[ Parent | Reply to this comment ]