1

I'm new to Linux, and just installed Ubuntu 17.04 on a dual-boot MacBook. I'm having trouble with directories I'm creating on an hfs+ partition (created with gparted, so I can see files on it when booted into OS X). I'm assuming the confusion has to do with the hfs+ format being case-insensitive, but then, shouldn't it really be case insensitive, whether I'm working on it via Ubuntu or OS X? Here's the scenario:

  1. Created directory "DropBox" via Nautilus.
  2. Tried to rename "DropBox" to "Dropbox" but got error message: 'The item could not be renamed. The name "Dropbox" is already in use...'.
  3. Tried deleting "DropBox" (permanently, not to Trash) and creating new directory "Dropbox". When I did that, both directories appeared ("DropBox" and "Dropbox").
  4. Tried deleting "DropBox", but both directories were deleted.
  5. Looked in Terminal; while both "DropBox" and "Dropbox" are visible in Nautilus, running `ls -a shows only "DropBox".

  6. Still in Terminal, deleted "DropBox" (rm -R DropBox). As expected, this resulted in there being no dropbox folder of any sort. However, in Nautilus, I still see "Dropbox", until I try to open it, at which time I get an error that says it doesn't really exist, and then it disappears from Nautilus, too.

  7. In Terminal, re-create the directory (mkdir Dropbox). The directory is recreated as "DropBox" again, and shows up as such in Nautilus as well.

Is there any way around this issue, or is it unavoidable when using hfs+?

Update:

After deleting "DropBox" and rebooting, I am now able to create the directory as "Dropbox". I don't consider this a solution, because it's a cumbersome workaround; it doesn't solve the problem.

LSharkey
  • 1,103

1 Answers1

1

After digging around further, I found the solution to this issue. It is actually possible to format an hfs+ partition in OS X as case-sensitive, unjournaled. There's no way to switch an existing case-insensitive partition to case-sensitive.

The option to disable journaling (or to format a vol as case-sensitive, not journaled) has been removed from the OS X Disk Utility in El Capitan (which is the version I'm running) but it can still be done:

  1. Depending on how the disk is partitioned, it might be necessary to carve out the disk space first on Linux. I'm fairly sure it doesn't matter what type of partition, but just to be careful, I created hfs+ to make sure there were no weird access issues on the OS X side.

  2. In OS X, use Disk Utility to format the partition as HFS+ Case-Sensitive, Journaled.

  3. Still in OS X, in Terminal, run sudo diskutil disableJournal /dev/volname. You can run this with the disk mounted or unmounted. (If you're not sure of the disk or volume name, diskutil list will list them all).

OR

I did not test this to verify, but according to apple documentation this is how to format hfsplus case-sensitive, non-journaled at the command line: Instead of formatting in Disk Utility and then turning off journaling, sudo diskutil eraseVolume "Case-sensitive HFS+" /dev/volname will accomplish the same thing in one step.

And that's it. I tested it out back in Ubuntu, using the same "DropBox" name change test I used before, and it all looks good.

Side note: From the number of posted questions on the subject, it appears that mounting hfs+ as rw in Ubuntu is problematic for many. The syntax for designating mount of an hfs+ partition as rw in fstab is UUID=<UUID> /mountpoint hfsplus rw,exec,auto,user 0 0, assuming you want the typical options for a non-system data vol. If you want something different, this article is really helpful. You will also probably need to sudo chown -R user /mountpoint the mountpoint.

LSharkey
  • 1,103