Sun-related

From My Admin Page
Jump to: navigation, search
Solaris 10 Versions
OS Released Version
Solaris-10 1/06 ("U1")
Solaris-10 6/06 ("U2")
Solaris-10 11/06 ("U3")
Solaris-10 8/07 ("U4")
Solaris-10 10/08 ("U6")
Solaris-10 5/09 ("U7")
Solaris-10 10/09 ("U8")
Solaris-10 9/10 ("U9")
Solaris-10 8/11 ("U10")
Solaris Support EOL Dates
Release GA Date Premier Extended
Sol 8 / Sol 8 Containers Feb 2000 Mar 2009 Mar 2012
Trusted Solaris 8.x Sep 2002 Mar 2012 Not Available
Sol 9 / Sol 9 Containers Mar 2002 Oct 2011 Oct 2014
Sol Legacy Containers Dec 2010 Oct 2011 Oct 2014
Solaris 10 Jan 2005 Jan 2015 Jan 2018
From: Support Coverage for Hardware and Operating Systems

Sun Solaris Related Information


Consoles

NEW USER: -> create /SP/users/<user> role=Administrator cli_mode=alom
EXISTING USER: -> set /SP/users/<user> cli_mode=alomSet 'cli_mode' to 'alom'
  • X4200 ILOM tricks. Also: Sun x4200 ILOM docs.
  • Current Patches
    • 118323 -> Sun Fire 280R / Blade 1000 / 2000
    • 119381 -> RSC 2.2.3 bug fixes for Solaris 9 and Solaris 10
    • 147307 -> T5120 / T5220
    • 142700 -> v210/v240 netra 210/240 OBP
    • 142707 -> v440 / N440 OBP PROM
    • 142702 -> v480 / v490 PROM update

Enable/Disable System Components

Ran into this after a memory upgrade on a T5220 - on boot it complained :

ERROR: MB/CMP0/MCU0 unused because MB/CMP0/MCU1 is not configured
In this instance I saw "/SYS/MB/CMP0/MCU1 | component_state | Disabled"
set /SYS/MB/CMP0/MCU1 component_state=Enabled
stop /SYS
start /SYS

Storage

Setup

  1. Mount the Solaris install DVD
  2. Change directory to: cd /cdrom/cdrom0/s0/Solaris_10/Product
  3. Install the required packages: pkgadd -d . SUNWcrman SUNWcry SUNWcryr

Ports & PIDs

Script to Show Ports & PIDs.

  • Listing all the pids:
/usr/bin/ps -ef | sed 1d | awk '{print $2}'
  • Mapping the files to ports using the PID:
/usr/proc/bin/pfiles <PID> 2>/dev/null | /usr/xpg4/bin/grep <PID>
   OR
/usr/bin/ps -o pid -o args -p <PID> | sed 1d
  • Mapping the sockname to port using the port number:
for i in `ps -e|awk '{print $1}'`; do echo $i; pfiles $i 2>/dev/null | grep 'port: 8080'; done
   OR
