mac.column.ted: The trouble with creating bootable drives and discs [Part 2]

mac.column.ted: The trouble with creating bootable drives and discs [Part 2]

Ted Landau
December 2006

In last month's column, I described the hurdles that Mac OS X puts in your way when you try to create a bootable disc, especially a custom bootable CD, DVD or flash drive. I offered various solutions but omitted coverage of one critical category: a custom bootable disc that you can make yourself (that is, without having to purchase any specialized third-party software) and from which you can launch your preferred selection of utilities. That's the entire subject of this month's column.

Create a custom bootable CD or DVD

Here are the step-by-step "do-it-yourself" instructions for creating your own custom bootable Emergency Toolkit disc:

Step 1: Get a third-party bootable disc.

Perhaps this reminds you of the old joke: "How do you make ten million dollars in less than a year? Step 1: Start with 9 million dollars." Yes, I admit it. This appears to break my promise that you won't need to purchase any additional software. My escape clause is that you don't need to buy software that is just for this purpose. That is, many people already own the required bootable disc, because they wanted a repair utility, such as DiskWarrior or TechTool Pro, that exceeds what Apple's Disk Utility can do. If you are one of these people, you are good to go. If not, you'll need to get a disc. There is a possible alternative that I mention later; but having the disc is the preferred way to go.

By the way, the reason you need a third-party disc, rather than simply using a Mac OS X Install disc, is that third-party discs include two files that are critical for launching an application other than the Installer on startup. These files are not on Apple's Install discs. There may be ways to circumvent this (such as by directly modifying the file that calls the Installer utility), but I did not explore this route.

