• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Howto Verify If a Bootblk is Installed on the Boot Disk (SPARC)

by admin

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.

Note: This does not check the bootblock for consistency or completeness, but from it you can tell the type and if one is installed.

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

Filed Under: Solaris, Solaris 11, ZFS

Some more articles you might also be interested in …

  1. Oracle VM Server for SPARC (Ldoms) : How to Change Primary/Control Domain’s UUID
  2. How to configure NTP client in Solaris 8,9,10 and non-global zones
  3. 7 Useful Find Command Examples to Locate files to remove when a filesystem is full
  4. How to Disable IPv6 in solaris 8,9,10
  5. How to change hostname in Solaris 8, 9 and 10
  6. How to add Additional Storage Space Created from Dynamic LUN Expansion in SVM online
  7. Understanding Special Permissions (setuid, setgid, sticky bit) in Solaris
  8. How to Enable ssh/sshd Debugging for Solaris
  9. How to Configure iSCSI targets on Solaris 10
  10. ZFS Tutorials : Creating ZFS snapshot and clones

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright