220

I have a HFS+ journaled external hard-drive and need to be able to write to it on Ubuntu. I don't have access to my Mac, it's thousands of miles away and I won't have access to it for three months.

Can anything be done without losing the data on the HDD?

Melebius
  • 11,750
oppochips
  • 2,201
  • 3
  • 14
  • 4

5 Answers5

230

See How to mount a HFS partition in Ubuntu as Read/Write? - Super User

To quote from the second/third answer down:

First, make sure that you have hfsprogs installed. Example installation command:

sudo apt-get install hfsprogs

Next, mount or remount the HFS+ drive; commands need to be as follows:

sudo mount -t hfsplus -o force,rw /dev/sdXY /media/mntpoint

or

sudo mount -t hfsplus -o remount,force,rw /mount/point

...

Finally, if the drive was improperly unmounted or has otherwise become partially corrupted run fsck.hfsplus ... as such:

sudo fsck.hfsplus -f /dev/sdXY

There is a goldmine of other information there regarding the mounting of HFS+ filesystems.

Richard
  • 8,588
46

These steps works for me (Ubuntu Studio 14.04):

sudo apt-get install hfsprogs

Check status of drive:

sudo fsck.hfsplus -f /dev/sdXY

Unmount device:

sudo umount /media/sebastian/devicename

(create folder to mount the drive)

Mount the drive with HFS+ read/write permissions:

sudo mount -t hfsplus -o force,rw /dev/sdXY /home/sebastian/foldername
39

I had this problem too. I tried fsck.hfsplus, umount, remount with sudo mount -t hfsplus -o remount,force,rw nothing worked for me.

What did work for me was :

  1. unmount with sudo umount /media/myMountPoint
  2. delete the mount point with sudo rmdir
  3. recreate the mount point with sudo mkdir and
  4. remount with sudo mount -t hfsplus -o force,rw /dev/xxxx /media/myMountPoint

Hope this will also work for you guys.

bob
  • 491
16

Since I cannot comment (not enough reputation here:). I will post this answer to point out that the answer above appears to be for a hfs+ HD that is not journalled. The 'fsck.hfsplus' command needs to be issued with the '-f' option to work on a journalled volume. To avoid confusion I've copied the command below:

$ sudo fsck.hfsplus /dev/sdXY

** /dev/sdXY
[snip....]
** The volume ########### appears to be OK.

This would only run on a volume that has not been journalled. Even with the '-f' option on a journalled volume this check in itself will not allow the remounted volume to be mounted read/write. I believe journalling must be turned off.

There does not seem to be stable code available to turn off journalling from linux. See the link provided by Richard: http://ubuntuforums.org/showthread.php?t=1420673

If journalling is turned off and the disk initially mounts as read-only unmounting and remounting should allow read/write if the disk is undamaged. If it is damaged then fsck.hfsplus needs to be run.

12

Borrowing from the previous answer, the following steps worked for me. Hopefully this is useful to others:

  1. Plug in the external HDD.

  2. Notice that Ubuntu mounts it automatically but it is read-only.

  3. Unmount the drive (I do this simply by clicking on the eject button in the file explorer).

  4. sudo apt-get install hfsprogs

  5. $ sudo fsck.hfsplus /dev/sdXY
    

    ** /dev/sdXY ** Checking HFS Plus volume. ** Detected a case-sensitive catalog. ** Checking Extents Overflow file. ** Checking Catalog file. ** Checking multi-linked files. ** Checking Catalog hierarchy. ** Checking Extended Attributes file. ** Checking volume bitmap. ** Checking volume information. ** The volume ########### appears to be OK.

    (sudo fsck.hfsplus -f /dev/sdXY if filesystem is journaled.)

  6. Remount the drive (I do this simply by clicking on the drive in the file explorer).

  7. The drive is now read-write.

David Foerster
  • 36,890
  • 56
  • 97
  • 151