Also, though it may seem obvious, make sure that the third-party bootable disc you are using meets requirements to actually boot your system. Some discs are PowerPC-only and can't boot Intel-based and vice versa. Also, some discs don't have software new enough to boot the latest Macs (there is a way around this limitation in some cases, which we'll discuss later).

Step 2: Use Disk Utility to make a read/write image of the bootable disc (see last month's column, if you need help here).

Step 3: Mount the disk image and go to its /Applications folder. Delete any applications located there that you don't want on your final disc.

Note: There may be invisible items in this folder. To delete them, use any utility that allows you to temporarily make invisible items visible (such as the freeware InVisibles) and drag the unwanted files to the Trash.

Step 4: Copy the utilities that you want on the disc to the Applications folder. Include QuickerPicker as one of your utilities.

You are of course limited by what can fit within the size limits of the CD or DVD that you intend to burn. Also, some utilities may not run -- under any circumstances -- when you boot from a optical disc. This issue resulted in the first obstacle on my road to success. An essential application was an application launcher. This is the program that would actually open at startup and thereby provide access to all the other applications on the disc. I downloaded about a half-dozen potential candidates (including Path Finder and QuickSilver) and tested each one out. All failed except one. That is, when I burned and tried to boot from the disc, the system would crash at the point of trying to load the launcher application (the general causes of such failures are covered in my previous column). The lone exception was the aforementioned freeware utility called QuickerPicker. I may have missed others that would work as well, but I stopped my search at this point.

Essentially, QuickerPicker auto-generates a list of all the applications in the startup disc's /Applications folder and allows you to launch any of them. Obstacle solved!

Step 5: Modify the disc so that it will launch QuickerPicker at startup. This is the key step of the entire process. To do this, locate the icon for the etc folder (at the root level of the disc) and open it. Inside, you will find a file named rc.launchapp. Using any text editor (Mac OS X's TextEdit will do), open the file.

The exact contents of the file will vary depending upon which original bootable disc you chose. However, they all include a line that contains the absolute path to the executable file of the utility that launches at startup. The line may consist of just the path name or it may start with something like MYMACHOAPPBINARY = followed by the path name in quotes. In either case, this is the line you need to change. Change whatever path is listed to the absolute path for QuickerPicker's executable file:

/Applications/QuickerPicker.app/Contents/MacOS/QuickerPicker

Save the modified rc.launchapp file.

Note: There are most likely only three lines that are critical for the rc.launchapp file to work. This means, you could create this file yourself from scratch, rather than copy it from another disc. Here's how:

  1. Launch TextEdit. From the Format menu, select Make Plain Text.
  2. Enter the following three lines:
    #! /bin/sh
    /Applications/QuickerPicker.app/Contents/MacOS/QuickerPicker
    /sbin/reboot
  3. Save the file as rc.launchapp. A .txt extension will likely be added to the name. From the Finder, select Get Info for the file and delete the .txt extension from the Name & Extension field.
  4. Make the file executable. You can do this by using the chmod command in Terminal (I'm omitting the details here) or via any of several shareware and freeware utilities. My preferred choice is XRay, even though it is not free. Use XRay to open the rc.launchapp file, then go to the Permissions section and enable the Execute bit for Owner, Group, and World.
  5. Eliminate any Type and Creator codes for the file. This can also be done with XRay (as well as with Terminal or with any of several freeware/shareware alternatives). To use XRay, go to the Type, Creator & Extension section and clear out any Type or Creator entries there.
  6. Save the rc.launchapp file. At this point, the icon for the file should change to the same UNIX Executable icon as the rc.launchapp files on existing bootable discs. The file is now ready to replace the rc.launchapp file on your custom disc.

Step 6: Launch Disk Utility, select the disk image from the column on the left and click the Burn icon in the toolbar. Burn the disc.

Step 7: Boot from the newly burned disc. The easiest way to do this is to leave the disc in the drive, select to restart and hold down the C key as soon as you hear the startup tone. If all went well, QuickerPicker should appear within a few minutes.

Create a custom bootable flash drive

While doing research for this article, so many DVDs wound up as coasters (not to mention the time wasted waiting for each DVD to burn) that I sought out a cheaper and faster alternative. The solution turned out to be my USB flash drive. On Intel-based Macs, you can boot from these drives.

The actual procedure is almost the same as working with a CD or DVD. The only difference is in the last two steps, which are as follows:

Step 6: Launch Disk Utility and select the Restore tab. Locate the name of the modified .dmg file in the list on the left of the window. Drag it to the Source box. For the Destination, drag the listing of USB flash drive volume. If there is anything on the drive, enable the Erase Destination checkbox. Click to Restore.

Note: The size of the dmg file may be larger than the capacity of your flash drive. For example, I had a 1GB drive but the DVD image was the standard 4.7GB. That's okay as long as the total space used on the disk image is less than the size of your drive. This is because only the used content should get copied. For example, in my case, I got the total used space down to about 950MB. For reasons I never figured out, Disk Utility would sometimes attempt to copy the entire 4.7GB of the disk image and thus fail. But if I tried again, it would usually succeed.

Note: If your flash drive is not already formatted as a Macintosh volume, reformat it before doing the Restore. To do so, select the drive from the list in Disk Utility, click the Erase tab, select "Mac OS Extended (Journaled)" as the Volume Format and click the Erase button. Interestingly, it was not necessary to partition the drive as a GUID Partition Table (via the Options in the Partition tab); it worked fine using the Apple Partition Map even though Apple recommends using GUID for booting on an Intel Mac.

Step 7: With the flash drive mounted in a USB port, restart your Intel Mac. Hold down the Option key at startup. From the screen that appears, click to select the flash drive as the startup device. QuickerPicker should soon appear.

As an added bonus, which was key to facilitating my experimenting, working with a flash drive means you can make changes to the contents of the drive without the hassle of having to reburn a DVD each time!

Choose your Mac OS X version

One last obstacle emerged during my testing ? after I received my new Core 2 Duo MacBook Pro. These latest models will only boot from Mac OS X 10.4.8 or later. Unfortunately, all the third-party bootable discs I currently own use Mac OS X 10.4.7 or earlier. This meant that the above procedures would not succeed on my new machine.

Not willing to give up in defeat, I found a solution. The procedure can apply to any similar situation where you want to use an OS version other than the one on the third-party bootable disc. Here's what to do:

  1. Start with a Mac OS X Install disc that contains the OS X version you want to use. Make a read-write image of the disc. In my case, I used the Mac OS X Install 1 DVD that came with my MacBook Pro.
  2. Delete non-essential contents from the disk image. In my case, I wanted to get the total used space to be less than 1GB (so it would fit on my 1GB flash drive). This was accomplished by deleting all the items in the /Applications and /System/Installation/Packages folders (including invisible items).
  3. Add the desired applications, including QuickerPicker, to the /Applications folder (again, making sure the total used space stays below the size of your destination drive).
  4. From any Mac OS X 10.4 third-party bootable disc (even one that contains an older version of OS X!), locate the two essential files in the etc folder: the aforementioned rc.launchapp and a file called rc.cdrom.postWS.
  5. Copy these two files to the etc folder of the disk image. Modify the rc.launchapp file to point to QuickerPicker, as described above.
  6. Use Disk Utility's Restore command to copy the modified disk image to the flash drive, again as described above.

When I did this, the resulting flash drive booted successfully from Mac OS X 10.4.8 and launched QuickerPicker. You could presumably use a similar procedure to create a bootable DVD. Unfortunately, this was less than a complete success. The biggest problem (and it is indeed a big one!) was that I could not get any keyboard input to be accepted by any application (except QuickerPicker itself). Only mouse input worked. The reason remains a mystery for now, although I suspect that using the Install Disc as the starting point is not a good idea after all. I am still working on this.

Finishing up

You now know how to create a custom disc or USB flash drive that can boot and launch your own desired set of utilities ? within limits. Yes, you could accomplish a similar feat using a utility such as Clone X 2 (as described in my previous column). But now you know how to do it yourself with greater flexibility and probably less cost. At the very least, you hopefully know more about how these bootable discs work than you did before.

In brief, to create a custom bootable disc or flash drive, all you need is (1) any bootable disc (even a Mac OS X Install disc, in some cases) and (2) the rc.launchapp and rc.cdrom.postWS files from a third-party bootable disc. The rc.launchapp file is so simple, you can create the needed modified version yourself (as I described above). Even the rc.cdrom.postWS file is only a few dozen lines of code. You could similarly make your own version of this file. Still, these files are copyrighted by Apple ? which means that Apple would likely frown on any public distribution of these files (self-made or copied) or discs made using them. So restrict the results of your handiwork here to just yourself!

Finally, I don't assume that my experimenting has necessarily uncovered the best ways to accomplish the desired goals. If you know of alternative better solutions, I would like to hear about it. You can send me an email message or post a comment.

Update: In last month's column, I stated: "Micromat's TechTool Pro ships on a single DVD that contains two separately mounting partitions. One partition contains PowerPC software and the other Intel software." After the article was posted, I received a newer update (version 4.5.2) that contains only a single partition and presumably mounts on both Intel and PowerPC Macs.

This is the latest in a series of mac.column.ted columns by Ted Landau. To see a list of previous columns, click here. To send comments regarding this column directly to Ted, click here. To get Ted's latest book, Mac OS X Help Line, click here.

Resources
  • last month's column
  • InVisibles
  • QuickerPicker
  • XRay
  • last month's column,
  • click here
  • click here
  • click here
  • More from Mac Musings
  •  

    Join the discussion

    Conversation powered by Livefyre

    Show Comments Hide Comments