9fans archive / 1997 / 01 / 24 /    prev next

From: Brandon Black photon@nol.net
Subject: Destroyed nvram on pc plan9
Date: Sat, 25 Jan 1997 23:38:43 -0600 (CST)



Ok, I've run into a small problem here, and before I go hacking around too
far, I wanted to see if anyone else has done this before and has a good
solution.

I have a typical 3 PC Plan 9 setup, 1 fs, 1 cpu server, 1 terminal.. and
everything is configured ok and working fine.

The cpu server has a 125Mb IDE hard drive in it.  This holds nothing but a
20Mb DOS partition, my plan 9 parition table and nvram, and the rest was
divided between #H/hd0fs and #H/hd0swap.

Seeing as I don't actually use hd0fs, I was going to repartition the drive
with disk/prep and make one big hd0swap out of what used to be hd0swap and
hd0fs.

However, hd0nvram, which holds the authid's key, was sitting right
inbetween the hd0fs and hd0swap partitions.  My plan, which I'm 99.9% sure
would have worked, was to copy /dev/hd0nvram to a disk file called
"nvtmp", repartition, and make a new nvram partition in a logical place,
and then copy "nvtmp" back over the new nvram partition.

However.... (again), I was distracted from working on this halfway through
it, and when I got back, I finished up with the partition table and
rebooted the machine, forgetting to copy "nvtmp" over the new nvram
partition.

So now of course, when I try to boot my cpu server, it reads some random
data from the new nvram partition (just whatever was on that sector at
some earlier time), and tries to use that as a key, which results in the
fileserver refusing the attach with a "SUCK EGGS" diagnostic message.

How am I to get my nvram back in shape now?

"Plan A" is I'm going to try and attach to the fileserver from the
terminal as "none" with the server in allow mode and copy the "nvtmp" onto
the terminal's dos partition.  Then I can put the "nvtmp" file on a
floppy, bot to DOS on the cpu server machine, and attempt to somehow
manually write the data to the nvram sector. (debug maybe? echhh...)
I know the nvram sector's location... the last sector of the drive is the
partition table, and the sector just before it is my nvram.

"Plan B" will be to just write a bunch of 0's over that same sector, and
hope that when I boot the cpu server it prompts me for the password to
save in nvram, like it did when I installed it....

Either way, I have to find a method for accurately modifying a sector of
my hard drive from DOS....

Anyone have any clues or suggestions?

Brandon