Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Faster startup disk selection System
If you're like me you get tired very quickly, of waiting for the Startup disk Preference pane to load. A much faster method, is to use the Terminal command "bless" with which you can quickly and easily change your startup disk.

To change your startup disk to OS 9, type this in a terminal window:
 sudo /usr/sbin/bless/ -folder9 '/Volumes/Mac OS 9/System Folder' -setOF
NOTE: Replace "Mac OS 9" with the name of your Mac OS 9 partition.

To change your startup disk to OS X:
 sudo /usr/sbin/bless/ -folder '/System/Library/CoreServices' -setOF
I put this into an AppleScript to make it even easier by calling a "do shell script" command. This sure has saved me a lot of time getting around the "Startup Disk Pref Pain". For more information regarding "bless" launch the "Terminal" and type "man bless" (without the quotes) for the "bless" manual pages.

[Editor's Warning: If you're relatively new to the command line, you may want to make sure you understand what you're doing before trying this hint. "man bless" will give you an overview of instructions as a starting point.]
    •    
  • Currently 2.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[19,919 views]  

Faster startup disk selection | 14 comments | Create New Account
Click here to return to the 'Faster startup disk selection' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Good!
Authored by: zs on Mar 03, '02 12:08:08AM

Works like a charm.
It can also be done through aliases in the terminal if that is the preferred method.

Here's what I've added to my ~/Library/init/tcsh/aliases.mine

alias nine "sudo bless -folder9 '/Volumes/Homer/System Folder' -setOF"
alias ten "sudo bless -folder '/System/Library/CoreServices' -setOF"

Type 'nine' for OS 9 and 'ten' for OS X. This works nicely for me because I've always got a terminal window open.

I'm also working on an AppleScript to do this, but I always like to make things more complex than they need to be. Anyone know of a way to get the currently blessed system folder?



[ Reply to This | # ]
Good!
Authored by: maclaw on Mar 03, '02 12:56:52AM

Not a real answer to your question, but a possible lead...

I know that the command "nvram -p" will show a list of all currently defined variables in the NVRAM. Among these is the variable "boot-device" though I haven't identified whether something about its value as a string should tell you which system folder, or partition, you are booting from. Seems it should. I rarely use the bless command but perhaps checking before and after using "bless -folder9' and then before and after switching back with "bless -folder" will show an indentifiable trend in the NVRAM settings. Make sure you are setting the command in Openfirmware (e.g. -setOF) if you are going to try.



[ Reply to This | # ]
Getting startup folder with bless
Authored by: jlowrey on Mar 03, '02 01:48:47PM

I found this to work:

bless -info /



[ Reply to This | # ]
Getting startup folder with bless
Authored by: zs on Mar 03, '02 11:32:16PM

jlowrey: bless -info / seems to spit out the same info regardless of which folder is blessed. I have OS 9 on a separate partition, so I'm wondering if this just works if it is blessed on the same partition.

maclaw: the boot device listed after an nvram -p just changes the number after "@0:" when switching startup disks. I don't think I want to dig into that too much right now. Interesting none the less.

I guess this just means I'll have a script that doesn't select the currently blessed system folder by default. I'll have the script posted in the forums site as soon as I'm finished.

Thank you both for your responses. Digging into the system proves to be fun and interesting!

zs



[ Reply to This | # ]
Getting startup folder with bless
Authored by: maclaw on Mar 04, '02 02:06:34AM

For me, bless -info / distinguishes between OS 9 and OS X by giving the full path to the System. Also, it is necessary to identify both the OS X startup system and the classic folder you want or Classic may not work when switching back to OS X.

Anyhow, I posted my final (for now) version of a script that both reports which system you are currently set to boot into and also offers you button choices for the system that you want (with the default button being the opposite of how you are currently set to boot). It could certainly be expanded for more complex setups, but, to conserve space, the version I posted gives only two options (one for OS 9 and one for OS X).

Others have contributed their own variations in the same forum thread. Pick the one that works for you!



[ Reply to This | # ]
Does not work for the same partition
Authored by: kevyang on Mar 03, '02 08:00:03PM

This does not seem to work if both OS9 and OSX are installed on the same partition. I "blessed /System Folder" and OS9 booted up halfway.

BTW, a faster way to use the Startup Disk Preference pane is to click on the OS icon once it comes up then hit Cmd-Q and Return immediately before it starts scanning the disk.

Also, a faster way to boot X from OS9 is to hold the 'x' key down while rebooting and release it when you see the first grey screen.



[ Reply to This | # ]
not the first time, but...
Authored by: meancode on Mar 03, '02 08:59:15PM

it will work the second time you try to boot into OS 9 from the X, when 9 is on the same partition. i varified this. look at my post on the forums site.



[ Reply to This | # ]
here is an apple script
Authored by: meancode on Mar 03, '02 06:47:33PM
i posted this at the forums site, i might as well post it here.
tell application "Finder"
	activate
	display dialog "Change your startup disk to:" buttons {"Mac OS X", "Mac OS 9.1", "Mac OS 9.2.2"} default button "Mac OS 9.1"
	set the user_choice to the button returned of the result
	if the user_choice is "Mac OS X" then
		do shell script "/usr/sbin/bless -folder '/System/Library/CoreServices' -setOF" password "YourAdminPW" with administrator privileges
	else if the user_choice is "Mac OS 9.1" then
		do shell script "/usr/sbin/bless -folder9 '/Volumes/Mac OS 9/System Folder' -setOF" password "YourAdminPW" with administrator privileges
	else if the user_choice is "Mac OS 9.2.2" then
		do shell script "/usr/sbin/bless -folder9 '/System Folder' -setOF" password "YourAdminPW" with administrator privileges
	end if
end tell


[ Reply to This | # ]
here is an apple script
Authored by: tbasco on Apr 09, '02 08:00:35AM

Here is what I wanna do:

ell application "Finder"

activate

do shell script "/usr/sbin/bless -folder9 '/Volumes/Mac OS 9/System Folder' -setOF" password "xxx" with administrator privileges

restart

end tell

But when I try the script, it won't quit and the logout is timed out because of that.

Can somebody please tell me what's wrong?



[ Reply to This | # ]
ummm
Authored by: pyrohotdog on Mar 18, '02 11:22:35PM

thats all good, but how do i do that over a network? like ssh or something?



[ Reply to This | # ]
ummm
Authored by: koncept on Jan 26, '03 06:17:51PM

I remember from a long time ago that it is possible to script over a network with something like this:

tell application "Finder" of machine "some machine" in zone "some zone"
<do stuff here. . .>
end tell



[ Reply to This | # ]
Faster startup disk selection
Authored by: earthsaver on Jan 18, '06 10:40:52AM
In Tiger (perhaps Panther, too),
usr/bin/
either is not the location of the command or just doesn't work. The
bless
command, however, is available at a regular prompt and can be used without specifying the directory.

---
- Ben Rosenthal
Q16 1.25 - Tiger

[ Reply to This | # ]

Faster startup disk selection
Authored by: ziggytrix on Apr 25, '06 12:00:04PM

it's in "usr/sbin"
not "usr/bin"

at least on 10.4.6



[ Reply to This | # ]
Faster startup disk selection
Authored by: mithras on Apr 26, '06 06:29:18AM

Anyone have an update of this hint for dual-booting Windows? What would the 'bless' command look like?


---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)



[ Reply to This | # ]