Mounting HFS+ with Write Access in Debian

Published November 23rd, 2008

When I decided to reformat and install my Mac Mini with the latest testing version of Debian (lenny, at the time of this writing) I discovered that I couldn’t mount my HFS+ OS X backup drive with write access:

erin:/# mount -t hfsplus /dev/sda /osx-backup
[ 630.769804] hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.

This warning puzzled me because I was able to mount fine before the reinstall and, since the external drive is to be used as the bootable backup for my MBP, anything with “at your own risk” was unacceptable.

I had already erased my previous Linux installation so I had no way of checking what might have previously given me write access to the HFS+ drive. A quick apt-cache search hfs revealed a bunch of packages related to the HFS filesystem. I installed the two that looked relevant to what I was trying to do:

hfsplus - Tools to access HFS+ formatted volumes
hfsutils - Tools for reading and writing Macintosh volumes

No dice. I still couldn’t get write access without that warning. I tried loading the hfsplus module and then adding it to /etc/modules to see if that would make a difference. As I expected, it didn’t. I was almost ready to give up but there was another HFS package in the list that, even though it seemed unrelated to what was trying to do, seemed worth a shot:

hfsprogs - mkfs and fsck for HFS and HFS+ file systems

It worked! I have no idea how or why (and I’m not interested enough to figure it out), but after installing the hfsprogs package I was able to mount my HFS+ partition with write access.

Update:

As Massimiliano and Matthias have confirmed in the comments below, the following solution seems to work with Ubuntu 8.04:

From Linux, after installing the tools suggested before, you must run:
mount -o force /dev/sdx /mnt/blabla

Otherwise, in my fstab, I have an entry like this:
UUID=489276e8-7f9b-3ae6-8c73-69b99ccaab9c /media/Leopard hfsplus defaults,force 0 0



If you enjoyed this, please share it with others:
Share on Twitter, Facebook, Google+, or Send via Email Send via Email-->
Subscribe to receive new thoughts and essays as they're published:
Name:
Email:
Topics:      
  1. spacer Tobias

    Just what I was looking for. Thank you!

    Reply
    • spacer Raam

      Glad I could help, Tobias! :)

      Reply
  2. spacer Andreas

    I recently encountered something similar to this problem too, while trying to create an hfs+ partition om my debian server…

    After “apt-get install hfsplus hfsutils hfsprogs”, I was able to create an partition and even mount it, but I cannot write to it though.. :(

    #mkfs.hfsplus -J /dev/vg01/lv01
    Initialized /dev/vg01/lv01 as a 500 GB HFS Plus volume with a 49152k journal
    # mount /dev/vg01/lv01 /media/lv01/
    # mkdir test
    mkdir: Can’t create directory “test”: Filesystem read-only

    (this is a rough translation from my swedish error messages) ;-)

    Ao now I am curious if you did anything else to get your hfs+ disk writable?

    Reply
    • spacer Raam

      Hi Andreas,

      I didn’t need to do anything special to mount the disk writable. If the drive is automatically mounted, you might want to check /etc/fstab to make sure the ‘w’ flag is there to make the drive writable. Can you show me the output of the ‘mount’ command after you’ve mounted the drive?

      Reply
  3. spacer Victor

    Hi!!!

    know because I get this error?

    root[victor]# mount -t hfsplus /dev/sda5 /mnt/Mac/
    mount: tipo de sistema de ficheros ‘hfsplus’ desconocido

    Reply
    • spacer Raam

      Hi Victor,

      It sounds like the system isn’t recognizing the hfsplus filesystem format. Have you installed hfsplus, hfsutils, and hfsprogs? If you’re using Debian or Ubuntu, you should be able to run the following command to install them:

      sudo apt-get install hfsplus hfsutils hfsprogs

      Good luck!

      Reply
  4. spacer Roberto

    Hi all,

    I couldn’t get my disk to mount as read and write either.
    I installed all the packages and have all the modules, but I’d still get the “hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.” message.

    The solution that did work out for me was this:
    Back on a Mac go to the command-line and, after your disk has shown up on the Desktop, do:
    “sudo diskutil disableJournal /Volumes/volumeName”
    where ‘volumeName’ is the name of the disk (as it appeared on the Desktop).

    From then on the disk will no longer be journaled and will mount read and write on Debian.

    Hope this will be useful for someone out there. Cheers.

    Reply
    • spacer Raam

      Thanks for the tip, Roberto!

      Reply
  5. spacer Massimiliano

    No. You shouldn’t disable “journal”!
    I am not going to explain you what journal is, but without journal, after a crash, you may loose files and need a filesystem repair.
    From Linux, after installing the tools suggested before, you must run:
    mount -o force /dev/sdx /mnt/blabla

    Otherwise, in my fstab, I have an entry like this:
    UUID=489276e8-7f9b-3ae6-8c73-69b99ccaab9c /media/Leopard hfsplus defaults,force 0 0

    It was quite easey. If the error message says “use force”, what else you can do?

    Reply
    • spacer Matthias

      Yes, this is the solution (see Massimiliano), at least it works (tested on Ubuntu 8.04 using the packages hfsplus and hfsprogs):
      the force option is the only way to allow to write to the HFS volume, as the warning message explains, even though without the force option mount says that you may write to the volume (but this is not the case actually!).

      Why should you want to switch off the useful journal, if it’s not even necessary? So leave it on for the sake of consistency of your data.

      Reply
      • spacer Raam

        Thanks for the confirmation, Matthias! I have included your mention of testing it with Ubuntu 8.04 in the post.

        Reply
      • spacer Stefan Monnier

        “Why should you want to switch off the useful journal, if it’s not even necessary?”
        Easy: the Linux driver for hfsplus is not able to manipulate the journal, so if you mount with `force’ with a journal, you can end up with some nasty corruption when you try to access the partition from Mac OS X (which will use the journal, unaware that it is out of date).

        Reply
    • spacer Raam

      Thanks for the update, Massimiliano! I have updated the post.

      Reply
  6. spacer Anonymous

    The linux driver might require journaling to be disabled in order to mount… I am not sure. If so follow what was mentioned.

    What I have noticed though is that sometimes if you fsck the disk it will be able to mount. But you must force it to. the command should be something like

    fsck.hfsplus -f /dev/sdaX

    after doing this I’m usually able to mount the partition RW… as a note.. this must be done with the partition unmounted.

    hope it works!

    Reply
    • spacer Raam

      Thanks for the comment and the tip! :)

      Reply
    • spacer Chris

      Upvote for this… I had to perform fsck.hfsplus on my partition before it would mount with write – even though I tried -o force beforehand.

      Reply
    • spacer Jesse

      This worked for me! thanks!!

      Reply
  7. spacer Gino Barahona

    at last uff!!!..
    ~$ sudo apt-get install hfsplus hfsutils hfsprogs
    ~$ sudo mount -o force /dev/sdc1 /home/gino/Escritorio/Macaquero/

    Thanks a lot!!!! good work!!

    Regards!!

    Reply
    • spacer Raam

      You’re welcome, Gino! Thanks for stopping by!

      Reply
      • spacer Alessandro

        It says: “mount: you must specify the filesystem type”

        Reply
        • spacer Raam Dev

          Alessandro, please make sure you’ve installed the hfsplus, hfsutils, and hfsprogs packages. If you still receive that message, try adding -t hfsplus to the mount command.

          Reply
  8. spacer Johan

    Confirmed! This worked on my triple-boot macbook laptop. Now I have 3 gigs of extra HD space. Thanks.

    Reply
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.