Link to home
Start Free TrialLog in
Avatar of myang999
myang999Flag for United States of America

asked on

Apple script: How to boot to other volume

I need snippet to boot to other volume such as 'TEST'
Avatar of myang999
myang999
Flag of United States of America image

ASKER

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'.
Avatar of Eoin OSullivan
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


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?
ASKER CERTIFIED SOLUTION
Avatar of ogcyborg
ogcyborg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are the Champ!