ragecf 发表于 2012-04-03 09:57

OBP devalias的问题

有一台E250,在OBP下用devalias能看到disk, disk0, disk1, disk2, disk3 .... cdrom

即使只插入一个硬盘,这些disk1,2...都还存在

不是说devalias建的别名是临时的,reset-all后都会消失,为什么我执行reset-all后还存在呢?

谢谢大家。

roger1402001 发表于 2012-04-03 10:25

回复 1# ragecf

nvalias不是建临时的的别名喔~~
   

ragecf 发表于 2012-04-03 12:59

回复 2# roger1402001

不好意思,我说的是devlias看到的这些别名,您的意思是这些别名是用nvalias建出来的?那为什么不存在于nvramrc中呢?


   

roger1402001 发表于 2012-04-03 13:05

回复 3# ragecf

Reference http://www.unix.com/unix-dummies-questions-answers/5669-setting-boot-device-alias-sun-hardware.html

1) Creating a boot alias using nvalias from the OpenBoot PROM command line.

Get the device path for the boot disk:

# ls -la /dev/dsk/cxtxdxsx

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

Shutdown the system to the ok prompt.

Create the alias:

ok nvalias <alias> <device-path>

Example:

ok nvalias newdisk /iommu@f,e0000000/sbus@f,e0001000/esp@f,800000/sd@3,0:a

or for PCI based systems:

ok nvalias newdisk /pci@1f,0/pci@1/scsi@3,1/disk@3,0

NOTE: Although format will show the pci device with a "sd" designation, a translation is made as the OBP's device tree is 'disk'. This is the only name that the firmware will understand.

Modify the NVRAM so that it boots from the new alias automatically:

ok setenv boot-device newdisk

ok reset

The above will be valid till you run set-defaults or nvunalias from the ok prompt..

******************************************************************************
2) Alternate method for creating a boot alias using nvedit.

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

ok nvedit

0: devalias newdisk /iommu@f,e0000000/sbus@f,e0001000/esp@f,800000/sd@3,0:a

^c (control c)

ok nvstore

ok setenv use-nvramrc? true

ok reset

******************************************************************************
3) Alternate method for creating a boot alias using existing device aliases provided in the OpenBoot PROM.

Use the devalias command to identify the existing device aliases:

ok devalias

The device alias names are listed on the left side of the output. Any of the device alias names that point to disk drives can be used as boot aliases.

Use one of the device alias names to set a new boot device:

ok setenv boot-device <new device alias name>

Display the new boot device alias:

ok printenv boot-device

Test the new boot alias by resetting the machine;

ok reset


Note: The device path above is an example only; you will not necessarily have the same path.
Note: The "0:" in the nvedit example (method 2) is the line number; do not type it as part of your edit.   

ragecf 发表于 2012-04-03 13:31

回复 4# roger1402001


    谢谢,看来像是第三点解释了我的疑问,也就是disk, disk0...cdrom这些别名是OBP缺省提供的

roger1402001 发表于 2012-04-03 13:41

回复 5# ragecf


Good ~~~~:em02:   
页: [1]
查看完整版本: OBP devalias的问题