Tuesday, March 26, 2013

Solaris SPARC Boot Sequence


The following represents a summary of the boot process for a Solaris 2.x system on Sparc hardware.

Power On: Depending on the system involved, you may see some output on a serial terminal immediately after power on. This may take the form of a Hardware Power ON message on a large Enterprise server, or a "'" or "," in the case of an older Ultra system. These indications will not be present on a monitor connected directly to the server.

POST: If the PROM diag-switch? parameter is set to true, output from the POST (Power On Self Test) will be viewable on a serial terminal. The PROM diag-level parameter determines the extent of the POST tests. (See the Hardware Diagnostics page for more information on these settings.) If a serial terminal is not connected, a prtdiag -v will show the results of the POST once the system has booted. If a keyboard is connected, it will beep and the keyboard lights will flash during POST. If the POST fails, an error indication may be displayed following the failure.

Init System: The "Init System" process can be broken down into several discrete parts:

  • OBP: If diag-switch? is set, an Entering OBP message will be seen on a serial terminal. The MMU (memory management unit) is enabled.
  • NVRAM: If use-nvramrc? is set to true, read the NVRAMRC. This may contain information about boot devices, especially where the boot disk has been encapsulated with VxVM or DiskSuite.
  • Probe All: This includes checking for SCSI or other disk drives and devices.
  • Install Console: At this point, a directly connected monitor and keyboard will become active, or the serial port will become the system console access. If a keyboard is connected to the system, the lights will flash again during this step.
  • Banner: The PROM banner will be displayed. This banner includes a logo, system type, PROM revision level, the ethernet address, and the hostid.
  • Create Device Tree: The hardware device tree will be built. This device tree can be explored using PROM monitor commands at the ok> prompt, or by using prtconf once the system has been booted.

Extended Diagnostics: If diag-switch? and diag-level are set, additional diagnostics will appear on the system console.

auto-boot?: If the auto-boot? PROM parameter is set, the boot process will begin. Otherwise, the system will drop to the ok> PROM monitor prompt, or (if sunmon-compat? and security-mode are set) the > security prompt.

The boot process will use the boot-device and boot-file PROM parameters unless diag-switch? is set. In this case, the boot process will use the diag-device and diag-file.

bootblk: The OBP (Open Boot PROM) program loads the bootblk primary boot program from the boot-device (or diag-device, if diag-switch? is set). If the bootblk is not present or needs to be regenerated, it can be installed by running the installboot command after booting from a CDROM or the network. A copy of the bootblk is available at /usr/platform/`arch -k`/lib/fs/ufs/bootblk

ufsboot: The secondary boot program, /platform/`arch -k`/ufsboot is run. This program loads the kernel core image files. If this file is corrupted or missing, a bootblk: can't find the boot program or similar error message will be returned.

kernel: The kernel is loaded and run. For 32-bit Solaris systems, the relevant files are:

  • /platform/`arch -k`/kernel/unix
  • /kernel/genunix
For 64-bit Solaris systems, the files are:
  • /platform/`arch -k`/kernel/sparcV9/unix
  • /kernel/genunix

As part of the kernel loading process, the kernel banner is displayed to the screen. This includes the kernel version number (including patch level, if appropriate) and the copyright notice.

The kernel initializes itself and begins loading modules, reading the files with the ufsboot program until it has loaded enough modules to mount the root filesystem itself. At that point, ufsboot is unmapped and the kernel uses its own drivers. If the system complains about not being able to write to the root filesystem, it is stuck in this part of the boot process.

The boot -a command singlesteps through this portion of the boot process. This can be a useful diagnostic procedure if the kernel is not loading properly.

/etc/system: The /etc/system file is read by the kernel, and the system parameters are set.

The following types of customization are available in the /etc/system file:

  • moddir: Changes path of kernel modules.
  • forceload: Forces loading of a kernel module.
  • exclude: Excludes a particular kernel module.
  • rootfs: Specify the system type for the root file system. (ufs is the default.)
  • rootdev: Specify the physical device path for root.
  • set: Set the value of a tuneable system parameter.

If the /etc/system file is edited, it is strongly recommended that a copy of the working file be made to a well-known location. In the event that the new /etc/system file renders the system unbootable, it might be possible to bring the system up with a boot -a command that specifies the old file. If this has not been done, the system may need to be booted from CD or network so that the file can be mounted and edited.

kernel initialized: The kernel creates PID 0 ( sched). The sched process is sometimes called the "swapper."

init: The kernel starts PID 1 (init).

init: The init process reads the /etc/inittab and /etc/default/init and follows the instructions in those files.

Some of the entries in the /etc/inittab are:

  • fs: sysinit (usually /etc/rcS)
  • is: default init level (usually 3, sometimes 2)
  • s#: script associated with a run level (usually /sbin/rc#)

rc scripts: The rc scripts execute the files in the /etc/rc#.d directories. They are run by the /sbin/rc# scripts, each of which corresponds to a run level.

Debugging can often be done on these scripts by adding echo lines to a script to print either a "I got this far" message or to print out the value of a problematic variable.

Relocation

