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)
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