Installing Mac OS X on a case-sensitive HFS+ a.k.a. HFSX volume, on ppc

This procedure worked for me. I used two Intel Mac's and one PowerPC Mac in the recipe. If you don't have so many Macintoshes, you'll have to run Disk Utility off the Install CD, involve external Firewire hard drives set up a Linux NFS and BSDP server for NetBoot, or something.

  1. Buy an Intel iMac that comes with Mac OS 10.5.0.

  2. Upgrade it to 10.5.2 using the Internet.

  3. Reboot it while holding down T, until the Firewire logo appears covering the entire screen. This turns the Mac into a Firewire disk.

  4. Buy another Intel iMac with Mac OS 10.5.0. Connect it to the upgraded Mac using a Firewire cable. The upgraded Mac's disks should mount on the desktop.

  5. Rename the hard disk volume of the 10.5.2 Firewire target Mac to something other than 'Macintosh HD'. 10.5.0 Finder and file-open menu seems to have more bugs than it should when two volumes with the same name are attached. After renaming, umount the volume, unplug the Firewire cable, reboot the 10.5.0 Mac, and plug the Firewire cable back in. Verify the Firewire target 10.5.2 Mac remounts with the new volume name.

  6. Highlight the 10.5.2 Firewire volume and Command-I Get Info. Click the lock and type your sudo password. Uncheck ``Ignore ownership on this volume.''

  7. Open Disk Utility. Choose File -> New -> Disk image from folder. Choose the 10.5.2 volume root as the source folder, and store the target image somewhere on the 10.5.0 (boot) volume. Do not make the default Compressed image. Make a read/write image instead.

  8. Use Disk Utility to eject the 10.5.2/i386 Firewire target you have just imaged, and unplug the cable. You are done with this machine now. If you make zero mistakes, it's safe to return this machine to your friend, or put it back in the spares pool.

  9. Mount the read/write image you just created by double-clicking it in the Finder.

  10. Open a Terminal window. Find the root of the image under /Volumes/<image name> and change into that directory. Delete some potentially stale cache files:

    luser@mac:/Volumes/the_image$ sudo rm var/db/BootCache.playlist var/db/volinfo.database System/Library/Extensions.kextcache System/Library/Extensions.mkext
    luser@mac:/Volumes/the_image$ sudo rm -rf var/vm/*
    

    Be sure to leave off the leading slash, so you're not deleting these files from the booted system. There is an alternate list of ``special'' files here, but that is not the list I used.

  11. Close the Terminal so you do not keep the image busy by having your working directory there. Eject the image.

  12. Use Disk Utility Images -> Convert... to convert the image you've just ejected into a Compressed image. This will write a compressed copy of your image.

  13. Use Disk Utility Images -> Scan Image for Restore... to alter the compressed image. This alters the image in-place. It doesn't make a copy. When this is finished, you have a case INsensitive image of Mac OS 10.5.2, which is a Universal version that will work on i386 or ppc.

  14. Boot the PowerPC Mac which you would like to run case-sensitive HFS+/HFSX into Firewire target mode by holding down T until the giant Firewire logo appears. Plug this into the 10.5.0 i386 Mac you've been using.

  15. Select the PowerPC Mac's hard disk. not the boot volume, but the Disk. One disk contains zero or more Volumes---select the Disk, not the Volume. The disk is the entry above the volume, the AAPL FireWire Target.

  16. Flip to the Partition tab. Make the partitions however you like, and make one partition which is Mac OS Extended (Case-sensitive, journaled). Press the Options... button to verify the map type is ``Apple Partition Map'', the only type that will boot on PowerPC Mac's. Press Partition to wipe your PowerPC Mac's hard drive and create an empty case-sensitive filesystem.

  17. The just-partitioned empty boot volume of the ppc Mac will now be mounted on the desktop. Use command-I to uncheck Ignore ownership on this target volume, just as you did for the source volume. This step is necessary because we are not marking the Erase destination checkbox on the Restore pane below.

  18. Highlight the target volume in Disk Utility, and verify it says 'Format: Mac OS Extended (Case-sensitive, journaled)'

  19. Flip to the Restore tab in Disk Utility. Drag the ppc boot volume into the Destination textbox. UNcheck the Erase destination box. Find the Image... for the Source box that you scanned for restore earlier.

    Unchecking Erase asks for a file-copy restore, while checking Erase asks for a block-copy restore. In our case, the end result should be the same, because we've just erased the target disk by partitioning it.

    The utility which implements Restore, asr, claims in its man page that it's able to do an Erase-style block copy from an HFS+ image into an HFSX filesystem (that's what we want). However, when invoking it through Disk Utility, I found if I allow asr to Erase the target, I always get the same case sensitivity type of restored filesystem as the image type. asr needs some special command line options to work in filesystem conversion mode. I discovered the workaround just described before reading the man page, so I'm telling you the tested procedure instead of the possibly faster but likely broken alternative through Terminal.

  20. Open the Console utility and notice the syslog messages from Disk Utility. They will mention the device name of your ppc Mac's Firewire disk. It's probably /dev/disk1s<n> where <n> varies.

  21. When the Restore finishes, Unmount the boot volume using Disk Utility. Don't eject the volume using the Finder. Don't eject the whole disk with Disk Utility. Just Unmount the volume, and leave the Firewire disk ``mounted'' or ``unejeculated''.

  22. Now, open Terminal. If Disk Utility was working on /dev/disk1s3 according to Console, then type the following command:

    Script started on Tue Apr 22 17:56:23 2008
    bash-3.2$ PS1=\\h:\\w\\\$\ 
    cashiers-imac:~$ sudo pdisk /dev/disk1
    Password:
    Edit /dev/disk1 -
    Command (? for help): p
    
    Partition map (with 512 byte blocks) on '/dev/disk1'
     #:                type name        length   base      ( size )
     1: Apple_partition_map Apple           63 @ 1        
     2:          Apple_Boot Booter      262144 @ 64        (128.0M)
     3:          Apple_HFSX Untitled 264347312 @ 262208    (126.1G)
     4:          Apple_Boot Booter      262144 @ 264609520 (128.0M)
     5:          Apple_HFSX Untitled  47710128 @ 264871664 ( 22.7G)
     6:          Apple_Free                 16 @ 312581792
    
    Device block size=512, Number of Blocks=312581808 (149.1G)
    DeviceType=0x0, DeviceId=0x0
    
    Command (? for help): t
    Partition number: 2
    Existing partition type ``Apple_Boot''.
    New type of partition: Apple_HFS
    Command (? for help): w
    Writing the map destroys what was there before. Is that okay? [n/y]: y
    The partition table has been altered!
    
    Command (? for help): q
    cashiers-imac:~$ 
    

    You need to make some effort to enjoy working with pdisk. The Apple Partition Map is the finest partition map on any operating system. It contains no bullshit about ``geometry'', allows sector-granularity allocation, includes a partition for the partition map, and is extremely old. It includes important sanity-maintaining concepts which other maps have abandoned like ``every sector must be covered by the map exactly once, no overlapping partitions and no unpartitioned space allowed,'' and ``partitions have a 'type' which must match the expectation of the software writing to the blocks inside the partition, and a 'name' which said software may safely ignore,'' and ``partitions have a definite numbering starting at 1, a numbering which cannot have any gaps in it because it is implied, but there is no fixed limit on the number of partitions, and also in general the best way to find a partition is by looking for the desired 'type' and then peeking at labels and serial numbers inside the contained filesystem itself, NOT using the map partition number.'' Unix and MBR partitions break ALL these rules, and many others. In addition older Mac OS had a couple other really cool rules:

    I love these rules. I don't know why they weren't obvious to everyone, yet almost no one but Apple got them right.

    The EFI map copies its spirit, but without the merit of being so old and with some added elegance (GUID's), some missing elegance. There were some very old Macs that used a different, worse partition map, though. There are fancier arguably better ways to partition disks, like LVM2 physical volume tags in Linux/AIX, and ZFS whole-disk mode, but for a plain old partition map, which is still often needed, the Apple map is the best that ever existed. Too bad almost nothing understands it!

    You'll notice Disk Utility created quite a few partitions for which we never asked. It always makes those Apple_Boot partitions near other partitions with modern filesystems on them. The Apple_Boot partitions are plain HFS partitions which are easy for old firmware to read.

    In this typescript above we've converted the Apple_Boot partition which immediately preceeds our interesting partition into an Apple_HFS partition which the Mac OS will be willing to mount. And quitting pdisk should signal the Mac OS to try remounting all the new partitions. The old Apple_Boot volume should pop onto the Desktop now. You can see the HFS filesystem inside it is named Boot OSX. Spooky, eh?

  23. For now, ignore the Apple_Boot volume. ``Bless'' the ppc volume onto which you restored. Bless it for i386 and ppc.

    There are three kinds of blessings: Mac OS 9, Mac OS X ppc, and Mac OS X i386. And blessing itself is a tangled concept involving several tasks: setting firmware variables, writing bootblocks, writing second-stage loaders, and marking the folders containing second-stage loaders in the filesystem's headers. The bless tool can do all these things, but in particular the writing of firmware variables is impossible in this case because we are not running on the same machine that'll do the booting, and there's no way to warn bless of this fact (booting off Firewire is possible), and rumors on the web say Startup Disk does a better job than bless at writing firmware variables. And boot blocks only apply to OS 9: all OpenFirmware machines are filesystem grovelers and don't use bootblocks except when older OpenFirmware machines are booting NetBSD. I'm not totally sure how to control all these bless functions independently, to stop bless from writing firmware variables wrongly, but I didn't have any problems. FTR, what we care about: Mac OS X ppc blessing, Mac OS X i386 blessing, second-stage loader writing, and marking folders in filesystem headers.

    cashiers-imac:~$ sudo bless --folder /Volumes/ppc-firewireHD/System/Library/CoreServices/ --bootinfo --bootefi
    Password:
    cashiers-imac:~$ 
    

  24. Copy the BootX that bless just wrote into the root of the Boot OSX volume, and bless the Boot OSX volume.

    cashiers-imac:~$ sudo cp /Volumes/ppc-firewireHD/System/Library/CoreServices/BootX /Volumes/Boot\ OSX/
    cashiers-imac:~$ sudo bless --folder /Volumes/Boot\ OSX/
    cashiers-imac:~$ 
    

  25. Use Disk Utility to Unmount the Boot OSX partition, and the partition onto which you restored (ppc-firewireHD in the example).
  26. Use pdisk to change the type of the Boot OSX firmware helper partition back to Apple_Boot:

    cashiers-imac:~$ pdisk /dev/disk1
    Edit /dev/disk1 -
    Command (? for help): p
    
    Partition map (with 512 byte blocks) on '/dev/disk1'
     #:                type name        length   base      ( size )
     1: Apple_partition_map Apple           63 @ 1        
     2:           Apple_HFS Booter      262144 @ 64        (128.0M)
     3:          Apple_HFSX Untitled 264347312 @ 262208    (126.1G)
     4:          Apple_Boot Booter      262144 @ 264609520 (128.0M)
     5:          Apple_HFSX Untitled  47710128 @ 264871664 ( 22.7G)
     6:          Apple_Free                 16 @ 312581792
    
    Device block size=512, Number of Blocks=312581808 (149.1G)
    DeviceType=0x0, DeviceId=0x0
    
    Command (? for help): t
    Partition number: 2
    Existing partition type ``Apple_HFS''.
    New type of partition: Apple_Boot
    Command (? for help): w
    Writing the map destroys what was there before. Is that okay? [n/y]: y
    The partition table has been altered!
    
    Command (? for help): q
    cashiers-imac:~$ 
    

  27. Use Disk Utility to eject the Firewire target corresponding to the ppc Mac. You're now done with the 10.5.0 i386 Mac.

  28. Boot the ppc Mac. Zap its PRAM first. It should come right up, though.

    If for some reason it doesn't, hold down Option during boot to make OpenFirmware probe for a choice of auto-bootable devices (this takes like a minute, while it shows you the wristwatch pointer). There are even more forceful ways through Command-Option-O-F command line interface to explicitly name an Apple_Boot partition and a file within it, regardless of Blessings, but I did not need to do that.

  29. If you have enabled file sharing on the PPC Mac, open the Sharing control panel and fix the settings, because the volume name has changed.

  30. Also, run Startup Disk control panel. This might make it boot faster, not sure. In the old days Startup Disk also applied nvramrc patches that needed reapplying after zapping PRAM, but I think those days are over.

What doesn't work

You might think these things would work, but they don't:


rants / map / carton's page / Miles Nordin <carton@Ivy.NET>
Last update (UTC timezone): $Id: macos-casesensitive.html,v 1.2 2008/06/03 23:23:46 carton Exp $