Gopi Desaboyina Solaris Blogs

Just another WordPress.com weblog

Parsing ldom-db.xml

In case if you don’t have existing output of ldm ls -l o/p. You can use below python script to parse the existing ldm-db.xml and generate commands for you.

Usage : ./ldom-parse.py ldom-db.xml

#!/usr/bin/env python
# Author - Gopi Desaboyina

#from elementtree import ElementTree as ET
from xml.etree import ElementTree as ET
import sys

# Print usage if ldom-db.xml file is not passed as argument.
if (len(sys.argv)<2 ):
print “Usage : “+sys.argv[0],”ldom-db.xml”
sys.exit(1)
# create a file object by opening it.
xmlfile=open(sys.argv[1])
tree = ET.parse(xmlfile)
#
ldms=tree.findall(‘ldom’)
#
for ldm in ldms: #{A
domain=ldm.find(‘ldom_name’).text
cpus=ldm.find(‘cpu/number’).text
mau=ldm.find(‘mau/number’).text
mem=ldm.find(‘memory/size’).text
print “\n\n\n”
print “LDOM Name: “+domain
print “CPUS : “+cpus
print “MAU : “+mau
print “Memory : “+mem
print “# ldm add-domain”,domain
print “# ldm set-vcpu”,cpus,domain
print “# ldm set-mem”,mem,domain
print “# ldm set-crypto”,mau,domain
#
for pvcc in ldm.findall(‘vcc/vcc_instance’):#{
vcc_name=pvcc.find(‘service_name’).text
min_port=pvcc.find(‘min_port’).text
max_port=pvcc.find(‘max_port’).text
print “\nConsole :\t”+vcc_name,min_port+”-“+max_port
print “# ldm add-vcc port-range=”+min_port+”-“+max_port,vcc_name,domain
#}
for gvcc in ldm.findall(‘console/console_instance’):#{
gvccport=gvcc.find(‘port’).text
print “\nConsole:”+gvccport
print “# ldm set-vcons port=”+gvccport,domain
#}
if ldm.find(‘ldom_name’).text == “primary”:
print “Primary Network :”
for vsws in ldm.findall(‘vsw/vsw_instance’): #{
vsw=vsws.find(‘service_name’).text
netdev=vsws.find(‘dev_path’).text
defvlanid=vsws.find(‘default-vlan-id’).text
defpvid=vsws.find(‘pvid’).text
print “\t\t”, ” Service:”+vsw+\
” Device:”+netdev+\
” VLAN ID:”+defvlanid+\
” PVID:”+defpvid
print “# ldm add-vsw default-vlan-id=”+defvlanid,”pvid=”+defpvid,”net-dev=”+netdev,vsw,domain
print “\nPrimary Disks :”
#}
for pvds in ldm.findall(‘vds/vds_instance’): #{
vdsserver=pvds.find(‘service_name’).text
print “\t VDS Service :”,vdsserver
print “# ldm add-vds”,vdsserver,domain
for pvol in pvds.findall(‘vds_volumes/vds_volume’): #{
phy=pvol.find(‘block_dev’).text
vol=pvol.find(‘vol_name’).text
print “Physical:Volume “+phy,vol
print “# ldm add-vdsdev”,phy,vol+”@”+vdsserver+”\n”
#}}
print “\nGuest Net:”
for nets in ldm.findall(‘network/network_instance’):#{
gvsw=nets.find(‘service_name’).text
gvnet=nets.find(‘vnet_name’).text
vid=” ”
pvid=” ”
if nets.find(‘vid’).text is not None:
vid=nets.find(‘vid’).text
if nets.find(‘pvid’).text is not None:
pvid=nets.find(‘pvid’).text
print “\t\t\t”+”vnet:”+gvnet+” vid:”+vid+” pvid:”+pvid
print “# ldm add-vnet”,”pvid=”+pvid,”vid=”+vid,gvnet,gvsw,domain+” #Caution pvid/vid can be NULL sometimes.So remove them if any of them NULL”
#}
print “\nGuest Disks :”
for vdisks in ldm.findall(‘disk/disk_instance’): #{
gvdisk=vdisks.find(‘vdisk_name’).text
gvds=vdisks.find(‘service_name’).text
gvol=vdisks.find(‘vol_name’).text
print “\t\t\t”,”vdisk:”,gvdisk,”VDS:”+gvds,”Vol:”+gvol
print “# ldm add-vdisk”,gvdisk,gvol+”@”+gvds,domain
#}
print “\nVariables : # ldm set-var … You gotta do yourself buddy”
for vars in ldm.findall(‘variables/var’):#{
print “\t”+vars.find(‘name’).text+”: \””+vars.find(‘value’).text+”\””
#}

