Apple script: How to boot to other volume

I need snippet to boot to other volume such as 'TEST'
Who is Participating?
this will do it.  Just replace the name of the volume with the one you want;
do shell script ¬
 "bless -mount \"/Volumes/Name of the drive\" -setBoot" ¬
 with administrator privileges
do shell script "shutdown -r now" with administrator privileges

Open in new window

myang999Author Commented:
I need Apple script snippet to boot to other volume such as 'TEST'.
For example, I am in volume '10.5' and want to boot into volume 'Test'.
Eoin OSullivanConsultantCommented:
Are you talking about changing the startup disk?

In the System Preferences, Startup you can select an alternative volume if it has a valid OSX system and when you reboot it will boot from this volume.

Do you want an Applescript to change the Startup Disk to an alternative Volume?

You'll need to use a Shell script as this is pretty core functionality in OSX.

Assuming your alternative Volume is ready you want to run a command like

sudo systemsetup -setstartupdisk /Volumes/< name of drive you wish to boot to >/System/Library/CoreServices

This will prompt for root/admin password
Then when you reboot the selected Volume will be the boot system.

For more info and options .. in Terminal type

man systemsetup
man bless

myang999Author Commented:
I ran following script and get "Set Startup Disk to Path : /Volumes/Restore/System/Library/CoreServices" message from Terminal.

tell application "Terminal"
      do script "sudo systemsetup -setstartupdisk /Volumes/Restore/System/Library/CoreServices"
end tell

How can I set Startup disk path?
myang999Author Commented:
You are the Champ!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.