I'm seeing enough complaints about format incompatibilities with the old Princeton University pages that I am going to start relocating them to this blog over the next few weeks.

I don't have any control over the old templates, and I really don't have any control over the way that IE keeps re-interpreting how it will render what was formerly perfectly fine HTML. At least on the blog I can control the horizontal and the vertical.

Monday, March 25, 2013

From Techie to Boss: Transitioning to Leadership

If you liked Solaris Troubleshooting Handbook, please try my latest book, "From Techie to Boss."

This book is aimed at people who have recently been promoted to team lead or technical manager. I've tried to provide a good summary of advice for new managers. I welcome your comments!

Wednesday, June 29, 2011

Internet Explorer 8 and 9 Rendering Problems

Thanks, James, for pointing out the rendering problems with Internet Explorer 8 and 9. I found the HTML setting that fixes the problem. Evidently IE 8 and 9 want the width set on the nested table containing the body of the page, even though the table is itself nested in a cell whose width is already set.

Thanks, Microsoft, for demonstrating just how highly you prize conformity to standards and backwards compatibility with your own products.

The re-formatted pages have been sent to Princeton and will hopefully be live in the next few days.

Tuesday, June 07, 2011

2011 Re-print of Solaris Troubleshooting Handbook

The 2011 re-print of the Solaris Troubleshooting Handbook is available from the printer at: https://www.createspace.com/3617377

Amazon will also be distributing the book, and it should be listed within 3-5 business days.

Please provide comments here as to any errata that may be discovered, or on sections that should be targeted for updates in future editions. People who provide substantive comments may be invited to assist in reviewing the next edition.

As noted in an earlier post, I have been forced to moderate comments due to a large amount of sexually explicit spam posted as comments to this blog. If you do not see your comment right away, it is probably just waiting for me to review and publish it.

Thanks,
--Scott

Sunday, September 13, 2009

Moderating Comments

I'm afraid that I've been forced to moderate comments on this blog due to someone who appears to be posting sexually explicit comments in Japanese. I tried just deleting them as they appear, but I'm getting tired of doing that.

If you're the person posting the comments, go open your own blog.

Monday, August 25, 2008

Sun Cluster Page

I've added a new Sun Cluster page to the site. I'll be expanding it over time.

--Scott

ZFS Page Update

I've submitted additional updates to the ZFS page.

In particular, the revised version of the page contains some basic reference information on ZFS structure internals, as well as links to papers that can be used to walk the internal data structures of a ZFS file system:

ZFS
On-Disk Data Walk
in the OpenSolaris Developer Conference Proceedings.


ZFS On-Disk Specification

Sunday, July 20, 2008

ZFS page updated

The ZFS page has been updated with references to the Evil Tuning Guide and some of the tuning parameters that are discussed there.

Sunday, April 27, 2008

Sun Cluster, HAStoragePlus and VxFS fsck

It turns out that when you have a decent number of VxFS file systems, there is a particularly nasty bug that can jump out and bite you in the *.

It turns out that Sun Cluster wants the vfstab entries for these file systems to be listed as being in the first fsck pass. This particular bug is Bug ID 6572900. Note that the bug description says that this fix does not work for all sites. Fortunately, the workaround seems to be working here.

