Archive for tips

Upgrade Sun Microsystems OBP (OpenBoot PROM) with tftp

Why is this soo cool? Because the default way to upgrade the OBP is to have a running system. But some times

If you have a working jump start enviroment most of the work is already done, yaha. You actully dont even have to use a solaris box to act as the upgrade server any tftp server will do.

So basically what I did here is used a already set up jump start server to upgrade the OBP on a Sun Fire v240. I deleted the link to the solaris kernel and created a symlink from the mac address to the upgrade binary.

bash-3.00# pwd
/tftpboot
bash-3.00# ls -l
total 458
lrwxrwxrwx 1 root root 27 Jun 6 11:40 0A2483F9 -> inetboot.SUN4U.Solaris_10-1
lrwxrwxrwx 1 root root 27 Jun 6 11:40 0A2483F9.SUN4U -> inetboot.SUN4U.Solaris_10-1
-rwxr-xr-x 1 root root 217016 Jun 6 11:40 inetboot.SUN4U.Solaris_10-1
drwxr-xr-x 2 root root 512 Jun 5 12:07 ODBUpgrade
-rw-r–r– 1 root root 321 Jun 6 11:40 rm.10.36.131.249
lrwxrwxrwx 1 root root 1 Jun 5 10:23 tftpboot -> .

bash-3.00# ls -l ODBUpgrade/
total 7888
-rw-r–r– 1 root root 1482292 Jun 5 12:07 flash-update-Blade100
-rw-r–r– 1 root root 2534420 Jun 5 12:07 flash-update-SunFire240

Comments

Deleting files with special charaters

Deleting file that have special characters in them can be tricky. This is what you have to do to delete them.

because rm -r -file will give you a error
[root@solaris:/]# rm -C

rm: illegal option — C
usage: rm [-fiRr] file …

so what you have to do is search figure out what the inode is

[root@solaris:/]# ls -il -C
total 2723130
32081 -rw-r–r– 1 root root 1392916480 Dec 4 14:55 -C

the 32081 is the inode number

[root@solaris:/u10/app 102]# find . -inum 32081 -exec rm -i {} \;
rm: remove ./-C (yes/no)? y

now the file is gone, yaha!

Comments

How to fix a corrupt Solaris package database

When trying to remove package SMCsudo you get the error

#pkgrm SMCsudo

The following package is currently installed:
SMCsudo sudo
(sparc) 1.6.8p4

Do you want to remove this package? y

## Removing installed package instance <SMCsudo>
(A previous attempt may have been unsuccessful.)
## Verifying package dependencies.
## Processing package information.
## Removing pathnames in class <none>
/usr/local/sbin <shared pathname not removed>
/usr/local/man <shared pathname not removed>
/usr/local/libexec <shared pathname not removed>
/usr/local/etc <shared pathname not removed>
/usr/local/doc <shared pathname not removed>
/usr/local/bin <shared pathname not removed>
## Updating system information.
pkgrm: ERROR: bad read of contents file
pkgrm: ERROR: pathname=/usr/lib/iconv/sparcv9/UTF-8%PCK.so
pkgrm: ERROR: problem=no memory for package information

do

# cd /var/sadm/pkg

which is where the package database is located

then delete the offending package that you are trying to remove.

rm -rf SMCsudo

Then the package is removed the ugly (hack) way.

So then you can now install thenewer version of the same package.

# pkgadd -d /tmp/SMCsudo

Comments

check that syslog is working

logger is the program that you can use to send syslog messages. On solaris systems if syslog is not set up to send syslog messages remotely or set up properly then syslog will just send the “Hello World” message to /var/adm/messages. Please note that /etc/syslog.conf does not like spaces it only likes tabs, any spaces can break the config. While local3.alert is the is the message facilitie, change it based on your setup.

$ logger -p local3.alert “Hello World”

Numerical
   Code    Faciltiy                                     Reference
---------  --------					---------

    0      kernel messages  				[RFC3164]
    1      user-level messages  			[RFC3164]
    2      mail system  				[RFC3164]
    3      system daemons  				[RFC3164]
    4      security/authorization messages (note 1) 	[RFC3164]
    5      messages generated internally by syslogd  	[RFC3164]
    6      line printer subsystem  			[RFC3164]
    7      network news subsystem  			[RFC3164]
    8      UUCP subsystem  				[RFC3164]
    9      clock daemon (note 2) 			[RFC3164]
   10      security/authorization messages (note 1) 	[RFC3164]
   11      FTP daemon 					[RFC3164]
   12      NTP subsystem 				[RFC3164]
   13      log audit (note 1) 				[RFC3164]
   14      log alert (note 1) 				[RFC3164]
   15      clock daemon (note 2) 			[RFC3164]
   16      local use 0  (local0) 			[RFC3164]
   17      local use 1  (local1) 			[RFC3164]
   18      local use 2  (local2) 			[RFC3164]
   19      local use 3  (local3) 			[RFC3164]
   20      local use 4  (local4) 			[RFC3164]
   21      local use 5  (local5) 			[RFC3164]
   22      local use 6  (local6) 			[RFC3164]
   23	   local use 7  (local7) 			[RFC3164]

Comments

Change boot up parameters with out going to the OK prompt

eeprom is used to change BootPROM environment variables. If you dont use eeprom then you would have to do init 0 and make the changes from the OK prompt but why would you want to bring your server down in order to make boot up (BootPROM) changes if you dont have to.

eeprom - EEPROM display and load utility

# eeprom
test-args: data not available.
diag-passes=1
local-mac-address?=false
fcode-debug?=false
silent-mode?=false
scsi-initiator-id=7
oem-logo: data not available.
oem-logo?=false
oem-banner: data not available.
oem-banner?=false
ansi-terminal?=true
screen-#columns=80
screen-#rows=34
ttya-rts-dtr-off=false
ttya-ignore-cd=true
ttya-mode=9600,8,n,1,-
output-device=ttya
input-device=ttya
auto-boot-on-error?=false
load-base=16384
auto-boot?=true
boot-command=boot
diag-file: data not available.
diag-device=net
boot-file: data not available.
boot-device=/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w2100000c507aa519,0:a disk net
use-nvramrc?=false
nvramrc=devalias vx-rootdisk /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w2100000c507aa519,0:a
devalias vx-rootmirror /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w2100000c507acb2d,0:a
security-mode=none
security-password: data not available.
security-#badlogins=0
diag-out-console=false
post-trigger=error-reset power-on-reset
diag-script=normal
diag-level=min
diag-switch?=false
obdiag-trigger=error-reset power-on-reset
error-reset-recovery=boot

Will the server start booting when you turn it on or will it just sit at the OK prompt. Lets see.

# eeprom |grep auto-boot
auto-boot-on-error?=false
auto-boot?=true

Humm looks like it will be booting at power on, that is a good thing(most of the time). There are many boot up options that can also be changes such as boot device, diagnostics levels, serial display settings, and many others.

Comments

« Previous entries