What for the AppleScript line breaks in the code. Make sure you change the disk name to your disk. Paste this code in Script Editor and run it. You can wrap all of this up in an AppleScript and either save it on your desktop as an application or save it as a script and put it in your Script menu. For example, you have a partition with 10.3 and another with 10.4 on it and you want to test some software in 10.3. This command also comes in handy if you’re booting back and forth between volumes to test things. That will boot the machine to that volume first and then boot back to the original volume on subsequent reboots without having to reset the startup disk. If you have an Intel Mac you can add “–nextonly” at the end of the “bless” line. The second line tells it to shutdown and restart immediately.
Perhaps you want to reboot to another disk every Friday to run a disk utility on it, or to image it.īreaking down this script the first line sets the disk your Mac will boot from. You can incorporate this into a UNIX shell script to reboot your machine to another disk at a certain time. Sudo bless -mount "/Volumes/My Disk" -setBoot If your disk name has spaces in it you’ll need to put quotes around the path to the disk, like this: Sudo bless -mount /Volumes/TestDisk -setBoot So, if the desired disk was named “TestDisk” you would type this: Sudo bless -mount /Volumes/"name of your startup disk" -setBoot To change the startup disk type the following in Terminal:
To get the full story on “bless” open up Terminal and type “man bless” (no quotes).
The command for setting the startup disk using Terminal is “bless“. While it’s quite easy to change which disk your machine starts up from using System Preferences there may be times when you need/want to do it either at the command line or within a script.