Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

17 October 2006

Set Boot Volume in the command line

I haven't found this anywhere, so I will throw it out to the Googlesphere here.

Say you want to restart a Mac and boot from CD. Say it doesn't have a display and keyboard attached and you don't have Remote Desktop around (you should though).

You can always ssh in and do the following: Insert the CD. Run diskutil list to see wether the CD mounted and note the partition number (something like /dev/disk1s2 though the numbers will vary. Then to actually set the next boot drive use:

sudo bless --device /dev/disk1s2 --setBoot

and do a sudo reboot to restart. There is also a --mount option which will take the mount point, e.g. "/Volumes/Mac OS X Server Install/". To do a Netboot do:

sudo bless --netboot --server bsdp://255.255.255.255

You can replace the 255's with the NetBoot server's IP address if you want to boot off a specific server.

The bless command has another option --nextonly which will only remember the setting for one boot. Read the bless man page for more details.