#}
# Close the xmlfile which we opened in the starting.
xmlfile.close

 

August 3, 2012 Posted by | Solaris | 1 Comment

Solaris boots to single user mode and reboots automatically

Symptoms :
==========

1) System comes to single user mode and reboots automatically.
2) hostname is unknown. /etc/nodename, /etc/hosts, /etc/hostname.<interface> files are proper.
3) no changes recently.

Boot logs :
=======

ok boot –svV


Boot device: /pci@1c,600000/scsi@2/disk@0,0:a  File and args: -svV
|/-\|/-\|/-\|/-\|/-|/-\|/-\|/-\|/-\|/-\|/module /platform/sun4u/kernel/sparcv9/unix: text at [0x1000000, 0x10ac96d] data at 0x1800000
module /platform/sun4u/kernel/sparcv9/genunix: text at [0x10ac970, 0x1291f67] data at 0x18569c0
module /platform/SUNW,Sun-Fire-V210/kernel/misc/sparcv9/platmod: text at [0x1291f68, 0x12929f7] data at 0x18ae000
module /platform/sun4u/kernel/cpu/sparcv9/SUNW,UltraSPARC-IIIi: text at [0x1292a00, 0x12a3d0f] data at 0x18ae880
SunOS Release 5.10 Version Generic_147440-09 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|Ethernet address = 0:14:4f:54:0:a5
/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-mem = 1048576K (0x40000000)
avail mem = 1016119296
root nexus = Sun Fire V210
pseudo0 at root
pseudo0 is /pseudo
scsi_vhci0 at root
scsi_vhci0 is /scsi_vhci
pcisch2 at root: SAFARI 0x1c 0x600000
pcisch2 is /pci@1c,600000
/pci@1c,600000/scsi@2 (glm0):
       glm0 supports power management.
/pci@1c,600000/scsi@2 (glm0):
       Rev. 0 Symbios 53c1010-33/66 found.
PCI-device: scsi@2, glm0
glm0 is /pci@1c,600000/scsi@2
sd4 at glm0: target 0 lun 0
sd4 is /pci@1c,600000/scsi@2/sd@0,0
root on /pci@1c,600000/scsi@2/disk@0,0:a fstype ufs
pcisch1 at root: SAFARI 0x1e 0x600000
pcisch1 is /pci@1e,600000
PCI-device: isa@7, ebus0
ebus0 is /pci@1e,600000/isa@7
mc-us3i0 at root: SAFARI 0x0 0x0 …
mc-us3i0 is /memory-controller@0,0
power0 at ebus0: offset 0,800
power0 is /pci@1e,600000/isa@7/power@0,800
rmc_comm0 at ebus0: offset 0,3e8
PCI-device: pmu@6, pmubus0
PCI-device: gpio@80000000, pmugpio0
pmugpio0 is /pci@1e,600000/pmu@6/gpio@80000000
pseudo-device: rmclomv0
rmclomv0 is /pseudo/rmclomv@0
Hardware watchdog enabled
pseudo-device: dld0
dld0 is /pseudo/dld@0
PCI-device: usb@a, ohci0
ohci0 is /pci@1e,600000/usb@a
su0 at ebus0: offset 0,3f8
su0 is /pci@1e,600000/isa@7/serial@0,3f8
cpu0: UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x34 clock 1336 MHz)
iscsi0 at root
iscsi0 is /iscsi
Booting to milestone "milestone/single-user:default".
The / file system (/dev/rdsk/c1t0d0s0) is being checked.
Hostname: unknown                 <<<<<————- /etc/hosts, /etc/hostname.<interface>, /etc/nodename everything is correct. still hostname is unknown.
syncing file systems… done      <<<<<—– Automatic Reboot.
rebooting…
Probing system devices
Probing memory
Probing I/O buses