pfiles -F /proc/* | nawk '/^[0-9]+/ { proc=$2} ; /[s]ockname: AF_INET/ { print proc "\n " $0 }'

Freeware (Open-Source)

NOTE: As of 9/20/12 BlastWave went under, and as of 12/2012 SunFreeware is commercial

  • Try OpenCSW. (From their website) : OpenCSW is a community project dedicated to working closely with upstream projects to improve portability of open source software.
  • Applications install in: /opt/csw/bin and are managed via the "pkgutil" command. See here for getting started.

Hardware Troubleshooting

From here.

  • How to check for hardware faults: /usr/sbin/fmadm faulty
  • To clear error logs within FMA use the following steps:
clearing out FMA files with no reboot needed:
svcadm disable -s svc:/system/fmd:default
cd /var/fm/fmd
find /var/fm/fmd -type f -exec ls {} \;
find /var/fm/fmd -type f -exec rm {} \;
svcadm enable svc:/system/fmd:default
After these steps check to see if problem still exit.
fmadm faulty

Device Drivers

You can do a man on driver.conf (4) for information on device drivers.

  • Add a new Device Driver: add_drv <device driver>
  • Remove a Device Driver: rem_drv <device driver>
  • Update a Device Driver: update_drv <device driver>

Misc

iostat -E | grep Soft | awk '{ print $1}' > /tmp/a; iostat -En | grep Soft|awk '{ print $1 }' > /tmp/b; paste /tmp/a /tmp/b

Clean up /var

  • Make a backup copy
find /var/sadm/pkg -name undo.Z -o -name obsolete.Z | cpio -pdv /u00/PATCH_BACKOUTS
  • Free up space in /var
find /var/sadm/pkg -name undo.Z -o -name obsolete.Z | xargs rm -f
  • In the event that you need to back out patch 999999-01:
cd /u00/PATCH_BACKOUTS
find var/sadm/pkg | grep 999999-01 | cpio -pdv /
patchrm 999999-01
  • Typical strategy around this is to only clear out patch backout information that is old
find /var/sadm/pkg -name undo.Z -mtime +180 | xargs rm -f
I've never noticed the obsolete.Z files as a space hog, so I haven't pruned them.

Or, (from here): find /var/sadm/pkg -mtime +90 -name undo.Z -o -name obsolete.Z -exec rm {} \;

DVD and CD Stuff

  • Burn a DVD: cdrw -i <file.iso>
  • Check media in DVD player: cdrw -M
  • List writing devices: cdrw -l
  • Copy Disc
    • With CDRW: cdrw -c
    • without CDRW: dd if=<mount device> of=<file.iso> [i.e. dd if=/cdrom/sol_10_508_sparc/ of=solaris.iso]
  • Create Disc from directory (ex #2 on cdrw man page): mkisofs -r /some/dir 2>/dev/null | cdrw -i -p 1

Disk Related

SAN Related

Other pages:

Configuring and monitoring the hardware RAID controller

For hardware such as T5xxx (and T2xxx) systems. Here is a modified version of the check script from here

#!/bin/bash
#
# Program: Check the status of LSI RAID controllers 

for volume in `raidctl -l | awk -F: '/Volume/ {print $NF}'`
do
  if raidctl -l ${volume} | egrep "${volume}.*OPTIMAL" > /dev/null
  then
    logger -p daemon.notice "LSI Raid : system RAID and Volumes are in a good state"
  else
     logger -p daemon.notice "HARDWARE ERROR: The disk controller is no longer in an optimal state"
     logger -p daemon.notice "HARDWARE ERROR: Run raidctl to see if a disk failed"
  fi
done

SVM (aka SDS) Related

from here - An interesting issue where a disk isn't bad but some METAs show "Need maintenance"

  • First, verify it's not a disk hardware problem with iostat -en <disk>
  • Next, run format --> analyze --> read on the disk (won't harm OS)
  • Next, run metasync <meta>. Afterwards, a metastat command will show it as something like :
State: Needs maintenance
Invoke: after replacing "Maintenance" components:
metareplace d10 c1t0d0s0 <new device>
  • Next, just do a metareplace, such as:
# metareplace -e d10 c1t0d0s0
# metastat d10

SECURELY WIPING A DRIVE

In order to completely erase as much data as possible from a disk, the purge command in format(1M) must be used, on the active and defective portions of the disk. This requires two passes of the purge command. Procedure

1. Use format(1M) and select the disk you wish to erase. 2. Enter the defect, and primary commands to read the manufacturer's defect list, and update the in-memory defect list. Then use quit to get back to the main menu:

   format> defect
   defect> primary
   defect> quit

3. Go to the the analyze option. Enter the purge command and, when prompted,specify a slice that encompasses the entire disk(usually slice 2, but you should verify this manually. This will take a very long time, but, many disks can bepurged simultaneously, if desired. When the command returns, go back to the main menue by entering quit:

   format> analyze
   analyze> purge
   ...
   analyze> quit

4. Repeat the above steps to purge both the manufacturers', and the grown, defect lists:

   format> defect
   defect> both
   defect> quit
   format> analyze
   analyze> purge
   ...
   analyze> quit
   format> quit
What This Does
The purge command writes four patterns to the entire surface of the disk. The first three, write alternating combinations of 1's and 0's to each bit location on the surface(the actual patterns are 0xaa, 0x55 and 0xaa again). Then, purge will read, to confirm that all that data was correctly written. If all this is successful, it will do a final wite of 0x40.
This procedure complies with Department Of Defence(DOD) wipe disk standard 5220.22-M.::

Printers

# lpadmin -p chubbchkprt -v /dev/null
# lpadmin -p chubbchkprt -m netstandard
# lpadmin -p chubbchkprt -o dest=10.12.7.250:9100 -o protocol=TCP
# lpadmin -p chubbchkprt -I any
# accept chubbchkprt
     destination "chubbchkprt" now accepting requests  
# /usr/bin/enable chubbchkprt
      printer "chubbchkprt" now enabled
# lpstat -p chubbchkprt
          printer chubbchkprt is idle. enabled since Tue Sep 30 19:57:42 2008. available.
  • To discover a printer's IP, it can be found in a few places. Check
    • /etc/lp/interface/<printer> for a line starting with "PERIPH="
    • /etc/lp/printers/<printer-name>/configuration look for the "Options: " line

Patching

  • Pkgadd base directory is defined in "/var/sadm/install/admin/default" along with other defaults.
  • Getting Patch Clusters via WGET (see doc ID 1199543.1)
  • You can check Patches in: /var/sadm/patch
  • Patch Check Advanced (PCA)
    • Config file is pca.conf and goes either in the same dir as pca or in the /etc directory. Here's an example that puts the patchdiag.xref file and all the patches in the /export/home/PATCHES directory and skips patches number 119213 & 121657 (i.e. for Luminis):
xrefdir=/export/home/PATCHES
patchdir=/export/home/PATCHES
update=auto
ignore=119213
ignore=121657
After all the necessary file systems have been mounted (patches are in /var/sadm/patch/), do a dry run by running the following:
patchrm -a -R /a <patch_number>
This command does not update any of the installed software, but it validates that the necessary file systems are mounted, especially if there are non-global zones installed. If this command fails, you must resolve any issues prior to running patchrm. Make sure all file systems that contain non-global zones have been mounted, and then try again.
After "patchrm -a -R /a" passes, run the following:
patchrm -R /a <patch_number>
Take care to record the exact output for any future debugging.
**Note: Do not use any chroot commands when running patchrm from media. Also, do not run patchrm from the mounted system, for instance: /a/usr/sbin/patchrm

Password Related

Password last Changed

A script (from here) which shows when user passwords were last changed.

#!/usr/bin/perl
# Output date format is YYYY-MM-DD

open( S, "/etc/shadow" );
while( <S> )
{
($user,$lastchg) = (split /:/)[0,2];
@t = localtime( $lastchg*86400 );
printf "User %-8s last changed password %0.4d-%0.2d-%0.2d (%5d)\n",
$user, $t[5]+1900, $t[4]+1, $t[3], $lastchg;
}
close( S );
exit 0;

No Login Passwords

In Solaris 10 you can have a "Non-Login" account where you can SUDO to it or have cron jobs running but that you can't log into directly. These are setup using "passwd -N". More info here. ** Note - Solaris 10 only **

Account Parameters

  • Using the passwd command to set parameters like :
-w <warn> <------- (how many days before PW expires to <warn>)
-n <min> <--------- (<min> days before you can change PW again)
-x <max> <-------- (<max> number days password is good for)
  • To set # days inactivity before account is locked :
usermod -f <# days>
  • /etc/default/passwd
You can add " WARNWEEKS= " in there to set the default to warn about password expiry

Booting & Kernel Related

  • Show Kernel Paramters: prctl $$
  • Show TCP parameters:
for i in `ndd /dev/tcp \?|awk '{print $1}'| egrep -v "\?|tcp_status|hash|close"`;do printf "%-30s: " $i;ndd /dev/tcp $i; done
  • How to be able to FSCK "/" and everything else:
From the OK prompt: boot -m milestone=none

Recover kernel

After running into an error with a patch that was supposed to update the kernel and the system wouldn't reboot, a useful piece of information if your kernel is whacked (i.e. read bottom of this page). from the OK prompt do:

{0} ok boot -F failsafe

Or you can boot off of a Solaris CD/DVD using "boot cdrom -sw". Once in, do:

  1. Mount the root filesystem slice to /<root-fs-mount-point>
  2. rm -f /<root-fs-mount-point>/platform/`uname -m`/boot_archive
    1. EITHER: "/<root-fs-mount-point>/sbin/bootadm -a update_all"
    2. OR (to rebuild): "/<root-fs-mount-point>/sbin/bootadm update-archive -R /<root-fs-mount-point>"

Booting problems in Solaris

(from here)

1. Timeout waiting for ARP/RARP packet : At ok> type printenv and look for these parameters .

boot-device disk
mfg-switch? false
diag-switch? false
if you see “boot-device net ” or true value for the other two parameter change it to the values above. In case you wants to boot from network make sure your client is properly configured in boot server and network connections & configuration are proper.

2. The file just loaded does not appear to be executable : Boot block on the hard disk is corrupted. Boot the system in single user mode with cdrom and reinstall boot block.

# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0

3. bootblk: can’t find the boot program : boot block can not find the boot programe – ufsboot in Solaris .Either ufsboot is missing or corrupted. In such cases it can be restored from the cdrom after booting from cdrom & mounting the hard disk

# cp /platform/`uname -i`/ufsboot /mnt/platform/`uname -i`

4. boot: cannot open kernel/unix : Kernel directory or unix kernel file in this directory is not found .Probably deleted during fsck or deleted by mistake. Copy it from the cdrom or restore from the backup tape.

# cp /platform/`uname -i`/kernel/unix /mnt/platform/`uname -i`/kernel

5. Error reading ELF header ? : Kernel directory or unix kernel file in this directory is corrupted.Copy it from the cdrom or restore from the backup tape.

# cp /platform/`uname -i`/kernel/unix /mnt/platform/`uname -i`/kernel

6. Cannot open /etc/path_to_inst : System can not find the /etc/path_to_install file. It might be missing or corrupted and needs to be rebuild.

To rebuild this file boot the system with -ar option :
ok>boot -ar
Press enter to select default values for the questions asked during booting and select yes to rebuild /etc/path_to_install
The /etc/path_to_inst on your system does not exist or is empty. Do you want to rebuild this file [n]? y
system will continue booting after rebuilding the file.

7. Can’t stat /dev/rdsk/c0t3d0s0 : When booted from cdrom and done fsck the root partition comes out to be fine but on booting from root disk this error occurs. The device name for / is missing from /dev/dsk directory and to resolve the issue /dev & /devices directories has to be restored from root backup tapes.

Booting

OBP quick reference

  • boot –a => Ask me. Interactive mode prompts for the names of the boot files. (Helpful if you need to boot off an alternate /etc/system file after kernel t unable modifications.)
  • boot –D => default-file Boot from default -file.
  • boot –f => When booting an Autoclient system, forces boot program to bypass client’s local cache and read all files over the network from the file server.
  • boot –h => Boot halted. Boot into a halted state (ok prompt). Interesting, for troubleshooting boot at the lowest level.
  • boot –r => Reconfigure boot. Boot and search for all attached devices, then build device entries for anything which does not already exist. Useful when new devices are added to the system.
  • boot –s => Single user. Boots the system to run level 1.
  • boot –v => Verbose boot. Show good debugging information.
  • boot –V => Verbose boot. Show a little debugging information.

ASR Setup and Troubleshooting

ASR Troubleshooting & Documentation

ld.so.1: stclient: fatal: libm.so.2: open failed: No such file or directory

Setup

  • Before starting, install Service Tags and Service Tools Bundle (STB) on ALL systems.
  • Designate an ASR Manager server - then install SASM (SUNWsasm) on it.
Add the asr command to the PATH (update to the root's .profile, .cshrc, .kshrc. or .bashrc as needed):
PATH=$PATH:/opt/SUNWswasr/bin ; export PATH
  • On the ASR Manager server, run: asr register
    • To enable SASM service: svcadm enable sasm
    • To check registration status: asr show_reg_status
    • To test connection do: asr test_connection
  • On ASR Manager server copy /opt/SUNWswasr/ASRAssetBundle.*.tar.gz file to the various clients
  • On ASR Manager Server, register the hosts with asr activate_asset -h <host>

Solstice Disk Suite (Mirroring)

Breaking a mirrored Root drive

  • To show volumes: Metastat -c
bash-3.2# metastat -c
d4               m   21GB d14 d24
   d14          s   21GB c1t0d0s4
   d24          s   21GB c1t1d0s4
d3               m   15GB d13 d23
   d13          s   15GB c1t0d0s3
   d23          s   15GB c1t1d0s3
d1               m   14GB d11 d21
   d11          s   14GB c1t0d0s1
   d21          s   14GB c1t1d0s1
d0               m   14GB d10 d20
   d10          s   14GB c1t0d0s0
   d20          s   14GB c1t1d0s0
  • Next detach all the mirrors from the same disk using metadetach. In this instance we'll remove c1t1d0s*
bash-3.2# metadetach d4 d24
d4: submirror d24 is detached
bash-3.2# metadetach d3 d23
d3: submirror d23 is detached
bash-3.2# metadetach d1 d21
d1: submirror d21 is detached
bash-3.2# metadetach d0 d20
d0: submirror d20 is detached
bash-3.2# metastat -c
d4               m   21GB d14
    d14          s   21GB c1t0d0s4
d3               m   15GB d13
    d13          s   15GB c1t0d0s3
d1               m   14GB d11
    d11          s   14GB c1t0d0s1
d0               m   14GB d10
    d10          s   14GB c1t0d0s0
d24              s   21GB c1t1d0s4
d23              s   15GB c1t1d0s3
d21              s   14GB c1t1d0s1
d20              s   14GB c1t1d0s0
  • Next set the boot device to be the disk instead of the meta device: metaroot /dev/dsk/c1t0d0s0
  • Next update /etc/vfstab with the right devices (don't need to fix d0 - that was done in the last step)
Before:

/dev/md/dsk/d3  -               -               swap    -       no      -
/dev/md/dsk/d1  /dev/md/rdsk/d1 /usr            ufs     1       no      logging
/dev/md/dsk/d4  /dev/md/rdsk/d4 /var            ufs     1       no      logging

After:

/dev/dsk/c1t0d0s0  /dev/rdsk/c1t0d0s0   /               ufs     1       no      -
/dev/dsk/c1t0d0s1  /dev/rdsk/c1t0d0s1   /usr            ufs     1       no      logging
/dev/dsk/c1t0d0s4  /dev/rdsk/c1t0d0s4   /var            ufs     1       no      logging
  • Reboot. If everything looks OK, then destroy the remaining mirrors / sub-mirrors
for i in `metastat -c | awk '{print $1}'`;do metaclear -r $i; done