Changing solaris x86 boot partition

The "easy" way to change boot partition, is to use fdisk, and it just magically works, after you change the "active partition" on your main disk. EG:
fdisk /dev/rdsk/c0d0p0
(Note "p0", not "s0").
But I couldn't do that, due to hardware irritations. I had an internal IDE drive, and an external SCSI drive. I wanted to boot off the external SCSI drive, but the BIOS would not let me.

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=32k
should 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


how to Re-install solaris boot sector

If you can boot off cdrom or floppy, select your drive, and keep going, but you cannot boot directly off your disk: You need to update your master boot record (MBR)

A way to verify this is your problem, is to do

dd if=/dev/dsk/c0d0p0 count=2 |strings
strings /usr/lib/fs/ufs/mboot
and 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=1
but 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"


Written by: Philip Brown
Solaris Top