Sun Fire V210, No Keyboard
Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.30.4.a, 1024 MB memory installed, Serial #72614053.
[..]

Errors seen in /var/adm/messages after booting from cdrom and mounting root slice.
===================================================

messages.0:Jan 13 22:36:23 gophostsendmail[1749]: [ID 801593 mail.crit] q0DDaNrC001749: SYSERR(root): fill_fd: disconnect: fd 0 not open: Bad file number
messages.0:Jan 13 22:36:23 gophostsendmail[1749]: [ID 801593 mail.alert] q0DDaNrC001749: SYSERR(root): fill_fd: disconnect: cannot open /dev/null: No such file or directory
messages.0:Jan 13 22:36:23 gophostsendmail[1750]: [ID 801593 mail.crit] q0DDaNNn001750: SYSERR(root): fill_fd: disconnect: fd 0 not open: Bad file number
messages.0:Jan 13 22:36:23 gophostsendmail[1750]: [ID 801593 mail.alert] q0DDaNNn001750: SYSERR(root): fill_fd: disconnect: cannot open /dev/null: No such file or directory

Solution :
============

Based on the erorr it’s obvious that /dev/null link is missing. So solution should be

1. boot cdrom -s
2. mount /dev/dsk/c0t0d0s0 /a # here c0t0d0s0 being your root slice.
3. devfsadm -Cv -r /a ; pkgchk -f -R /a should fix the issue. in my case problem was resolved by pkgchk -f -R /a

February 8, 2012 Posted by | Solaris | Leave a comment

patchadd/patchrm/installcluster/installpatchset from failsafe/CD when non-global zones are involved.

Failed to boot non-global zone <zone name> during patchadd or patchrm or installpatchset

1. boot off CDROM/failsafe

# df -h
Filesystem             size   used  avail capacity  Mounted on
/ramdisk:a             228M   213M     0K   100%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   613M   184K   612M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
swap                   613M   312K   612M     1%    /tmp
/tmp/dev               613M   312K   612M     1%    /dev
fd                       0K     0K     0K     0%    /dev/fd
rpool/ROOT/zfsbe        25G   5.6G   2.2G    72%    /a
rpool                   25G    43K   2.2G     1%    /a/rpool
/dev/dsk/c0t0d0s7      7.9G   5.1G   2.7G    66%    /mnt  <<<<<—This is where my recommended patch set is there.

2. Import the rpool [or] mount the ufs root, /var , /usr , /opt

# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
rpool             23.1G  2.22G  43.5K  /a/rpool
rpool/ROOT        5.62G  2.22G    31K  legacy
rpool/ROOT/zfsbe  5.62G  2.22G  5.62G  /a
rpool/dump         528M  2.23G   512M  –
rpool/swap        17.0G  18.8G   408M  –

# ./installpatchset -R /a  –s10patchset

Setup ………zoneadm: /a/zonepool/zone1: No such file or directory
could not verify zonepath /a/zonepool/zone1 because of the above errors.
zoneadm: zone zone1 failed to verify

ERROR: Zone verification failed : unable to mount zone ‘zone1’.

# patchrm -R /a 147989-01   # same case with patchadd too.
Validating patches…

