# Startup Disk not working from Mac OS X (works in 9 though)



## jiblet (Dec 12, 2000)

Okay, I have a stock G4-400 w/ 128 RAM and 20g HD that I ordered November 28.  I installed a few things like Stuffit Deluxe 5.5, Photoshop 6, Quake 3 Demo, etc.  THen I installed the OS X Public Beta.  Worked great right after installing.  I poked around checking out the coolness, then I shut her down.  

Later when I turned it back on it gave me the dreaded question mark and I heard it repeatedly trying to access the HD.  This had me worried.  After starting off my OS 9 CD and choosing OS 9 to startup from the new startup disk control panel that had been installed in the OS 9 folder it worked great.  Selecting OS X also worked.  But every time I opened up the Startup Disk control panel from OS X it crashed, and when I restarted I had the original question mark problem.  

I guess the obvious answer is to install on seperate partitions, but does anyone else have any further insight on this?


----------



## theed (Dec 20, 2000)

I don't have this solved, but there seems to be an issue of blessing and unblessing the system folder.  When you select one OS to boot on a partition, it unblesses another system on the same partition.  

I know I've had to choose an OS9 folder to start from under X in order for the blue box to boot from it.  

I don't know if this helps you or not, but right now, I'd recommend seperate partitions, or even better, drives for the two OSes.  They seem to have just a little too much in common to want to share a partition.


----------



## jiblet (Dec 21, 2000)

About 2 hours after I posted that message I split my HD into 2 partitions and re-installed all my software.  I figure it's better to get it over with now before I get a lot of files and prefs set and whatnot.  

Not to mention that I don't really want my OS 9 residing in the BSD directory structure for no reason.  Now that I've done that I'm lovin OS X.  I hope it brings more people to the Mac than it drives away, because it really is my dream OS (cept mb BeOS, but that never got off the ground really).


----------



## zpincus (Dec 22, 2000)

I've had this problem, too, and the partition scheme doesn't seem to affect it. I have a separate drive for OS X, and a multiply partitioned OS 9/data drive. Yet still, one day the startup disk panel would load all the possible system folders into the window, then crash.

Pretty lame.

I read on some forum that this is due to some filesystem corruption that occasionally occurs (invalid node zero somethingies? filseystems aren't my strong suit...)

Anyhow, the disk first aid type tool in OS X should fix it. If not, then maybe booting from the OS 9 CD and running that disk first aid. Or Techtool? I think that under some circumstances, Norton thrashes OS X disks, so do some checking before running Norton.
Anyhow, I ran a bunch of disk tools and that fixed the problem. 

Note: Later, I read this thread which gave me a way to circumvent system disk entirely. Basically I used the terminal command "nvram -p" to get the boot variables for both an X startup and a 9 startup (note: you need a functional system disk panel in X to do this). I then used "diff" to compare the differences in the files, and made a double-clickable shell script to toggle between the boot system. If you want, I'll post a cookbook method to do the same.

Zach


----------



## speedy (Dec 27, 2000)

please make detailed instructions for making those scripts, it's what i've been looking for since I can't authorize myself anymore in the system prefs...

please

you can submit it to macosxhints.com or some other cool site


----------



## zpincus (Dec 27, 2000)

Here's the best I can do. Please *be careful* -- I'm giving directions that require playing with dangerous tools.
Also, my OS X box, which I'm using remotely seems to have crashed or something so I can't check these instructions to make sure they're exactly right... 

In order to make these scripts, you have to have a working "system disk" preference pane in OS X. I know, sort of a chicken and egg thing. Anyhow, Speedy, I'm a bit worried about the fact that you can't authorize yourself in the System Disk pane. It is strange indeed that you can login but not authorize with the little lock button... will "root" and the password authorize? How about making a new user with admin priviledges? (Of course, that requires authorizing in the Multiple Users app... does it not work in any pane/application, or just in the System Disk? Is caps lock on?)

OK, once you get that straightened out, here goes the "recipe:"

*Caveat* This could quite possibly break something. Especially since I don't have an OS X machine in front of me to check my work. You should be comfortable with the terminal, and OS X, and the prospect of reinstalling it if this goes wrong. Your disk should be backed up. Also, if you are unfamiliar with any command, type *man command* (where "command" is replaced with the command you want to learn about).
Note that the command "nvram" may not be in your path. If typing *nvram -help* into the terminal doesn't spew out a list of options and instead returns "command not found" you'll have to type "/usr/sbin/nvram" every time I tell you to type "nvram" -- sorry, but I'm working from memory here. 
Also, you might need root priviledges to even run nvram, so if the terminal says something to that effect, you'll have to type "sudo nvram" or "sudo /usr/bin/nvram" and then enter the root password whenever you want to run nvram.

 Without further ado:

1) Set the system to reboot into OS X in the System Disk prefs panel.
2) Open the terminal.
3) Type *nvram -p > osXboot.nvram*
(This runs the command "nvram -p" which prints out the contents of the nvram, where the boot variables are stored. The command then redirects the output from the screen into the file osXboot.nvram. The file name is unimportant.)
4) Set the system to reboot into OS 9.
5) Type *nvram -p > os9boot.nvram* in the terminal.
6) Type *diff osXboot.nvram os9boot.nvram*
(This compares the differences between two files. If differences are found, then it prints the line number that the difference was found on, and if it was a change or a deletion, etc. Then it prints "<" and the changed line from the *first* file. Then you get three dashes. Then it prints ">" and the changed line in the *second* file. Check the man pages on diff if this is unclear.)
So you should get an output like:

