A list of Solaris OK prompt commands is handy to get the most out of OK prompt during initial install of Solaris Systems or troubleshooting issues.
What is Solaris OK Prompt?
Most of the time, when you start the server with Solaris OS installed, it boots at run level 2 or run level 3, which are multi-user states with access to full system and network resources.
Occasionally, you might operate the system at run level 1, which is a single-user administrative state.
The lowest operational state is run level 0. At this state, it is safe to turn off power to the system. When the server is at run level 0, the ok prompt appears.
Reasons: Why System shows OK Prompt?
There are a number of scenarios under which OpenBoot firmware control (OK Prompt) can occur:
- By default, before the operating system is installed the system comes up under OpenBoot firmware control (OK prompt).
- When the auto-boot? OpenBoot configuration variable is set to false, the system boots to the ok prompt.
- After the Solaris OS is halted, the system transitions to run level 0 in an orderly way.
- During the boot process, when there is a serious hardware problem that prevents the operating system from running, the system reverts to OpenBoot firmware control/ OK prompt.
- When you deliberately place the system under firmware control in order to execute firmware-based commands, you have the ok prompt.
How to Obtain / Reach the OK Prompt?
There are several ways to reach the OK prompt, depending on the state of the system and the means by which you are accessing the system console.
1) Graceful shutdown of the Solaris OS
The preferred method of reaching the ok prompt is to shut down the operating system by typing command.
at the Solaris prompt the system gradually takes you to the OK prompt.
From a shell or command tool window, type init 0 or uadmin 2 0 command to go to OK prompt.
2) Graceful reset of the control domain using the ILOM reset command
From the -> prompt in the control domain, type:
-> set /HOST/domain/control auto-boot=disable
-> reset /HOST/domain/control
3) Manual System Reset
From the -> prompt, type:
-> set /HOST/bootmode script=”setenv auto-boot? false”
-> reset /SYS
-> start /SP/console
If the operating system is already halted, you can use the start /SP/console command without using
set /HOST send_break_action=break
to reach the ok prompt.
Gracefully shutting down the system prevents data loss, enables you to warn users beforehand, and causes minimal disruption. You can usually perform a graceful shutdown, provided the Solaris OS is running and the hardware has not experienced serious failure.
You can perform a graceful system shutdown from the ALOM system controller command prompt using command.
You can also use the system Power button to initiate a graceful system shutdown.
4) Break key or equivalent ILOM break commands
If keyboard or console tool do not support sending Break Key. you may send break key using below method. :
-> set /HOST send_break_action=break
-> start /SP/console -force
From an alphanumeric terminal configured to access the system console, press the Break key.
After the break, if a debugger is present the domain breaks to KMDB debugger
prompt, which allows access to the c)continue, s)ync, r)eset? prompt. If
a debugger is not present, the c)continue, s)ync, r)eset? prompt occurs:
- c – returns to the Solaris OS
- s – forces synchronization (sync) of the filesystem, resulting in a core dump
- r – resets the domain and reboots to the Solaris OS if the auto-boot? option is set to true, or stops at the ok prompt if the auto-boot? option is set to false.
Solaris OK Prompt Commands (cheat sheet)
show-disks -> To show the disks
probe-scsi -> To search the SCSI devices attached to the primary SCSI controller
probe-scsi-all -> Show attached SCSI devices for all host adapters – internal & external.
show-devs -> To show the PCI devices
devalias -> to list device alias names
devalias <alias> <path> ->To temporarily create a device alias
nvalias <alias> <path> -> To set the device alias permanently to NVRAM
nvunalias cdrom1 -> To remove the nvalias ‘cdrom1’ from NVRAMRC
printenv ->To view the current NVRAM settings
setenv <env> <value> -> To set the environment variables
set-defaults -> To set/reset the open boot prompt settings to the factory default
reset-all -> To reboot the system from OK Prompt
banner -> To display the Model, Architecture, processor, open boot version, ethernet address, host-id
.version -> To find out the Open boot prompt version
.ent_addr -> To find out the ethernet MAC address
.speed -> To find out the CPU and PCI bus speeds
boot -> boot the system from the default boot devices
boot cdrom -> to boot from cdrom
boot disk -> boots the system from device as specified by the disk device alias
boot device-path -> boot from the full device mentioned
boot disk1:h – boot from disk1 partition h
boot net -> network boot .boots from a TFTP boot server or Jumpstart server
boot net -install -> Jumpstart boot.
boot tape -> Tape boot.boots off a SCSI tape if available
boot -h -> boot halted .boot into a halted state(ok prompt) – for troubleshooting boot at the lowest level
boot -r -> Reconfiguration boot. Boot & search for all attached device. useful when new device attached to system
boot -s -> Single user. Boots the system to run level 1
boot -v -> verbose boot. Show good debugging information.
boot -F failsafe -> to boot the server to failsafe mode
Displaying System Information
Commands to display additional system related information. Not all commands work on all Platforms
.idprom -> Display ID PROM contents
.traps -> Display a list of processor-dependent trap types
show-devs -> display list of installed and probed devices
eject floppy -> Eject the floppy
eject cdrom -> eject the cdrom
sync -> call the operating system to write information to hard disk
test floppy -> test floppy disk drive
test net -> test network loopbacks
test scsi -> test scsi interface
test-all -> test for all devices with self test method
watch-clock -> Show ticks of real-time clock
watch-net -> Monitor network broadcast packets
watch-net-all -> Monitor broadcast packets on all net interfaces
Emergency Keyboard Commands
These are key sequences recognized by the system to perform predetermined actions at boot time or during normal operation.
Stop -> Bypass POST .(This command does not depend on security-mode)
Stop + A -> Abort.(This will also stop a running system. You can resume normal operations if you enter go at the prompt. Enter anything else and you will stay halted)
Stop + D -> Enter diagnostic mode( set diag-switch? to true)
Stop + N -> Reset NVRAM contents to default values.
Ref: Suresh-Solaris , Asgaur