Loading patches installed on the system…

Done!

Checking patches that you specified for removal.

Done!

Approved patches will be removed in this order:

147989-01
Preparing checklist for non-global zone check…

Checking non-global zones…

Failed to boot non-global zone zone1

# Since my local zones are on zonepool and it’s not imported. hence the above errors. if it’s UFS you need to find where exactly they needs to be mounted.

# You can find out this by reading /a/etc/zones/index file. ex: below.

# zpool import
  pool: zonepool
    id: 11568960480359416427
state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and
        the ‘-f’ flag.
   see:
http://www.sun.com/msg/ZFS-8000-EY
config:

        zonepool    ONLINE
          c0t2d0    ONLINE
# cat /a/etc/zones/index
global:installed:/
zone1:installed:/zonepool/zone1:f5055e59-7e9f-4af7-bfa8-edefff15c682  

# My local zones were under /zonepool. Since we mounted root under /a, zonepool should be mounted under /a/zonepool. If other zones or on different pools or file-systems you need to import/mount them to respective directory.

# zpool import -R /a zonepool
libshare SMF initialization problem: entity not found

# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
rpool             23.1G  2.22G  43.5K  /a/rpool
rpool/ROOT        5.62G  2.22G    31K  legacy
rpool/ROOT/zfsbe  5.62G  2.22G  5.62G  /a
rpool/dump         528M  2.23G   512M  –
rpool/swap        17.0G  18.8G   408M  –
zonepool          4.41G  11.2G    32K  /a/zonepool
zonepool/zone1    4.41G  11.2G  4.41G  /a/zonepool/zone1

# ls -ltr /a/zonepool
total 3
drwx——   4 root     root           4 Dec 23 23:18 zone1

# patchrm -R /a 147989-01
Validating patches…

Loading patches installed on the system…

Done!

Checking patches that you specified for removal.

Done!

Approved patches will be removed in this order:

147989-01
Preparing checklist for non-global zone check…

Checking non-global zones…

Restoring state for non-global zone zone1…

This patch passes non-global zone check.
147989-01

Summary for zones:

Zone zone1

Rejected patches:
None.

Patches that passed the dependency check:
147989-01

Removing patches from non-global zones

Removing patches from zone zone1 # <<<<<<<<<<<>>>>>>>>>>>>>>>>>
Booting non-global zone zone1 for patching…
Removing patch 147989-01…
Done!

Checking installed patches…

Backing out patch 147989-01…

Patch 147989-01 has been backed out.

Restoring state for non-global zone zone1…

Removing patches from global zone
Removing patch 147989-01…

Checking installed patches…

Executing prebackout script…
Backing out patch 147989-01…

Executing postbackout script…
Patch 147989-01 has been backed out.

Done!
#

There you go.

December 27, 2011 Posted by | Solaris | 1 Comment

df: failed to open /etc/mnttab: Permission denied

User’s can’t run df -k and gets below error.

non-root-user@system$ df -k
df: failed to open /etc/mnttab: Permission denied

non-root-user@system$ ls -l /etc/mnttab
-r–r—–   6 root     root        3584 Jul 17 06:07 /etc/mnttab

Try to change the permissions using root id. will get below error.
root# id
uid=0(root) gid=0(root)

root# chmod 444 /etc/mnttab
chmod: WARNING: can’t change /etc/mnttab

Cause for the Problem :
   This problem happens when at one point of time when users booted of CD-ROM or failsafe changed the permissions on /etc/mnttab inadvertently.

Fix :
1. Boot of CDROM. mount the root slice on /a & do chmod 444 /a/etc/mnttab
  (Or)
2.  On Running system.
    # mkdir -m 755 /alt-root
    # mount -F lofs -o nosub / /alt-root #lofs as / as /alt-root
    # chmod 444 /alt-root/etc/mnttab
    # umount /alt-root
    # ls -l /etc/mnttab
    -r–r–r– 4 root root 2485 Jul 7 08:53 /etc/mnttab
    # rmdir /alt-root

