* You are viewing the archive for the ‘openboot’ Category

Forcing network speed and duplex in Open Boot prompt

I had a Sun box attached to a switch I had not control over and I needed to jumpstart it. Unfortunately, I was getting nowhere. After crosschecking everything in my setup the only thing I did not try was to force speed and duplex on the Sun box to see if it would start booting.

I wondered if it would be possible to do so in Open Boot prompt. So I fired up the most logical man page in the given situation – the boot man page. Sure enough it is possible to force speed and duplex from ok prompt:

{1} ok boot net:speed=100,duplex=full - install

And off it went happily booting… Continue Reading

Mirroring root disk using SVM

There are about 487359 documents on the Internet about how to mirror root disk in Solaris. So, here is 487360th.

The assumptions are following: the first disk has Solaris already installed, root slice is slice 1, and the disks are identical with the same size and geometry. If they have different cylinder, head, sector count or different size you will have to fiddle with sizing slices more.

The first step is to recreate the same slice arrangement on the second disk:

bash-3.00# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
fmthard: New volume table of contents now in place.

You can check both disks have the same VTOC using prtvtoc command

bash-3.00# prtvtoc /dev/rdsk/c1t0d0s2
* /dev/rdsk/c1t0d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*     424 sectors/track
*      24 tracks/cylinder
*   10176 sectors/cylinder
*   14089 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
0      3    01          0   4100928   4100927
1      2    00    4100928  20484288  24585215
2      5    00          0 143349312 143349311
3      8    00   24585216 118672512 143257727
7      0    00  143257728     91584 143349311

Now we have to create state database replicas on slice 7. We will be adding two replicas to each slice:

bash-3.00# metadb -a -f -c2 /dev/dsk/c1t0d0s7
bash-3.00# metadb -a -f -c2 /dev/dsk/c1t1d0s7

Database replicas are crucial part of SVM. Here is some important information about how they work, how many you need, etc.

Since the database replicas are in place we can start creating metadevices. The following commands will create metadevice d31 from slice c1t0d0s3, and metadevice d32 from slice c1t1d0s3. Then we create mirror d30 with d31 attached as a submirror. Finally we will attach submirror d32 to mirror d30. Once d32 is attached, the mirror d30 will automatically start syncing.

bash-3.00# metainit -f d31 1 1 c1t0d0s3
d31: Concat/Stripe is setup
bash-3.00# metainit -f d32 1 1 c1t1d0s3
d32: Concat/Stripe is setup
bash-3.00# metainit d30 -m d31
d30: Mirror is setup
bash-3.00# metattach d30 d32
d30: submirror d32 is attached

The procedure is the same for all other mirrors you might want to create. Root filesystem is slightly different. First you will have to create your submirrors. Then you will have to attach submirror with existing root filesystem, in this case d11, to the new mirror metadevice d10. Then you will have to run metaroot command. It will alter / entry in /etc/vfstab. Finally, you flush the filesystem using lockfs command and reboot.

bash-3.00# metainit -f d11 1 1 c1t0d0s1
d31: Concat/Stripe is setup
bash-3.00# metainit -f d12 1 1 c1t1d0s1
d32: Concat/Stripe is setup
bash-3.00# metainit d10 -m d11
d30: Mirror is setup
bash-3.00# metaroot d10
bash-3.00# lockfs -fa
bash-3.00# reboot

When the system reboots, you can attach the second submirror to d10 as follows:

bash-3.00# metattach d10 d12

You can check the sync progress using metastat command. Once all mirrors are synced up the next step is to configure the new swap metadevice, in my case d0, to be crash dump device. This is done using dumpadm command:

bash-3.00# dumpadm
Dump content: kernel pages
Dump device: /dev/dsk/c1t0d0s0 (dedicated)
Savecore directory: /var/crash/ultra
Savecore enabled: yes
bash-3.00# dumpadm -d /dev/md/dsk/d0

The final step is to modify PROM. First we need to find out which two physical devices c1t0d0 and c1t1d0 refer to:

bash-3.00# ls -l /dev/dsk/c1t0d0s1
lrwxrwxrwx 1 root root 43 Mar 4 14:38 /dev/dsk/c1t0d0s1 -> ../../devices/pci@1c,600000/scsi@2/sd@0,0:b
bash-3.00# ls -l /dev/dsk/c1t1d0s1
lrwxrwxrwx 1 root root 43 Mar 4 14:38 /dev/dsk/c1t1d0s1 -> ../../devices/pci@1c,600000/scsi@2/sd@1,0:b

The physical device path is everything starting from /pci…. Please make a note of sd towards the end of the device string. When creating device aliases below, sd will have to be changed to disk.

Now we create two device aliases called root and backup_root. Then we set boot-device to be root and backup_root. The :b refers to slice 1(root) on that particular disk.

bash-3.00# eeprom "use-nvramrc?=true"
bash-3.00# eeprom "nvramrc=devalias root /pci@1c,600000/scsi@2/disk@0,0 devalias backup_root /pci@1c,600000/scsi@2/disk@1,0"
bash-3.00# eeprom "boot-device=root:b backup_root:b net"

Now we can test that the system boot from both root and backup_root devices.

There is one more optional step. Adding two kernel tunables to /etc/system file. The first one is md_mirror:md_resync_bufsz which will speed up mirror resync. The second one is md:mirrored_root_flag. When this flag is enabled the system will boot even if less than majority of database replicas is available. Personally, I do not use the second tunable. More on these can be found in Solaris Tunable Parameters Reference Guide. Continue Reading

Determining ethernet MAC address from Open Boot prompt

Today I had a need to jumpstart SunFire V240 using network interface in one of its PCI slots. In order to do that I need to find the MAC address of that interface, preferably with least amount of hassle. There was no Solaris installed and all I had was ok prompt. So I took a quick look at device aliases:

{1} ok devalias
xnet2                    /pci@1d,700000/pci@1/SUNW,hme@0,1:dhcp,
xnet1                    /pci@1e,600000/pci@3/SUNW,hme@0,1:dhcp,
xnet                     /pci@1e,600000/pci@2/SUNW,hme@0,1:dhcp,
net3                     /pci@1d,700000/network@2,1
net2                     /pci@1d,700000/network@2
net1                     /pci@1f,700000/network@2,1
net                      /pci@1f,700000/network@2
cdrom                    /pci@1e,600000/ide@d/cdrom@0,0:f
ide                      /pci@1e,600000/ide@d
disk3                    /pci@1c,600000/scsi@2/disk@3,0
disk2                    /pci@1c,600000/scsi@2/disk@2,0
disk1                    /pci@1c,600000/scsi@2/disk@1,0
disk0                    /pci@1c,600000/scsi@2/disk@0,0
disk                     /pci@1c,600000/scsi@2/disk@0,0
scsi                     /pci@1c,600000/scsi@2
sc-control               /pci@1e,600000/isa@7/rmc-comm@0,3e8
ttyb                     /pci@1e,600000/isa@7/serial@0,2e8
ttya                     /pci@1e,600000/isa@7/serial@0,3f8
name                     aliases

Starting with first net* alias I did:

{1} ok cd /pci@1d,700000
{1} ok ls
f00f8dac network@1
f00b3274 network@2,1
f00acbf4 network@2
{1} ok cd network@1
{1} ok ls
{1} ok pwd
/pci@1d,700000/network@1
{1} ok .properties
assigned-addresses       82000810 00000000 00600000 00000000 00200000
82000830 00000000 00100000 00000000 00100000
d-fru-len                00000000
d-fru-off                0000e800
d-fru-dev                eeprom
s-fru-len                00000800
s-fru-off                0000e000
s-fru-dev                eeprom
compatible               pci108e,abba.11
pci108e,abba
pciclass,020000
pciclass,0200
reg                      00000800 00000000 00000000 00000000 00000000
02000810 00000000 00000000 00000000 00200000
02000830 00000000 00000000 00000000 00100000
address-bits             00000030
max-frame-size           00004000
device_type              network
name                     network
local-mac-address        00 03 ba 4d b3 3f
version                  Sun PCI Gigaswift Base-X FCode 2.6 01/09/27
phy-type                 pcs
board-model              501-5524
model                    SUNW,pci-ce
fcode-rom-offset         00000000
66mhz-capable
fast-back-to-back
devsel-speed             00000002
latency-timer            00000040
cache-line-size          00000010
max-latency              00000040
min-grant                00000040
interrupts               00000001
00000002
00000003
00000004
class-code               00020000
revision-id              00000011
device-id                0000abba
vendor-id                0000108e

The MAC address of the network interface is shown in local-mac-address field above. All it took then was following boot command to get jumpstart going:

{1} ok boot /pci@1d,700000/network@1 -v - install nowin Continue Reading

Viewing devaliases inside Solaris

Usually, when you need to view or manipulate content of EEPROM you can use eeprom command in Solaris. However, it’s not of much use if you need to view current device aliases. There is a simple way to do so using prtconf command. Just look for section aliases:


bash-3.00# prtconf -vp

<—————–SNIP—————–>
Node 0xf002d470
disk: '/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@0,0:b'
rootdk: '/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@1,0:b'
disk1: '/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@1,0'
disk0: '/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@0,0'
ide: '/pci@8,700000/ide@6'
scsi: '/pci@9,600000/SUNW,qlc@2'
cdrom: '/pci@8,700000/ide@6/cdrom@0,0:f'
net: '/pci@9,700000/network@2'
net1: '/pci@9,600000/network@1'
net0: '/pci@9,700000/network@2'
flash: '/pci@9,700000/ebus@1/flashprom@0,0'
idprom: '/pci@9,700000/ebus@1/i2c@1,2e/idprom@4,a4'
nvram: '/pci@9,700000/ebus@1/i2c@1,2e/nvram@4,a4'
i2c1: '/pci@9,700000/ebus@1/i2c@1,30'
i2c0: '/pci@9,700000/ebus@1/i2c@1,2e'
bbc: '/pci@9,700000/ebus@1/bbc@1,0'
rsc-console: '/pci@9,700000/ebus@1/rsc-console@1,3083f8'
rsc-control: '/pci@9,700000/ebus@1/rsc-control@1,3062f8'
ttya: '/pci@9,700000/ebus@1/serial@1,400000:a'
pci9b: '/pci@9,700000'
pci9a: '/pci@9,600000'
pci8b: '/pci@8,700000'
pci8a: '/pci@8,600000'
ebus: '/pci@9,700000/ebus@1'
name: 'aliases'

<—————–SNIP—————–> Continue Reading