How do I restore the Solaris boot block without reinstalling?

How do I restore the Solaris boot block without reinstalling?

This may happen when installing a boot manager that comes with
another operating system (such as LILO from Linux) or an after-market
multi-OS boot manager. These sometimes trample's active partition,
which in our case is Solaris. Also, moving the Solaris partition with
a partition manager program such as Partition Magic requires reinstalling
the Solaris boot block. Before taking these steps, first verify
the Solaris partition is active. If it isn't, just make the Solaris
partition active and reboot. Otherwise follow the steps below.

1. Boot from CD-ROM and get the root prompt, #, as described in
the previous question, 7.1.

2. Determine the controller, disk number, and partition.
The boot disk is /dev/rdsk/c?t?d?p?
where ? is the controller #, target ID, and disk #, and partition #.
Omit "t?" for ATAPI E.g., /dev/rdsk/c0d0p0

3. Verify it's the correct device correct with prtvtoc for the drive:
This is VERY important; if it's wrong, you you may hose another partition:
prtvtoc /dev/rdsk/c0t0d0p0
(omit "t0" for ATAPI, always use p0, which means the "entire drive").
The prtvtoc prints out the map for the Solaris partition on the hard drive,
if found.
The partitions shown on the output are actually "slices" within the
Solaris partition.

4. Restore the boot block as follows:


/sbin/fdisk -b /usr/lib/fs/ufs/mboot (raw disk dev)

E.g., for SCSI it might be:

/sbin/fdisk -b /usr/lib/fs/ufs/mboot /dev/rdsk/c0t0d0p0

(omit "t0" for ATAPI)

5. Finally, remove your CDROM and diskette media and type "reboot".
The Solaris Multiple Device Boot Menu should appear after rebooting.
If not, you can always to an upgrade (re-)install.


Note:
This procedure does NOT make your Solaris partition active again
(sometimes needed after installing another operating system, such as Windows,
on the same disk),
it just writes to your bootblock IN your Solaris partition.
To learn more about the Solaris boot process, read the boot(1M) man page.





Home
FAQ