There you go.

August 29, 2011 Posted by | Solaris | Leave a comment

Mounting root on rpool/ROOT/<BE NAME> with filesystem type zfs is not supported

root device: disk1:a  File and args:
SunOS Release 5.10 Version Generic_144488-17 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
\
SC Alert: Failed to send email alert for recent event.
Mounting root on rpool/ROOT/20110809 with filesystem type zfs is not supported

panic[cpu0]/thread=180e000: vfs_mountroot: cannot remount root

000000000180b950 genunix:vfs_mountroot+398 (60031d00080, 18ea700, 190e150, 1934800, 193cc00, 18e5470)
  %l0-3: 0000060031d00080 000000000129a800 00000000018e4f28 0000060031d00080
  %l4-7: 000000000190e150 0000000000002420 0000000000000420 0000000000002000
000000000180ba10 genunix:main+100 (183fa20, 183f800, 1888740, 10b5800, 0, 1)
  %l0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  %l4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000

syncing file systems… done
skipping system dump – no dump device configured
rebooting…

SC Alert: Host System has Reset

Normally this problem happens when /etc/system has svm root dev & vfstab has entries for root with md. it supposed to have rpool entries.
1. Boot from Alternative/CD. import the rpool & mount it on /a
2. vi /a/etc/system and make sure you don’t have any SVM md as root dev. rootdev:xxxxxxx . Delete this line
3. check /a/etc/vfstab and make necessary changes to reflect the correct device.

August 29, 2011 Posted by | Solaris | 3 Comments

What Solaris Software Configuration Cluster is installed on my machine ?

What Solaris Software Configuration Cluster is installed on my machine ?

# cat /var/sadm/system/admin/CLUSTER

CLUSTER=SUNWCXall

What all Solaris Software clusters are available for installation and their description ?

You can get this from Solaris OS CD Product directory. You can also get this from Installed system in /var/sadm/system/admin/.clustertoc

# pwd
/cdrom/sol_10_910_x86/Solaris_10/Product

# sed -n ‘/METACLUSTER/{p;n;p;n;p;}’ .clustertoc  # New lines added for easy reading.


METACLUSTER=SUNWCXall
NAME=Entire Distribution plus OEM support
DESC=A pre-defined software configuration consisting of all software included in the operating system release, plus OEM platform support.

METACLUSTER=SUNWCall
NAME=Entire Distribution
DESC=A pre-defined software configuration consisting of all software included in the operating system release.

METACLUSTER=SUNWCprog
NAME=Developer System Support
DESC=A pre-defined software configuration consisting of the typical software used by software developers.

METACLUSTER=SUNWCuser
NAME=End User System Support
DESC=A pre-defined software configuration consisting of the typical software required by end-users running a desktop.

METACLUSTER=SUNWCreq
NAME=Core System Support
DESC=A pre-defined small software configuration consisting of the software for a networked system.

METACLUSTER=SUNWCrnet
NAME=Reduced Networking Core System Support
DESC=A pre-defined software configuration consisting of the minimum required software for a system with reduced network support.

METACLUSTER=SUNWCmreq
NAME=Minimal Core System Support
DESC=Internal private metacluster not installable by end users.

July 5, 2011 Posted by | Solaris | Leave a comment

Working with SVM disks when booted from CDROM/DVD/Net/Failsafe

NOTE:  If site has already modified one side of the mirror — DO NOT use this procedure, you must un-encapsulate out of SVM
as the disks are no longer in sync. If system went down hard, I would also not recommend this procedure

but if site wants to modify a file or update boot-archive….good procedure to use

If you want to make changes while disks are under SVM and you want to modify both sides of the metadevice
use the following procedure (either booted failsafe, cdrom, net -s)

1) Boot to failsafe   or   cdrom  or net   example is in failesafe

