• On The Insider: Britney's Bikini-Clad Top 10
advertisement
mySimon mySimon mySimon Outdoor Gear mySimon Swimwear mySimon Home and Garden
December 5, 2006 6:00 AM PST

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

by CNET staff
  • Font size
  • Print
  • 19 comments

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
  • Recent posts from MacFixIt
    Address Book: Search not working properly
    iTunes 9.0.3 breaks AirTunes connection for some
    Apple releases Aperture 3.0
    Manage iCal's automatic e-mail generation for invitations
    CNET TV Apple Byte: Apple faces critics
    Weekly Utilities Update: Net Monitor, MiniUsage, TimeMachineEditor, more...
    Odds and Ends: Essential video codec packs for OS X
    Address Book: Unable to add, view contacts
    Add a Comment (Log in or register) (19 Comments)
    • prev
    • next
    by Oink--2008 December 6, 2006 8:05 PM PST
    Thank you, thank you. The pointer to the rc.launchapp is just waht I needed.
    Reply to this comment
    by prolaw1 December 6, 2006 8:05 PM PST
    >
    This is a reply to a previous comment by Oink--2008


    After reading this article yesterday, it seemed like more than I wanted to do to create a startup drive. I created a bootable disk on an external firewire by using Apple's disk utility program and the install disk for the 17" C2D MBP. This is what I did...Hope it works for you. (You should assume this process wipes info on firewire drive...it may not but...assume it does)

    1. Connect fire wire drive (I used SmartDisk Firelite 20GB)
    2. Launch Disk Utility (Applications>Utilities>Disk Utility)
    3. Click top image of firewire drive
    4. Under volume information select format "Mac OS Extended (Journaled)"
    5. Select Partition...click on options...select GUID Partition Table...click OK
    6. Click "Partition" in the lower right. Quit Disk Utility.
    7. Insert Install Disk 1 that came with your computer (mine has 10.4.8 on it)
    8. Restart holding down "C" key to boot using Install Disk 1
    9. Select Language, install OS on Firewire Drive.

    Hopefully, there will be a green down arrow on the fire wire drive instead of the red stop sign I got before I formatted to GUID partition table. I then used options or customize to get rid of a bunch of programs, etc. not needed or to take up space (MS Office Test Drive, other languages, etc.....you choose what you may not want so the install will only take up a few GBs) (The install process took less than 10 minutes and was about 3 or 4 GB of stuff)

    10. To test your success, quit install, Reboot and hold down option key
    11. You should see your fire wire drive along with your computer's hard drive (and the Install Disk if you did not eject it)
    12. Double click on the firewire drive and you should go through the regular Install process as if it were a new computer. Enter your name, etc...
    13. You can now install 3rd Party Disk utility programs to firewire to use to fix your computer in that emergency situation or for regular maintenance.
    Reply to this comment
    by Oink--2008 December 6, 2006 8:05 PM PST
    >>
    This is a reply to a previous comment by prolaw1


    I think the discussion here is about creating a bootable CD-ROM/DVD. An external drive is handy and much faster, I have an external drive with both USB and FW interfaces and it has 3 partitions - a PPC boot, an Intel boot and a shared/blank one for rescueing files/drive. Both external drive and bootable Read-only media have their plus and minus'es. I am grateful for the detailed discussion
    Reply to this comment
    by Tracy Valleau December 7, 2006 6:34 PM PST
    Whew! This article sent me off on an odessy that consumed the next 10 hours... and still didn't succeed.
    I started off with the only single CD boot system I have: Drive Genius. I was able to move that to a flash drive without problems.
    Then the fun started.
    I tried to get TechTool Pro to run from it, but it wouldn't. Booted from a different drive, it says is isn't installed properly, and to re-install. OK... but The TTP installer will only install to the boot drive.
    Fine: boot from the flash drive... only to discover that it's write disabled. Nope - not a permission thing at all... if I mount the flash drive when booted from my hard drive, run disk utility and its getInfo, it says the drive is writable. If I run disk Utility from the flash drive when it's the boot drive, it says the drive is not writable... so something dynamic is happening; not something static like permissions.
    Anyone have any idea how to make a booted flash drive writable?

    Besides me not being able to install TTP on it (because of the write issues) for the same reason, it won't record my preferences, hence my serial numbers either... forcing me to re-enter the serial numbers every time!
    This happens on both a USB and a FireWire flash drive... makes no difference.
    HELP greatly appreciated!
    Reply to this comment
    by tethompsoncsrvtc December 7, 2006 6:34 PM PST
    >
    This is a reply to a previous comment by tracy valleau--2008


    I'm confused. You suggest using a USB flash drive.

    I thought that PPC or Intel Macs COULD NOT boot from USB. Which is it?
    Reply to this comment
    by Tracy Valleau December 7, 2006 6:34 PM PST
    >>
    This is a reply to a previous comment by tethompsoncsrvtc


    Intel Macs can boot from a USB flash drive.
    Reply to this comment
    by ted1--2008 December 7, 2006 6:34 PM PST
    >
    This is a reply to a previous comment by tracy valleau--2008


    I believe that all of the symptoms you cite may have a common cause.
    The software you are installing is designed to run from a CD or DVD, which is a read-only device. However, booting a Mac (and launching some applications after booting) requires writing to the drive (in the form of temp files, cache files, etc. etc.)

    To solve this, the boot software for CDs and DVDs create a RAM disk which in turn holds the temporary files. This means (and I am making some guesses here):

    1. You won't be able to save serial numbers when booted from the flash drive because they will be written to the RAM disk if they get written at all.

    2. Software that requires writing to the drive in order to work will not work when booted from CD/DVD software, unless the software somehow knows to access the RAM disk as needed. TechTool appears to have a problem related to this when you use the Drive Genius CD software. Why not use the TechTool Pro DVD as the start point for your installation instead of Drive Genius? That would certainly allow TechTool Pro to launch successfully.

    3. The fact that the USB drive is read-only when you boot from it is a surprise. I had never noticed that before. I will check on this on my own drive. But if it is indeed a general finding, I suspect that it is again due to the fact that we are installing boot software designed for read-only media.
    Reply to this comment
    by Tracy Valleau December 7, 2006 6:34 PM PST
    >>
    This is a reply to a previous comment by ted1--2008


    Thanks Ted

    I didn't know about the RAM drive point, but it makes sense.

    I believe that the TTP disk (stop me if I'm wrong) is actually two different images, one for PPC and one for Intel... which won't move over to my flash drive successfully (available space issues.) If the new $25 4.5.2 disk is a single boot, like the Drive Genius, then I'd probably pop for it...

    (Specifically, I'm trying to get my Protege, which is FireWire, to handle the dual boot scenario. It's only 990 megs however, whereas the USB is 2 gigs... but won't boot a PPC machine...)

    I'd come to the same conclusion re: the issue that I took my source from a RO device, but that hopefully means there's a pref somewhere that I can change. Obviously not a simple pref, but some file embedded in some library that says something like "if booted, write only = true."

    Or perhaps I'm dreaming... ;-)

    Happy Holidays!
    Reply to this comment
    by Oink--2008 December 7, 2006 6:34 PM PST
    >>
    This is a reply to a previous comment by ted1--2008


    Solved that. In the /etc/rc.cdrom file, there is a line that mounts the boot drive read-only. Change "mount -u -o ro /" to "mount -u /", I managed to solved the read-only as well as keyboard input issue.

    Tinkling along....
    Reply to this comment
    by ted1--2008 December 7, 2006 6:34 PM PST
    >>>
    This is a reply to a previous comment by Oink--2008


    YES!! Thanks so much.

    I made this change to my OS X 10.4.8 bootable USB Flash drive. It does indeed fix the problem with no keyboard input and the drive is definitely writable (I saved a TextEdit file while booted from the drive). Great!

    - Ted
    Reply to this comment
    by ted1--2008 December 7, 2006 6:34 PM PST
    >>>
    This is a reply to a previous comment by Oink--2008


    More success.

    The final piece of the puzzle for me would be to be able to launch the Finder (or a reasonable substitute) when booted from my 1 GB flash drive. Rather than try to get Finder itself to work (which I may still do later), I opted for Path Finder. As I noted in my column, Path Finder crashed on launch during my tests. But with my bootable flash drive in hand, I decided to find out why. And see if I could do something about it.

    After trying and failing to launch PathFinder (as expected), I launched Console and checked the Crash Reporter logs. It said the cause of the crash was a missing System/Library/Framework. So I simply copied the missing framework from my hard drive to the flash drive and tried again. This too failed, but now a different framework was cited as the cause. So I added this second framework as well. I kept repeating this cycle until I added about ten (10) frameworks.

    Finally, Path Finder launched from my flash drive and worked! At last!

    If you are interested in a list of all the frameworks I added, you can email me.
    Reply to this comment
    by Oink--2008 December 7, 2006 6:34 PM PST
    >>>>
    This is a reply to a previous comment by ted1--2008


    Path finder would be nice but last i checked, it is still 40mb, stripped of all other languages. With the list of extra frameworks you have installed, I wonder if Finder.app would launch. I stopped at the first "framework not found" error. It would be nice to have pathfinder on a DVD boot but right now, I am working on a minimal system for a 514MB - 1Gig flash drive.
    Reply to this comment
    by Tracy Valleau December 7, 2006 6:34 PM PST
    >>>
    This is a reply to a previous comment by Oink--2008


    FWIW, I switched over to the OS that came with DiskWarrior 4.0 CD, which arrived this morning. I now have Diskwarrior 4; Drive Genius; File Salvage; Photo Rescue and Disk Utility running on my Protege FireWire flashdrive. Ironically, what won't run is TechTool Pro...

    T
    Reply to this comment
    by MacHound December 8, 2006 4:39 PM PST
    I wonder if DiskWarrior 4.0 CD will be a better starting point for creating bootable drives than TechTool Pro?
    Reply to this comment
    by Tracy Valleau December 8, 2006 4:39 PM PST
    >
    This is a reply to a previous comment by MacHound


    it was for me (see above)
    Reply to this comment
    by ted1--2008 December 13, 2006 7:54 PM PST
    I have now taken a closer look at the rc.cdrom.postWS file. Most of its content appeared to be related to setting up stuff on a RAM disk. I suspected that this might no longer be needed when using a read-write flash drive, as I was now doing. So I went and deleted all the content of the file except the following:

    #!/bin/sh
    /sbin/SystemStarter
    [ -x /etc/rc.launchapp ] && sh /etc/rc.launchapp

    When I rebooted from the flash drive, it still worked just fine (and the mounted RAM disks that had previously appeared when viewed from Path Finder were no longer there).

    So it looks like you can construct a workable bootable drive by creating your own rc.launchapp and rc.cdrom.postWS files, each one just three lines long, and adding them to a Mac OS X Install disc image, thereby eliminating entirely the need to have a third-party bootable disc!!
    Reply to this comment
    by Oink--2008 December 13, 2006 7:54 PM PST
    >
    This is a reply to a previous comment by ted1--2008


    Any comment about the supposedly limited number of read/write cycles of flash media (google: flash drive read write cycle)? A million seems to be the highest quoted number but seems low as a boot drive or a ipod
    Reply to this comment
    by ted1--2008 January 5, 2007 11:17 AM PST
    In response to several email requests, I have created and posted an article that combines all the ideas from this column as well as the various posted comments afterward. It provides complete step-by-step details for creating a custom bootable flash drive, without the need for any third-party bootable disc as a starting point.

    Here is the link to get it: <a href="http://www.tedmac.com/books/helpline/Bootable_drive.html">Create a custom bootable 1GB flash drive</a>.
    Reply to this comment
    by slboettcher January 5, 2007 11:17 AM PST
    >
    This is a reply to a previous comment by ted1--2008


    THAT'S the ticket!
    Thanks Ted, works like a charm on a new Mac Pro!

    Scott
    Reply to this comment
    (19 Comments)
    • prev
    • next
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader