The Open Boot PROM(OBP) aliases in solaris SPARC environments are created to simplify the access to hardware devices using user friendly names. 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.
ok> devalis ...... mydisk /sbus@7,0/SUNW,fas@3,8800000/sd@c,0 screen /sbus@7,0/cgsix@0,0 disk /sbus@3,0/SUNW,fas@3,8800000/sd@0,0 diskbrd /sbus@3,0/SUNW,fas@3,8800000/sd@a,0 diskisp /sbus@3,0/QLGC,isp@0,10000/sd@0,0 net /sbus@3,0/SUNW,hme@3,8c00000 cdrom /sbus@3,0/SUNW,fas@3,8800000/sd@6,0:f ......
These OBP aliases can also be viewed from the operating system by using Solaris commands prtconf and eeprom. There are 3 methods to set boot device alias at ok prompt. Before we go ahead and set the boot alias, identify the boot device and get the physical device path for the disk.
# 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 Nov 19 2015 /dev/dsk/c0t0d0s0 -> ../../devices/pci@1f,4000/scsi@3/sd@0,0:a
Gracefully shutdown the system to ok prompt.
# init 0
Method 1 : using show-disks and nvalias
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 checked before in first step at command line. Note that at OBP level the device path will be slightly different than the one you checked at the command line.
ok> show-disks a) /ramdisk-root b) /pci@1f,4000/scsi@3,1/disk c) /pci@1f,4000/scsi@3/disk 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
The disk is copied into the clipboard and can be used to set the new boot device alias using nvalias and setenv. First an alias is created and then boot device is set using setenv.
ok> nvalias newdisk /pci@1f,4000/scsi@3/disk@0,0:a ok> setenv boot-device newdisk ok> printenv boot-device boot-device = newdisk ok> reset-all
Method 2 : Using nvedit
Use the NVRAM editor (nvedit) to create a script that will create the boot alias at reset. When you type nvedit, on next line (numbered as 0) you can write commands you want to execute. nvstore copies these commands to nvramrc so that they can be executed on next reset. To enable using nvramrc we need to set use-nvramrc? parameter to true.
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
We can now set the boot-device alias using setenv.
ok> setenv boot-device newdisk ok> printenv boot-device boot-device = newdisk ok> reset-all
Method 3 : Using devalias
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 --- same path that we want to use 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 disk0 ok> printenv boot-device boot-device = disk0 ok> reset-all