How to Change a startup disk in Mac in Command line

sudo bless -mount /Volumes/”name of your startup disk” -setBoot

So, if the desired disk was named “TestDisk” you would type this:

sudo bless -mount /Volumes/TestDisk -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/My Disk” -setBoot

You can incorporate this into a UNIX shell script to reboot your machine to another disk at a certain time. Perhaps you want to reboot to another disk every Friday to run a disk utility on it, or to image it.

bless -mount /Volumes/TestDisk -setBoot
shutdown -r now