How to create or change or view Boot Device Aliases in Solaris Online
This is a procedure to see what the OpenBoot PROM (OBP) aliases are from a booted system, without having to down the system to the “ok” prompt. These aliases are both the “built-in” and any others that may have been manually created. They are the same aliases seen at the OBP level (at the “ok” prompt) with the “devalias” command.
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. These OBP aliases can also be viewed from the operating system by using this Solaris command:
# /usr/sbin/prtconf -pv
The lengthy output will be divided up into “Nodes” and the section with the alias information ends with the following line (this is the portion of the output to locate): name: ‘aliases’
--snip-- Node 0xf0816050 xdisk: '/ssm@0,0/pci@19,700000/pci@2/SUNW,isptwo@5/sd@0,0' xnet: '/ssm@0,0/pci@19,700000/pci@1/SUNW,qfe@3,1' diskc: '/ssm@0,0/pci@1c,700000/pci@1/SUNW,isptwo@4/sd@0,0' netc: '/ssm@0,0/pci@1c,700000/pci@1/SUNW,hme' cdrom: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@6,0:f' disk: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@0,0' disk0: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@0,0' disk1: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@1,0' disk2: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@2,0' disk3: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@3,0' disk4: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@4,0' disk5: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo@4/sd@5,0' def-cn: '/sgcn' diskifp: '/ssm@0,0/pci@19,700000/SUNW,ifp@1/ssd@0,0' diskglm: '/ssm@0,0/pci@18,700000/scsi@2/disk@0,0' scsi: '/ssm@0,0/pci@18,700000/pci@1/SUNW,isptwo' net: '/ssm@0,0/pci@18,700000/pci@1/SUNW,hme' name: 'aliases' --snip--
Change or create boot-device alias
We can change or create the boot-device alias while the server is running, using the eeprom command. You don’t have to halt your server to change the boot-device. You can change the boot-device, and even create a new alias by using the eeprom command whilst the system is up and running. Only the root user can execute the eeprom command.
Changing the boot-device from multi user mode can be as easy as the following command:
# /usr/sbin/eeprom boot-device=disk2
In the above example, disk2 is already defined as an alias. You can also define your own alias to use with the boot-device variable.
The following instructions explain how to create an alias and then assign it as the boot-device variable. You will need to know the pathname of the device alias you wish to use. An example of a pathname is: /sbus/SUNW,fas@e,8800000/sd@2,0. Path names tend to be long and complex and that’s why we like to assign them aliases like “disk2”.
Example 1: Changing the boot-device to target 2
You can use the following command (or other disk descriptor as appropriate) to see which devices are currently configured and use that path for the devalias pathname:
# prtconf -vp | grep sbus --> sbus based systems # prtconf -vp | grep pci --> PCI based systems
The output from the prtconf command will vary depending on machine architectures.
# prtconf -vp | grep sbus bootpath: '/sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a' sbus-probe-list: '0123' net: '/sbus/SUNW,hme@e,8c00000' disk: '/sbus/SUNW,fas@e,8800000/sd@0,0' cdrom: '/sbus/SUNW,fas@e,8800000/sd@6,0:f' tape: '/sbus/SUNW,fas@e,8800000/st@4,0' tape1: '/sbus/SUNW,fas@e,8800000/st@5,0' tape0: '/sbus/SUNW,fas@e,8800000/st@4,0' disk6: '/sbus/SUNW,fas@e,8800000/sd@6,0' disk5: '/sbus/SUNW,fas@e,8800000/sd@5,0' disk4: '/sbus/SUNW,fas@e,8800000/sd@4,0' disk3: '/sbus/SUNW,fas@e,8800000/sd@3,0' disk2: '/sbus/SUNW,fas@e,8800000/sd@2,0' disk1: '/sbus/SUNW,fas@e,8800000/sd@1,0' disk0: '/sbus/SUNW,fas@e,8800000/sd@0,0' scsi: '/sbus/SUNW,fas@e,8800000' floppy: '/sbus/SUNW,fdtwo' ttyb: '/sbus/zs@f,1100000:b' ttya: '/sbus/zs@f,1100000:a' keyboard!: '/sbus/zs@f,1000000:forcemode' keyboard: '/sbus/zs@f,1000000' device_type: 'sbus' name: 'sbus'
Look for a disk alias for target 2. The sd@2,0 means SCSI disk at target 2. So we know that “disk2” is the appropriate alias. The following command will set the boot-device
# eeprom boot-device=disk2
Example 2: Changing the boot-device to target 14
Lets see an example of changing the boot-device to target 14 From the results of the above “prtconf -vp | grep sbus” command. Notice there is no predefined alias for target 14. Here are the commands to add a device alias called “boot-me”:
# eeprom use-nvramrc\?=true # eeprom nvramrc='devalias boot-me /sbus@1f,0/SUNW,fas@e,8800000/sd@e,0'
NOTE: e is hexadecimal for decimal 14.
# eeprom boot-device=boot-me
Running “prtconf -vp | grep sbus” now shows the new “nvramrc” variable settings but NOT the individual device alias we just created. After a system reboot, the following command will show the “boot-me” alias:
/usr/sbin/prtconf -vp|grep sbus
ok> boot boot-me
To get the system to boot permanently with this newly created alias:
ok> setenv auto-boot? true ok> reset
You will need to execute the “reset” command at the “ok” prompt for the “devalias” command to be updated with this new alias to boot from the “boot-device” alias (boot-me, for our example).
No comments:
Post a Comment