walls.corpus

By Nathan L. Walls

  • Sunset, Jan. 2, 2021/Williams Township
  • On Bougher Hill/Williams Township
  • Sunrise, Dec. 19, 2020/Williams Township
  • Sunset, Dec. 27, 2020

Using a Leopard disk image to resolve case-sensitivity issues

One aspect of starting a new development gig is setting up a new development environment and checking out new-to-me code.

At the new shop, I ran into an issue trying to check-out the main Subversion repository on my Mac. Subversion erred out in an images directory half-way through the checkout. The reason is, there are two files with the same name, save for the case in that directory. One is named like foo-bar.jpg, the other is Foo-Bar.jpg.

By default, Mac OS X filesystems are case-retentive, so capitalization within a filename is preserved. However, the default filesystem (HFS+, Journaled) is case-insensitive, so the operating system complains when there are overlapping names like FOO.txt, foo.txt or fOO.TXT

Mac OS X supports case-sensitive filesystems, UFS and HFS+ (Case-sensitive, Journaled)1. A while back, I tried creating a Mac OS X boot volume as HFS+ (Case-sensitive, Journaled). Unfortunately, the installer for Adobe CS3 refused to operate with the case-sensitive filesystem.

So, I’m stuck using the default filesystem. I don’t think having two filenames unique in case only is good practice, but, as previously stated, I sometimes encounter filename overlap in source repositories.

Since I use Leopard, my initial idea was to resize my default partition and create a new, case-sensitive disk partition. The Leopard Disk Utility can resize partitions. This, however, did not solve my problem. While I could create a new partition, I could not change its format.

Idea number two, however, worked. I used Disk Utility to create a 500 megabyte, case-sensitive disk image and saved it to a location in my home directory. Double-clicking on the image mounts it to /Volumes. In Terminal.app, the mounted disk image looks like part of the regular filesystem, allowing me to cd into it and do my Subversion checkout there. Now, I can have overlapping filenames. Moreover, changes to the disk image are saved automatically, so I only need to worry about remounting the disk image after restarts.

Instructions

These instructions are for Mac OS X Leopard (10.5)

  • Open Disk Utility.app. It’s located under /Applications/Utilities
  • Click New Image from the menu bar.
  • A dialog sheet will appear.
  • Save As will be the name of the file the disk image will be saved as. Navigate to a location you won’t mind having the disk image live.
  • Pick a Volume Name. This will what the disk image appears as in a Finder sidebar when mounted. It will also be the name the disk image appears at underneath /Volumes. I stay away from spaces, odd punctuation or anything that would interfere with easy tab-completion from the shell.
  • Pick a Volume Size. The starting size is 100 megabytes and goes up 8 gigabytes. Custom sizing is also available.
  • Pick the Volume Format. The option I selected was “Mac OS Extended (Case-sensitive, Journaled)”
  • Select whether or not you want the image encrypted.
  • I didn’t do anything special with Partitions for the disk image.
  • Image Format Pick read/write disk image.
  • If the dialog sheet doesn’t present these options, cancel the operation and make sure you don’t have an existing volume selected.
  1. You can have a third option, HFS+ (Case-sensitive) that is not journaled.