Rebooting with command: boot -F failsafe
Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w21000004cf960bd4,0:a  File and args: -F failsafe
SunOS Release 5.10 Version Generic_141444-09 64-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Configuring devices.
Searching for installed OS instances…
/dev/dsk/c1t0d0s0 is under md control, skipping.
/dev/dsk/c1t1d0s0 is under md control, skipping.
No installed OS instance found.

Starting shell.

*You cannot use the metastat -p command to determine the primary submirror when
the system is booted in failsafe mode. Information about which slice is the primary submirror is printed to the console during the failsafe boot process. You can alternately use this method to determine the primary submirror.

2) Mount the primary submirror in read only mode.

For example:

# mount -o ro /dev/dsk/c1t0d0s0 /a

3) Copy the md.conf from the primary submirror to the failsafe miniroot

* this is in tmp and does not effect failsafe on the OS disk

# cp /a/kernel/drv/md.conf  /kernel/drv/

4) Update the md driver

# update_drv -f md

devfsadm: mkdir failed for /dev 0x1ed: Read-only file system     (don’t worry about this message)
#

* At this point meta commands are now functional

*metastat will will show the root mirror "Needs maintenance"

5) Unmount the submirror

#  cd /
# umount /a

6) List the meta devices

Example:

# metastat -p
d0 -m d1 d2 1
d1 1 1 c1t0d0s0
d2 1 1 c1t1d0s0
d10 -m d11 d12 1
d11 1 1 c1t0d0s1
d12 1 1 c1t1d0s1

*d0 is the root mirror AKA upper level meta device

7) Sync the root mirror

# metasync d0

8) Mount the root mirror

# mount /dev/md/dsk/d0 /a

the OS is now under SVM and you can perform any action you want
if you want to fsck the metadevice,  cd /, umount /a
and run fsck /dev/md/rdsk/d0

if you have to update boot archive — remount metadevice to /a

9) Recreate the boot_archive using the force option (-f)

# bootadm update-archive -f -v -R /a
forced update of archive requested
cannot find: /a/etc/cluster/nodeid: No such file or directory
cannot find: /a/etc/mach: No such file or directory
Creating boot_archive for /a
updating /a/platform/sun4u/boot_archive
15+0 records in
15+0 records out
#

*Process complete

# cd /
# umount /a

10) Reboot to the mirrored environment

# reboot     OR init 0 to boot from OK prompt

June 24, 2011 Posted by | Solaris | 1 Comment

/packages/ufs-file-system: Last Trap: Division by Zero

{0} ok boot -sv
SC Alert: Host System has Reset
ChassisSerialNumber xxxxxxxxx
Sun Fire T200, No Keyboard
Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.30.4, 32640 MB memory available, Serial #80469064.
Ethernet address xxxxxxxxxxx, Host ID: xxxxxxxxx.
Boot device: /pci@780/pci@0/pci@9/scsi@0/disk@0  File and args: -sv
/
ERROR: /packages/ufs-file-system: Last Trap: Division by Zero
{0} ok

 

System has OS on mirrored zpool.

Error indicates that there is a problem with boot block. since we’ve ZFS filesystem and some how due to corruption it’s taking as UFS and throwing above error. to fix this issue. That is what I did.

 

1. Boot CDROM or net which has Solaris 10 version later than U6. Prefer U8 or U9.

2. zpool import  & check for rpool is available.

# zpool import 
pool: rpool 
id: 10247304097055351608
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
        rpool         ONLINE
          mirror      ONLINE
            c0t0d0s0  ONLINE
            c0t1d0s0  ONLINE
#

3. zpool import -R /a rpool. You can ignore the errors it thrown below.

#  zpool import -R /a rpool 
cannot mount ‘/a/export’: failed to create mountpoint
cannot mount ‘/a/export/home’: failed to create mountpoint
cannot mount ‘/a/rpool’: failed to create mountpoint

