• 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

How to create an OBP boot device alias in Solaris [SPARC]

by admin

These aliases are created to simplify access to hardware devices at the OBP level. They can be used in place of the full OBP hardware path at the “ok” prompt. When viewed via the “devalias” command at the prom level, they are listed in the form of the alias name followed by the full hardware path to the device. There are 3 methods discussed in this post to create a boot device alias.

Method 1: Creating a custom boot device alias using show-disks and nvalias from the OpenBoot PROM (OBP) command line

While still booted to the Solaris Operating Environment, find the device path for the boot disk:

# df -lh /
# ls -l /dev/dsk/cxtxdxsx

Example

# df -lh /
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0       12G   5.1G   6.3G    45%    /
# ls -l /dev/dsk/c0t0d0s0
lrwxrwxrwx   1 root     root          41 Feb  1  2010 /dev/dsk/c0t0d0s0 -> ../../devices/pci@1f,4000/scsi@3/sd@0,0:a

Write down the entire physical path to be used for the alias.

Gracefully shutdown the system to the ok prompt:

# init 0

At the ok> prompt, use the show-disks command to view the available disks on the system and select the boot-device path that you wrote down in the first step. Note that the OBP translates the ‘sd’ part of the device path to ‘disk’.

ok>  show-disks
a) /ramdisk-root
b) /pci@1f,4000/scsi@3,1/disk
c) /pci@1f,4000/scsi@3/disk                                    <-- this is the same path
d) /pci@1f,4000/ebus@1/fdthree@14,3023f0
q) NO SELECTION
Enter Selection, q to quit: c

/pci@1f,4000/scsi@3/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.         <-- follow these steps
e.g. ok nvalias mydev ^Y
for creating devalias mydev for
/pci@1f,4000/scsi@3/disk

ok> nvalias newdisk /pci@1f,4000/scsi@3/disk@0,0:a              <-- manually add the @0,0:a

Follow the prompts to use nvalias to create the new device alias and add the disk number and slice number from the device path (which you wrote down in the first step) to the end of the device path. e.g. In the example above, @0,0:a was added to the end of the path. Set the boot-device to the new device alias:

ok> setenv boot-device [alias-name]
ok> printenv boot-device
ok> reset-all

Example

ok> setenv boot-device newdisk
ok> printenv boot-device
boot-device = newdisk
ok> reset-all

Note: Custom device aliases will be retained in the OBP unless set-defaults (STOP-N) is used to reset the NVRAM to the default values or nvunalias is used to delete the custom device alias. To remove a custom device alias:

ok> nvunalias [aliasname]
ok> reset-all

Example

ok> nvunalias mydisk
ok> reset-all

Method 2: Creating a boot alias using nvedit

Use the NVRAM editor (nvedit) to create a script that will create the boot alias at reset:

ok> nvedit
0: devalias newdisk /pci@1d,700000/scsi@4/sd@0,0:a
^c (control c)
ok nvstore
ok setenv use-nvramrc? true
ok reset
Note: The 0: in the example above is the line number from nvedit, do not type it as part of your device alias.

Set the boot-device to the new device alias:

ok> setenv boot-device [alias-name]
ok> printenv boot-device
ok> reset-all

Example

ok> setenv boot-device newdisk
ok> printenv boot-device
boot-device = newdisk
ok> reset-all

Method 3: Viewing and using existing device aliases provided in the OpenBoot PROM

Use the devalias command to identify the default device aliases:

ok> devalias
disk5 /pci@1f,4000/scsi@3/disk@c,0
disk4 /pci@1f,4000/scsi@3/disk@b,0
disk3 /pci@1f,4000/scsi@3/disk@a,0
disk2 /pci@1f,4000/scsi@3/disk@9,0
disk1 /pci@1f,4000/scsi@3/disk@8,0
disk0 /pci@1f,4000/scsi@3/disk@0,0    <--- the disk0 alias is the same path
disk /pci@1f,4000/scsi@3/disk@0,0

Identify the boot disk path in the above output and set the boot-device to that alias:

ok> setenv boot-device [alias-name]
ok> printenv boot-device
ok> reset-all

Example

ok> setenv boot-device disk0
ok> printenv boot-device
boot-device = disk0
ok> reset-all

Filed Under: Hardware, Solaris, Solaris 11

Some more articles you might also be interested in …

  1. How to find zpool version and filesystem version in Solaris
  2. Solaris Performance troubleshooting : Disk (I/O) performance issues
  3. How to configure Solaris Zone to access a CDROM
  4. How to identify the boot device (primary and alternate) in Solaris
  5. Solaris 11 : Increasing the size of a vdisk in LDom ( with backend device as ZFS volume )
  6. How to clone a solaris 11 zone
  7. Solaris : Non-root user can’t run prtdiag command
  8. Most Commonly used ALOM commands (Cheat Sheet)
  9. How to Backup and Restore ZFS root pool in Solaris 10
  10. How to dynamically replace CPU/memory board (dynamic reconfiguration) on SunFire s6800/e12K/e15K/e25K

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright