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.

6
  • From the description, this sounds like a bug in HFS+, or maybe Ubuntu's implementation of it. You might want to ask at Ask Different, since HFS+ is an Apple FS.
    – wjandrea
    Aug 17 '17 at 22:45
  • Can you show us the mount options for the hfs+ partition (from the mount command run with no arguments)? Are you actually running the Dropbox application? Aug 18 '17 at 0:26
  • @steeldriver - here is the mount options: /dev/sdb2 on /data type hfsplus (rw,nosuid,nodev,noexec,relatime,umask=22,uid=0,gid=0,nls=utf8) I am not running Dropbox there yet - I have the standard sync folder on another partition, and I want to create a symlink so that I can redirect the data to my shared drive.
    – LSharkey
    Aug 18 '17 at 20:23
  • @wjandrea - thanks for the suggestion; I just posted my question there, as well.
    – LSharkey
    Aug 18 '17 at 20:51
  • Not a solution, but I just have to say that I am not surprised. Ultimately, Linux is an OS designed with case sensitivity in mind. All file systems designed for Linux (ext*, reiserfs, xfs...) are case sensitive. Trying to run Linux on a non case sensitive file system such as hfs is bound to lead to such problems. Is there no way for you to run Linux on a file system targeted for Linux? Aug 20 '17 at 0:57
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.