#

4. zfs list

# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
rpool                 55.2G  11.7G    97K  /a/rpool
rpool/ROOT            13.9G  11.7G    21K  legacy
rpool/ROOT/sol10      13.9G  11.7G  4.58G  /a
rpool/ROOT/sol10/var  9.34G   671M  9.34G  /a/var
rpool/dump            8.00G  11.7G  8.00G  –
rpool/export            51K  11.7G    23K  /a/export
rpool/export/home       28K  5.00G    28K  /a/export/home
rpool/swap            32.3G  11.7G  32.3G  –
rpool/tmp              974M  4.05G   974M  legacy

5. zfs mount rpool/ROOT/sol10   # Mount the BE on to /a

6. cd /a ; ls -ltr & see if you can all the files.
7. installboot -F zfs /a/usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t0d0s0 #This will install the boot blk from same image to sector 0.
8. bootadm update-archive -R /a      # Updates the boot-archive. Normally nor required unless it throws error on boot-archive.

 

After all above steps. system booted without any issues.

May 31, 2011 Posted by | Solaris | | 1 Comment

Solaris 10: Patch fails with install/checkinstall: test: argument expected

Example below:

/var/tmp/121012-03/SUNWcsu/install/checkinstall: test: argument expected


pkgadd: ERROR: checkinstall script did not complete successfully
Dryrun complete.
No changes were made to the system.

 

This Problem happens when your /var/sadm/pkg/<package name>/pkginfo file is corrupted or messed up. In most of the cases I’ve seen is due to PATCHLIST entry in pkginfo file has “unwanted characters” or patch names not in that format it expected.

PATCHLIST should contain <PATCH BASE NUMER><REVISION> separated by spaces.

Exmaple for above error when I looked at pkginfo file. it looked like this.

# cat /var/sadm/pkg/SUNWcsu/pkginfo |grep -i patchlist
PATCHLIST=118367-04 118371-07 118373-01 118872-04 118918-22 119042-10 119573-01 119574-02
 119578-30 119824-02 120044-01 120050-04 120062-01 120128-02 120618-01 120737-01 120816-01 
120830-05 120845-03 120988-01 121002-03 121012-02 121132-01 12641SUNW_OBSOLETES=
Issue was caused due to bad entry 12641SUNW_OBSOLETES=. I’ve seem some cases PATHCLIST will have
just some base number without any -REVISION then also we get this error. 
so correcting/removing that entry & installing patch again should resolve the issue.

May 19, 2011 Posted by | Solaris | | Leave a comment

Solaris 10 Patching issue: Patches fails with unhandled subprocess exit status ‘5’ (exit n branch)

Patch fails with below errors.

# /usr/sbin/patchadd 119254-78
Validating patches…

Loading patches installed on the system…

Done!

Loading patches requested to install.

Done!

Checking patches that you specified for installation.

Done!

Approved patches will be installed in this order:

119254-78

Checking installed patches…
Executing prepatch script…

Patch 119254-78 failed to install due to a failure produced by pkgadd.

See /var/sadm/patch/119254-78/log for details

Patchadd is terminating.

Log shows below error.

patchadd exit code : 5
application of 119254-78 failed : unhandled subprocess exit status ‘5’ (exit n branch)
finish time : 2011.05.16 20:14:13
FINISHED : application of 119254-78

 

Whenever you get this kind of errors. Please make sure you’ve following things

1. patch dir & it’s sub-dir  is owned by root:root and read and execute permission is there for others

2. make sure there are nobody & noaccess users exist in your machine. if any one of them is missing you would get this error.

3. so it’s better always install patches from /tmp or /var/tmp. If it’s patch bundle or cluster patch set. better do it from /var/tmp. that way even on reboot you wouldn’t loose unzipped version of patch set.

May 19, 2011 Posted by | Solaris | | 2 Comments

Follow

Get every new post delivered to your Inbox.