Is there a way to create a shortcut (that I can place on the Dock, perhaps) that will restart OS X with the Bootcamp partition?

This would be similar to going into System Preferences/Startup Disk and then choosing the partition and hitting Restart. I don't want to use Automator to do this unless I can do it without popping up a bunch of windows.

The funny thing is that Windows has a tray shortcut for this, but I've found nothing equivalent on the OS X side.

Thanks!

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

There are a couple options:

One - when you restart you can hold the 'Option' key down and then choose Boot Camp - however this is a temporary selection so if you restart again it will start back up in OS X (or whatever the selected startup disk actually is).

Two - You'll need to find out the disk ID by running df -k - more than likely it is /dev/disk1s3 if you have partitioned your hard drive but you'll want to double check. So change the '#'s in the following command to the appropriate numbers:

sudo umount /Volumes/NAME_OF_YOUR_WINDOWS_DRIVE
sudo bless -device /dev/disk#s# --legacy --setBoot
#You could use -folder but this assumes the drive is always mounted and writeable
#Then a slightly cleaner restart than shutdown -r (which sends a kill message)
osascript -e 'delay 1
 tell application "System Events" to restart' &

You can save that as part of a shell script or use Platypus to create an actual runnable application that will run the shell script for you.

Additionally there are other options listed on MacOSXHints

link|improve this answer
You may also want to look at this earlier hint from MacOSXHints: macosxhints.com/article.php?story=20070126131322301 – Clinton Blackmore Jun 23 '09 at 16:09
I always miss hitting the Option key at startup :) – Corey Ross Jun 23 '09 at 16:19
Works like a champ! I wish I could give a second upvote for the alternative suggestion to 'shutdown -r' – Corey Ross Jun 23 '09 at 16:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.