Mounting HFS+ with Write Access in Debian

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


Write a Comment

Comment

44 Comments

  1. 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?

    • 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?

  2. Hi!!!

    know because I get this error?

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

    • 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!

  3. 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.

  4. 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?

    • 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.

      • “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).

  5. 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!

  6. 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!!

  7. If the drive has been mounted automatically (as it should be on a desktop system like Ubuntu), you can enable write with

    sudo mount -o remount,force,rw /mount/point
    or
    sudo mount -o remount,force,rw /dev/sdx

    /mount/point would usually be /media/Your_drive_label
    /dev/sdx is your HFS+ device

    use mount -l to find which device is mounted on which mount point

  8. The above approach didnt work for me.
    I had to disable journaling in mac
    Then ubuntu auto mounts it
    chmod -R 777 *
    Then i am able to rw

    But the moment i restart the box.

    Its back to square 1. I have to repeat the steps above

  9. For those of you who had problems with this. This is how it should go :

    1. sudo fsck.hfsplus -f /dev/sda2
    2. sudo apt-get install hfsplus hfsutils hfsprogs
    3. sudo mount -o force /dev/sda2 /media/Mac

    You will need the first step sometimes, if there has been some recent formats or resizing of the partition.

  10. Hi,

    This is a nice post about how to write to hfs+, and let me start by saying that this approached has worked for me. At the same time, I would like to reiterate a caution (sort of mentioned above by Stefan Monnie) β€” the β€˜force’ option to mount opens a back-door that allows write access despite the journaling system. This can cause issues with the file-system later on. See β€” http://tinyurl.com/aoewcj4 under the β€˜force’ option. As the wiki page for HFSPlus says, the project to fully support write on HFS+ under linux was taken up under Google summer of code a couple years ago, but I don’t think it was ever completed.

    So, the β€˜force’ option merely hides the warning, assuming you know what you’re doing!

  11. Not irrelevant at all. I just got this error trying to mount an external volume on Ubuntu 14.04. Thanks for posting this article.

  12. Will this work if an upgrade failed on an Apple and fuzzes the boot loader or something similar. I’m trying to retrieve data from my HDD and I can’t get it to mount. :/

    Help would be greatly appreciated.

    • Hey Trav,

      Sorry to hear about your predicament; I’ve been there and I know how not fun it is. Unfortunately, I don’t know if this article will help. It’s several years old and I haven’t done anything with mounting drives this way in a long time.