This can be useful in troubleshooting if the system fails to boot with a suspected bootblk issues, or if you suspect something in the OS keeps overwriting the bootblk.
For Solaris 10
Below is the output from a Solaris 10u4 with UFS, Solaris 10u6 with UFS, and a Solaris 10u6 with ZFS bootblock. The bootblk version changed from s10u6 onwards. This is why the output differs between s10u6 and earlier versions.
S10U1 through U5 UFS root:
# dd if=/dev/rdsk/c0t0d0s0 bs=1b count=1 iseek=1 | od -c -N 3 1+0 records in 1+0 records out 0000000 375 003 J 0000003
S10U6, UFS root:
# dd if=/dev/rdsk/c0t0d0s0 bs=1b count=1 iseek=1 | od -c -N 3 1+0 records in 1+0 records out 0000000 375 003 X 0000003
S10U6, ZFS root:
# dd if=/dev/rdsk/c0t0d0s0 bs=1b count=1 iseek=1 | od -c -N 3 1+0 records in 1+0 records out 0000000 375 003 326 0000003
Depending on locale settings, the output can sometimes appear without octal translation. So if you see characters similar to below, don’t discount the bootblk as being corrupt.
# dd if=/dev/rdsk/c1t0d0s0 bs=1b count=1 iseek=1 | od -c -N 3 00000001+0 ý 003 Ö
Those characters translated to octal are:
ý == 375 (octal) Ö == 326 (octal)
.. which still match a valid bootblk in the examples above.
For Solaris 11
The installboot -i option (with -e or -V) checks for the presence of a boot block and, if present, prints additional information about the boot block.
See the “Usage” output below:
# installboot Usage: installboot [-h|-f|-F fstype|-u verstr] bootblk raw-device installboot [-e|-V] -i -F zfs raw-device installboot -M -F zfs raw-device attach-raw-device fstype is one of: 'ufs', 'hsfs' or 'zfs'
The -e returns only the version string and MD5 hash, for example:
# installboot -ei -F zfs /dev/rdsk/c0t5000CCA012AD763Cd0s0 0.5.11,5.11-0.175.3.0.0.30.40452 5076df7715eaf2658f5d80ee533e09d1
while -V prints the entire extended information structure:
# installboot -Vi -F zfs /dev/rdsk/c0t5000CCA012AD763Cd0s0 Boot Block Extended Info Header: magic: EXTINFO version: 1 flags: 0 extended version string offset: 71 extended version string size: 32 hashing type: 1 (MD5) hash offset: 54 hash size: 16 Extended version string: 0.5.11,5.11-0.175.3.0.0.30.40452 MD5 hash: 5076df7715eaf2658f5d80ee533e09d1
If the disk does not contain a boot block, output will be similar to the following:
# installboot -iV -F zfs /dev/rdsk/c0t600144F0002128A65EDA582243930003d0s0 No extended information found
Solaris 11.1 (and higher)
Perform a “bootadm install-bootloader -v -P {name-f-root-ZFS-pool}“. This will check the bootblock and leave it alone, if the bootblock is already installed and in appropriate version.
# bootadm install-bootloader -v -P rpool Installing loader on /dev/rdsk/c0t5001517959450300d0s0 with `/sbin/installboot -F zfs -u 0.5.11,5.11-0.175.3.0.0.30.0 //usr/platform/sun4v/lib/fs/zfs/bootblk /dev/rdsk/c0t5001517959450300d0s0'... Output from "/sbin/installboot -F zfs -u 0.5.11,5.11-0.175.3.0.0.30.0 //usr/platform/sun4v/lib/fs/zfs/bootblk /dev/rdsk/c0t5001517959450300d0s0" was: <STDERR>: bootblock version installed on /dev/rdsk/c0t5001517959450300d0s0 is more recent or identical Use -f to override or install without the -u option <END OF OUTPUT>
You can parse the stderr output of this command for the pattern “is more recent or identical” to confirm correct bootblock
# bootadm install-bootloader -v -P rpool 2>&1 | egrep "is more recent or identical" bootblock version installed on /dev/rdsk/c0t5001517959450300d0s0 is more recent or identical