```
22c22
< boot-device /pci@f2000000/pci-bridge@d/mac-io@7/ata-4@1f000/@0:10,\\:tbxi
   ---
> boot-device /pci@f2000000/pci-bridge@D/mac-io@7/ata-4@1f000/@0:9,\\:tbxi
```
This is telling you that the nvram variable "boot-device" is different for booting into X and 9. The confusing garble afterward is what makes it boot into X (top line) or 9 (bottom line).

The output looks like this if you are on a B&W G3 or later. A beige G3 and maybe some early iMacs will spit out something totally different. Don't worry. It's still correct.
There may be additional changes, too, if you need to boot off a different partition or disk. If there are, you need to take them into account, too.
7) OK, still with me? Now, open up a new terminal window and type *pico 9boot.command* -- this opens an easy text editor and makes a new file called "9boot.command". You could do it in text edit, but I'm not sure if it saves with UNIX hard returns correct. Pico does.
8) OK, now we're editing our script -- basically  a text file with shell commands that gets run whenever you run it from the terminal, or (if its name ends with ".command") when you double-click it from the finder.
Now, type *sudo nvram boot-var="contents"* into pico, where "boot-var" was the changed variable and "contents" is the contents of that variable that the *bottom* line of the diff output gives. (Bottom line = second file = os 9 booting nvram).
You may not need to quotation marks if there are no spaces in the boot variable's contents. Also, if you need to change multiple variables, you might be able to do this like *sudo nvram boot-var1="contents1" boot-var2="contents2"*, or you might need to do it on separate lines. I can't remember -- you'll have to experiment.
9) If you want the script to automatically restart (not recommended until you get it debugged) you need to include the line *sudo shutdown -r now* at the end.
Note that each time the script calls the sudo command, you have to type the root password, *unless* you edit the file /etc/sudoers (I think?) and add your username. Then you just have to type it once, I think... 
10) Now, type control-O to save the file. (here on out, control is abbreviated as ^, to go along with UNIX convention). Press return if you need to confirm the name. Type ^-X to exit.
11) Now, the system does not think that the script is an executable! To make it so, type *chmod +ax 9boot.command*. "chmod" changes the file data so that "a"ll users are given (hence the "+") the e"x"ecute priviledge on the file.
12) To run the script, type *./9boot.command* into the terminal (from the directory in which the file is saved). You need to include the "./" so that the system knows to look for the command in the current directory (known as "."). Or you can double-click it from the finder.

IMPORTANT DEBUG TIPS
1) Repeat this and make a script to reset the boot-vars back to the OS X state. This may be helpful.
2) Reset the boot system to OS X from the preferences panel. Now, try running the 9boot script (without the restart option!) and then dump the nvram contents into a different file. (ie: *nvram -p > 9script.nvram* Use diff to compare the 9script.nvram file with the 9boot.nvram file, which we know to be accurate. If there are any differences, you're in trouble! Do the same for the X boot script.

If your system becomes farked after this, here's what to do:
1) Restart with the OS 9 CD. 
2) Restart holding command-option-P-R and let the machine chime a couple of times before letting go.

Thus concludes the recipe. *Note well: This may lead to a damaged or unbootable (though not unfixable) system. My instructions may contain errors. They probably do. I'm working from memory. So don't do this until you feel comfortable with every command listed here. DO NOT follow these instructions without understanding what they do! There are many OS X UNIX FAQ's to get you up to speed on all of the cryptic garbage I've thrown at you.*
Also, there's probably ways to do most of this in Aqua and not the terminal. Sorry.

Zach


----------



## speedy (Dec 28, 2000)

it all makes sense those commands i'll try it later...

you can see the console from my troubles with authorizing in this posting: http://forums.macnn.com/cgi-bin/Forum33/HTML/001432.html

thanks a lot


----------

