9. 도서관/__다. UNIX

Change or create the boot-device alias while the server is running, using the "eeprom" command

행복 금융 2008. 7. 30.




Document Audience: SPECTRUM
Document ID: 19290
Title: Change or create the boot-device alias while the server is running, using the "eeprom" command
Copyright Notice: Copyright © 2005 Sun Microsystems, Inc. All Rights Reserved
Update Date: Fri Sep 16 00:00:00 MDT 2005
Products:  Solaris
Technical Areas:  Commands,  Install


Keyword(s):OpenBoot Prom, OBP, boot-device, alias

 This document describes how to 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. 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

 For our example, we used an Ultra 2 server with a 12 disk multipack attached to the onboard SCSI port. 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

 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 hexidecimal for decimal 14.

   # eeprom boot-device=boot-me
 

NOTE: the "?" in use-nvramrc? is considered a special character and must be preceded with the backslash character (\) to be recognized. 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
 

NOTE: You may want to bring the system down to the "ok" prompt, and manually try to boot from the newly created device alias, to confirm that the path and device work.

     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).

댓글

💲 추천 글