SUMMARY: nvram configuration from Solaris

From: Larry Zins (lzins@lucent.com)
Date: Fri Jul 10 1998 - 18:44:14 CDT


Hi List --

It is possible to set the nvram device aliases from the operating system.
It's quite easy. We wanted to change the alias name of our boot disk mirror,
so it would be consistent with another server. I did'nt try it using the Volume
Manager tools, since you can do it just fine without them. Also this has'nt
been tested on our UE 5000, but I've taken my Sparc 5 down about 15 times
today, and it works fine on it. Please pardon the length of this email, I just
sent my notes.

The original question is at the end.

Thanks to:

Steve Kay" <steve@peachy.com
Roar Smith" <Roar.Smith@Ericsson.Dk
blained@kostabi.gdls.com (David W. Blaine)

Roar Smith got me on the right track:

>Hi,
>
>the nvram device aliases are actually stored in the eeprom variable "nvramrc".
>
>This means you can set nvram aliases using the eeprom command.
>
>Here is an example of what I did on our E4000 with D1000 storage arrays:
>
>(Bourne Shell command prompt)
># eeprom "nvramrc=devalias bootdisk0 /sbus@2,0/QLGC,isp@1,10000/sd@0,0
>devalias bootdisk3 /sbus@6,0/QLGC,isp@1,10000/sd@0,0
>devalias repair2 /sbus@3,0/QLGC,isp@0,10000/sd@0,0
>devalias repair4 /sbus@7,0/QLGC,isp@0,10000/sd@0,0"
>#
>
>The aliases are not created until the next reset of course.
>
>Regards,
>
>Roar Smith, M.Sc.E.E.

Here's my solution:

Assigning an OBP device alias for an alternate boot disk
from the OS.

>From the OS, without Volume Manager:
===================================

First you need the entire device path of the backup boot disk.
Determine which disk it is with "df", or "dmesg", etc, for
example /dev/dsk/c0t3d0s0.

# ls -l /dev/dsk |grep c0t3d0s0
lrwxrwxrwx 1 root root 86 Feb 23 11:42 c0t3d0s0 ->
../../devices/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,0:a

Note: I'm using the actual boot disk for this example.

Then get the full path from /etc/path_to_inst:

# grep sd@3 /etc/path_to_inst
"/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,0" 3 "sd"

Now just cut and paste (but chop off the last two fields):

# eeprom "nvramrc=devalias bkboot
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,0"

Multiple assignments:

# eeprom "nvramrc=devalias disk /sbus@2,0/QLGC,isp@1,10000/sd@0,0
devalias vx-bkroot /sbus@2,0/QLGC,isp@2,10000/sd@0,0"
#

# eeprom "use-nvramrc?=true" <-- mandatory

If you want to make the backup boot disk the default:

# eeprom "boot-device=bkboot"

Otherwise:

ok boot bkboot

>From the OS with Volume Manager:
================================

Determine the boot disk:

# vxdisk list |more
DEVICE TYPE DISK GROUP STATUS

[snip]

c2t0d0s2 sliced rootdisk rootdg online

[snip]

Get the corresponding device file:

# ls -l /dev/dsk |grep c2t0d0s2
lrwxrwxrwx 1 root root 48 Apr 14 11:33 c2t0d0s2 ->
../../devices/sbus@7,0/QLGC,isp@0,10000/sd@0,0:c

Get the full path:

# grep sbus@7,0/QLGC,isp@0,10000/sd@0,0 /etc/path_to_inst
"/sbus@7,0/QLGC,isp@0,10000/sd@0,0" 30 "sd"

Now can use this as the device path using the vxeeprom command:

# /usr/lib/vxvm/bin/vxeeprom -m devalias vx-bkroot
/sbus@7,0/QLGC,isp@0,10000/sd@0,0

At the OBP prompt:
==================

ok probe-scsi-all

  Make sure you know which disk is your alternate boot disk.

ok show-disks

  Select the alternate boot disk, and type "CNTRL Y" to copy it
  into a buffer.

Then:

ok nvalias bkboot CNTRL Y

Pressing CNTRL Y inserts the device path in the command line,
but you need to append the SCSI target address at the end
( @target,0 ), eg: .../sd@3,0

Then set the boot device NVRAM variable to the alias just created:

ok setenv use-nvramrc? true
ok devalias (to confirm)
ok reset

Will boot.

This assignment will stay in effect until you change it.

----------------------------------------------------------------------

Output of show-disks:

ok show-disks

a) /obio/SUNW,fdtwo@0,400000
b) /iommu@0,10000000/sbus@0,1000010000/espdma@5,8400000/esp@5,8800000/sd
q) NO SELECTION
Enter Selection, q to quit:

  Enter b and displays:

/iommu@0,10000000/sbus@0,1000010000/espdma@5,8400000/esp@5,8800000/sd has
been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
          for creating devalias mydev for
/iommu@0,10000000/sbus@0,1000010000/espdma@5,8400000/esp@5,8800000/sd
ok

If get in trouble:
==================

Power on the CPU holding "L1 n" keys. This sets all NVRAM values
to factory defaults.

Can also do:

ok set-defaults - sets all NVRAM values to factory defaults.

ok set-default variable

eg. ok set-default boot-device

=======================================================

Original Question:

Hi List --

Do any of you know if it's possible to set an Open Boot Prom nvram
device alias from the OS, while in multi-user mode? Kind of like "eeprom",
but for an nvram device alias. We want to change the name of our
backup boot disk nvram device alias, and would'nt it be nice if we
could do it without taking the system down? This is for an Enterprise 5000
running Solaris 2.6, OPB version 3.

Thanks,
Larry Zins



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:43 CDT