fdisk /dev/rdsk/c0d0p0(Note "p0", not "s0").
Another "easy" way to fix this, would be to use one of the various freeware "boot loader/manager" programs out there. But I wanted the 100% solaris solution.
The fix involves a double-boot. First, you need a solaris boot partition on a main (IDE, presumably) drive. I had a left-lover mini solaris install on a partition on the IDE drive, so that solved that problem. An alternative, would be to make a small partition, then use "dd" to raw copy the contents of a boot floppy to that partition. I have not confirmed this works, but I guess it should. so, something like
dd if=/dev/diskette of=/dev/dsk/c0d0pX bs=32kshould do it
There seems to be what I consider a bug, in the boot text menu configurator. I initially set up solaris to boot off an IDE drive, but then copied things over to a SCSI drive. For various reasons, I needed the INITIAL boot block loading to be from the IDE, but then continue with the root partition on the SCSI drive.
If I went into the "edit boot properties" menu, changed the boot device, and went back, I could boot fine off the second drive. But for some odd reason, it saved that configuration change on the SCSI DRIVE, not the IDE drive.
To make this change permemant, I had to copy /platform/i86pc/boot/bootenv.rc from the SCSI drive, to the IDE drive. A quick way to do this, assuming you are booted off the second drive: $ mount /dev/dsk/c0d0s0 /mnt $ cp /platform/i86pc/boot/bootenv.rc /mnt/platform/i86pc/boot/bootenv.rc
A way to verify this is your problem, is to do
dd if=/dev/dsk/c0d0p0 count=2 |strings strings /usr/lib/fs/ufs/mbootand compare the output. If they are not very similar, you dont have the solaris boot sector code.
MSDOS does this for itself by "fdisk /mbr". Unfortunately, solaris fdisk does not have such a flag. So the "easy" way to restore the solaris master boot sector is to do
A quicker, more direct way to do this was posted in alt.solaris.x86:
dd if=/usr/lib/fs/ufs/mboot of=/dev/dsk/c1t0d0p0 bs=440 count=1but if you do this and mess things up, blame yourself, not me :-)
Note that the above proceedure is a SEPARATE operation from what "installboot" does. You would use the following command to load the secondary boot code on the actual solaris fdisk partition
instalboot /usr/platform/i86pc/lib/fs/ufs/pblock \ /usr/platform/i86pc/lib/fs/ufs/bootblock /dev/rdsk/c0d0s2 # NOTE THE "s2" here, ****NOT***** "px" or "s0"