Mar 06, '07 07:30:00AM • Contributed by: marco.trive
A month ago, I started an "uptime race" with a friend (who is using a Windows XP PC). Since I'm using both Mac OS X (which is my main OS) and Linux, soon I was hating the idea of not being able to boot and use Linux. So I've come up with a simple (and obvious) way to boot Linux without losing my Mac OS X uptime.
Definitions and prerequisites
- Deep Sleep = Safe Sleep = Hibernate mode = Suspend to disk
- If your PowerPC Mac is not one of the latest 15- or 17-inch PowerBook G4s, you have to manually enable Safe Sleep, and it may not work on all models.
- Download one of the apps to go straight to Safe Sleep, like the widget DeepSleep or the script SuspendNow!. Actually, this isn't strictly necessary: you can also put your Mac to sleep and then remove the battery (on a laptop) or unplug the AC cord (on a desktop) to make it go to Deep Sleep.
Editor's warning: If you're going to try this hint, please do so with a current backup, and at your own risk. I tried it on my MacBook Pro (see my note at the end), and it seems fine after a few trials. However, who knows what might happen when cycling between two OSes like this, so you're on your own if you proceed and your machine turns into a quivering blob of plasma...]
The Easy Way (PowerPC and Intel)
- Power on your Mac and press Alt/Option
- Choose the system to boot
- If you choose Linux, when you'll shut it down and the turn your Mac on again, your computer will wake from deep sleep (just like nothing really happened).
- Write down the number of the Mac OS X and bootloader (like Yaboot) partitions. In my case, I have Yaboot on /dev/hda2 and Mac OS X on /dev/hda12.
- Put your mac to Safe Sleep.
- Power on you computer and immediately press Command-Option-O-F. Note that if you have security mode set to "full," this step is not needed, as it will happen automatically.
- You will se a command prompt; just to be sure type printenv. If needed, insert your password. Now jot down the value of boot-device. In my case (Mac OS X is on the twelfth partition of my disk), it is /pci@f4000000/ata-6@d/disk@0:12,\:tbxi. Be careful! The value is not /pci@f4000000/ata-6@d/disk@0:12,\:tbxi \:tbxi; the line just says what the actual value is, plus the default value (\:tbxi).
- You now have to change boot-device to the value of the bootloader partition (or directly to the number of the Linux partition you only have two OSes). In my case:
Be careful -- there's only one backslash.setenv boot-device /pci@f4000000/ata-6@d/disk@0:12,\:tbxi - Type mac-boot and press Return.
You may be wondering: why should I take the geek way? There are two reasons:
- You may want to show that even on a Mac you can do complicated things :)
- You have security mode set to "full," and the easy way doesn't work.
[robg adds: Note that I tried this with my MacBook Pro and Windows XP in Boot Camp, and it did not work. When I first tried it, OS X was set to use Windows XP as the startup disk. When I pressed the power key from Deep Sleep mode (with or without the Option key held down), Windows would boot, seemingly leaving me stuck in Windows (since the Option key was being ignored). To get out of this loop, I set the startup disk (using the Apple-supplied Control Panel in Windows XP) to OS X and rebooted. When I did, OS X booted from a cold start, ignoring my deep sleep state.
Then I switched the startup disk in OS X to my OS X partition, and tried again. This time, when waking from deep sleep, the Mac simply woke from deep sleep, again ignoring the Option key. I tried various combinations, including restarting instead of shutting down in Windows XP, but all to no avail. So it seems, at least on my sample size of one unit, that this trick won't work on a MacBook Pro.]