This bug report is a good example of what I hate to see in bug reports from vendors (not just Sun). The status on the bug is reported as "fix delivered" (presumably the above workaround, since I don't see any patches), but the bug report notes that the workaround doesn't work for all sites. If customers are still having the problem, I don't see how we can claim that a fix has been delivered.

--Scott

Enclosure Based Naming and Sun Cluster

As I posted previously, we are working on getting our Sun Cluster installation running. We had originally hoped to use ZFS for this project, which would have made deployment much easier. Unfortunately, the risks associated with the bug discussed in my ZFS Difficulties post are just too high to allow us to deploy it for production use at this time.

Instead, we are moving to Veritas Volume Manager and File System (VxVM and VxFS) for control of the data directories and shared storage.

We hit a hitch associated with Enclosure Based Naming. It turns out that if your storage drivers return devices in a format including the WWN, Enclosure-Based Naming is mandatory. Since the names are assigned based on some obscure, secret algorithm, you are virtually guaranteed that the different systems in your cluster will have different Enclosure Based Names associated with them.

Sun Cluster, on the other hand, insists that all of your devices be named the same way on all systems in the cluster.

Fortunately, Sun Infodoc 215296 describes how to resolve this impasse for VxVM 4.1+.

First, boot the node that you will be fixing in non-cluster mode. You can do this with a
boot -x
command. Make sure that no disk groups are imported from the shared storage before proceeding.

The /etc/vx/disk.info file contains a mapping from the WWN-based device names (that you see in OS-based commands like format) to the Enclosure Based Names. You can edit this file directly, changing only the numerical part of the Enclosure Based Name that does not match between the different servers.

After making this change, and before you reboot, run the following command to re-configure the storage:
vxconfigd -k
(Note that volumes and disk groups will freak out at this point if you have them imported on the system, since they see the disks being migrated to a "different" location. You really want to have deported the disk groups before you start, or else you may find yourself doing plex recovery.)

You can verify that the changes took effect properly by running
vxdisk -e list
and matching up the disk names to your reference configuration.

Good luck!

--Scott

Friday, April 18, 2008

ZFS Difficulties

We've been evaluating ZFS as a replacement for VxVM and VxFS in some of our production clusters. We encountered some difficulties.

ZFS has supported our development environment for about a year now, and we have enjoyed the flexibility and feature set of ZFS--especially the snapshot management and the ease of volume management. The performance, however, has left something to be desired. We had hoped to demonstrate that we could get adequate performance on ZFS by being more aggressive with tuning.

During the initial testing, we did not use ZFS mirroring or RAIDZ, though we did separate the Oracle log and temp files into separate pools as suggested in the ZFS Best Practices Guide, and we did tweak several tuning parameters as suggested in the ZFS Evil Tuning Guide.

We were able to get performance that met our requirements, but we experienced a much more serious problem when our test system blew a CPU. One of our pools became corrupted, which resulted in a panicked server. This was unexpected; we had isolated our test environment on a non-global zone and used dataset to delegate the zpool administration to the zone. We had expected a corrupted zpool to cause problems that were isolated to the zone, not to cause problems to the entire server.

This server was part of a nascent Sun Cluster configuration that we were also testing; the failover server attempted to import the zpool and promptly panicked. Investigation with zdb -lv revealed that the metadata had become corrupted as a result of the processor failure and resulting panic. We opened a call with Sun, and I posted message with the details to the ZFS Discuss list.

The upshot is that Solaris 10u5 and earlier do not have a way to prevent a panic on zpool corruption. Nevada allows you to specify how the OS will react to zpool corruption, but this will not be brought forward to Solaris 10 until update 6.

We could have reduced the likelihood of zpool metadata corruption by having more than one zdev in each pool (allowing the metadata replicas to have copies on different zdevs). Sun tells us that this would have narrowed the window in which we could have corrupted the metadata, but that the problem itself will not be fixed until update 6 later this year.

Until we get this problem resolved, I don't see being able to use ZFS in a critical production environment. If you have any light to shine on any of these issues, please post a comment here or on the ZFS Discuss list.

--Scott

Update on Book Project

I'm in the process of re-writing a couple of the chapters, which is going slower than I would like. It is getting closer to finished. If you send me your email address, I will let you know when the book is released.

(NOTE: The 2011 re-print of this book is available from the printer at: https://www.createspace.com/3617377 )

Sunday, August 19, 2007

Book Project

I am compiling the information from the web site into a book. If you would like to be a technical reviewer for the book, please let me know, and I will send you a copy of the current draft. People who provide me with comments will be thanked on the acknowledgment page; I'm afraid I'm not in a position to offer anything more than that.

You can contact me through the email address listed for this blog, or by adding a comment to this blog posting. The folks at Princeton are not involved in this project, so please don't direct any inquiries there.

--Scott

Tuesday, August 07, 2007

inittab update

I updated the inittab page to correct the error that Todd pointed out. Thanks for the help! Please let me know if you find other errors or pages that need better explanation.

The LOPSA conference in Cherry Hill was great! If you didn't make it this year, make sure to put it on your calendars for next year.

--Scott

Wednesday, July 25, 2007

Solaris Multipathing, System Bus pages updated

I updated the Solaris Multipathing and System Bus pages. We tripped over an issue with editing the scsi_vhci.conf for a third party storage device. The syntax is incredibly picky and wants new entries to be padded out with spaces, as I describe in the updated page.

--Scott

Wednesday, May 16, 2007

Upcoming Class

I'll be teaching a Solaris Troubleshooting class at the upcoming Sysadmin Days conference in Cherry Hill, NJ in August.

LOPSA Sysadmin Days Professional Training

Class Description:

Troubleshooting is where the rubber meets the road for system administrators. Our employers need us to identify and fix the root cause of our problems with a minimum of disruption and cost. Our technical chops are important, but we also need to work collaboratively with our coworkers and customers to resolve the problem for once and for all. This course covers several techniques and tools for organizing a successful, collaborative troubleshooting process.

But this is not just a touchy-feely class! Solaris 10 includes a raft of tools for getting to the bottom of performance, hardware and software environments. We'll review several key tools for looking at different aspects of system and application functioning. Some of the tools and techniques we'll look at include:

* Error messages--how to collect and interpret them
* Fault profiles--handy rules of thumb
* Getting at the system's guts with DTrace
* Examining a crash dump
* Using the p-tools and the /proc pseudo-filesystem
* Cool free tools from the Web

Scott Cromar

Scott Cromar has been a fan of Solaris since using a Sun workstation to investigate the sex life of sea grasses while an undergraduate. He is currently a Unix Technical Lead with more than a dozen years of experience supporting Solaris and Linux systems in academic and financial services production environments. Along the way, he created Princeton University's Solaris Troubleshooting web site and the companion Solaris Troubleshooting Blog. Besides technical articles exposing the seamy side of life on the seabed, he has published articles for SANS and SysAdmin Magazine.