Feeds:
Posts
Comments

Archive for the ‘Open Solaris’ Category

A very good document on Solaris 8 build , Can also be used to build Solaris 10 with little change.

Download the following Solaris 8 Build Doc

Advertisements

Read Full Post »

The lucreate command is part of a suite of commands that make up the Live Upgrade feature of the Solaris Operating environment.

Example:

# lucreate -n newsystem-new -c solaris10 -m /:/dev/dsk/c0t2d0s0:ufs -m -:/dev/dsk/c0t2d0s1:swap \-m /var:/dev/dsk/c0t2d0s5:ufs -m /usr:/dev/dsk/c0t2d0s6:ufs -m /opt:/dev/dsk/c0t2d0s7:ufs \

-l /var/log/lucreate.err -o /var/log/lucreate.log

BE: Boot Environment

-n: The name of the BE to be created. BE must be unique on a given system

-c: The current BE

-m: mount point:device[,volume]:fs

-l: Error messages and other status messages are sent to error log

-o: All command output is sent to outfile

To check the status of the BEs

The lustatus command displays the status information of the boot environment (BE)

#lustatus

Boot Environment Is Active Active Can Copy

Name Complete Now On Reboot Delete Status

————————– ——– —— ——— —— ————————-

solaris10 yes yes yes no –

newsystem-new yes no no yes –

To find out root and boot slices on both the BEs

bash-3.00# cat /etc/lutab
# DO NOT EDIT THIS FILE BY HAND. This file is not a public interface.
# The format and contents of this file are subject to change.
# Any user modification to this file may result in the incorrect
# operation of Live Upgrade.
1:solaris10:C:0
1:/:/dev/dsk/c0t0d0s0:1
1:boot-device:/dev/dsk/c0t0d0s0:2
2:solaris10-new:C:0
2:/:/dev/dsk/c0t2d0s0:1
2:boot-device:/dev/dsk/c0t2d0s0:2

To list the file system slices in New BE

bash-3.00# lufslist newsystem-new

boot environment name: newsystem-new

Filesystem fstype device size Mounted on Mount Options

———————– ——– ———— ——————- ————–

/dev/dsk/c0t2d0s1 swap 315432960 – –

/dev/dsk/c0t2d0s0 ufs 5370716160 / logging

/dev/dsk/c0t2d0s6 ufs 5370716160 /usr logging

/dev/dsk/c0t2d0s5 ufs 3223265280 /var logging

/dev/dsk/c0t2d0s7 ufs 3223265280 /opt logging

To rename the new BE

bash-3.00# lurename -e newsystem-new -n solaris10-new
Renaming boot environment <newsystem-new> to <solaris10-new>

Changing the name of BE in the BE definition file.
Changing the name of BE in configuration file.
Updating compare databases on boot environment <solaris10-new>.
Changing the name of BE in Internal Configuration Files.
Propagating the boot environment name change to all BEs.
Boot environment <newsystem-new> renamed to <solaris10-new>.

bash-3.00# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
————————– ——– —— ——— —— ———-
solaris10 yes yes yes no –
solaris10-new yes no no yes –

Mounting New BE

bash-3.00# mkdir solaris10-new
bash-3.00# lumount solaris10-new /solaris10-new
/solaris10-new

bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 4.8G 372M 4.4G 8% /
/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 277M 1.0M 276M 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
/dev/dsk/c0t0d0s6 4.8G 3.5G 1.2G 75% /usr
fd 0K 0K 0K 0% /dev/fd
/dev/dsk/c0t0d0s5 2.9G 465M 2.4G 17% /var
swap 276M 0K 276M 0% /tmp
swap 276M 48K 276M 1% /var/run
/dev/dsk/c0t0d0s7 2.9G 3.6M 2.8G 1% /opt
/dev/dsk/c0t2d0s0 4.9G 376M 4.5G 8% /solaris10-new
/dev/dsk/c0t2d0s6 4.9G 3.5G 1.3G 73% /solaris10-new/usr
/dev/dsk/c0t2d0s5 3.0G 465M 2.4G 16% /solaris10-new/var
/dev/dsk/c0t2d0s7 3.0G 3.7M 2.9G 1% /solaris10-new/opt

Unmounting New BE

bash-3.00# luumount solaris10-new

Following are some of the live upgrade commands

lu: FMLI-based interface for creating and administering BEs.

luactivate: Designate a BE as the BE to boot from upon the next

reboot of the system.

lucancel: Cancel a previously scheduled operation.

lucompare: Compare the contents of two BEs.

lucurr: Display the name of the current BE.

ludelete: Delete a BE.

ludesc: Add or change BE descriptions.

lumake: Re-create a BE based on the active BE.

luupgrade: Upgrade an OS and install application software on a BE.

Such software includes flash archives, complete OS installations, OS and application packages, and OS patches

Read Full Post »

There are many times with we get .so.2 linked library error, this is because of the missing package that provides the shared library files. To find out with package provides which shared libraries.

Go to the following link, in the search field select Provides and give library file name

http://rpm.rutgers.edu/rpm2php/?searchby=provides&searchval=libiconv.so.2

The search will provide you package name to be installed.

The following example show how this works

Example:

bash-3.00# gpg –import mirror
ld.so.1: gpg: fatal: libiconv.so.2: open failed: No such file or directory
Killed

In the given example there’s a libiconv.so.2 error. To find out the dependencies of the application use

ldd : list dynamic dependencies of executable files or shared objects.

bash-3.00# ldd /usr/local/bin/gpg
libiconv.so.2 => (file not found)
libresolv.so.2 => /usr/lib/libresolv.so.2
libz.so => /usr/lib/libz.so
libreadline.so.5 => (file not found)
libcurses.so.1 => /usr/lib/libcurses.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /lib/libmp.so.2
libmd5.so.1 => /lib/libmd5.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
/platform/SUNW,Sun-Blade-100/lib/libmd5_psr.so.1

As you can see there are two dependencies missing for executable file gpg

libiconv.so.2 => (file not found)
libreadline.so.5 => (file not found)

Find out what packages provide both the libraries using link provided above

Library libiconv.so.2 is provided by libiconv package and

Library libreadline.so.5 is provided by readline5 package

Install both the package using pkg-get

bash-3.00# pkg-get install libiconv
Sorry, there are multiple versions possible
Please specify one, in the following syntax
pkg-get install libiconv-1.11
pkg-get install libiconv-1.8
pkg-get install libiconv-1.9.2

bash-3.00# pkg-get install libiconv-1.11
ERROR: information for “SMCliconv” was not found
No existing install of SMCliconv found. Installing…
trying ftp://ftp.sunfreeware.com/pub/freeware/sparc/5.10/libiconv-1.11-sol10-sparc-local.gz
–13:58:22– ftp://ftp.sunfreeware.com/pub/freeware/sparc/5.10/libiconv-1.11-sol10-sparc-local.gz
=> `/dev/fd/1′
Resolving ftp.sunfreeware.com… 66.193.208.66
Connecting to ftp.sunfreeware.com|66.193.208.66|:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD /pub/freeware/sparc/5.10 … done.
==> PASV … done. ==> RETR libiconv-1.11-sol10-sparc-local.gz … done.
Length: 1,464,363 (1.4M) (unauthoritative)

100%[==============================================================>] 1,464,363 239.47K/s ETA 00:00

13:58:28 (256.43 KB/s) – `/dev/fd/1′ saved [1464363]

Transferring <SMCliconv> package instance

Processing package instance <SMCliconv> from </var/spool/pkg>

libiconv(sparc) 1.11
Bruno Haible
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
8 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing libiconv as <SMCliconv>

## Installing part 1 of 1.
/usr/local/bin/iconv
/usr/local/doc/libiconv/ABOUT-NLS
/usr/local/doc/libiconv/AUTHORS
/usr/local/doc/libiconv/COPYING.LIB

output truncated

[ verifying class <none> ]

Installation of <SMCliconv> was successful.

bash-3.00# pkg-get install readline
Sorry, there are multiple versions possible
Please specify one, in the following syntax
pkg-get install readline-5.0
pkg-get install readline-5.1
pkg-get install readline-5.2
bash-3.00# pkg-get install readline-5.2
ERROR: information for “SMCreadl” was not found
No existing install of SMCreadl found. Installing…
trying ftp://ftp.sunfreeware.com/pub/freeware/sparc/5.10/readline-5.2-sol10-sparc-local.gz
–13:59:22– ftp://ftp.sunfreeware.com/pub/freeware/sparc/5.10/readline-5.2-sol10-sparc-local.gz
=> `/dev/fd/1′
Resolving ftp.sunfreeware.com… 66.193.208.66
Connecting to ftp.sunfreeware.com|66.193.208.66|:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD /pub/freeware/sparc/5.10 … done.
==> PASV … done. ==> RETR readline-5.2-sol10-sparc-local.gz … done.
Length: 2,281,936 (2.2M) (unauthoritative)

100%[==============================================================>] 2,281,936 248.49K/s ETA 00:00

13:59:34 (206.49 KB/s) – `/dev/fd/1′ saved [2281936]

Transferring <SMCreadl> package instance

Processing package instance <SMCreadl> from </var/spool/pkg>

readline(sparc) 5.2
Lionel Cons et al
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
6 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing readline as <SMCreadl>

## Installing part 1 of 1.
/usr/local/doc/readline/CHANGELOG
/usr/local/doc/readline/CHANGES
/usr/local/doc/readline/COPYING
/usr/local/doc/readline/INSTALL
/usr/local/doc/readline/MANIFEST
/usr/local/doc/readline/NEWS
/usr/local/doc/readline/README
/usr/local/doc/readline/USAGE
/usr/local/doc/readline/doc/Makefile
/usr/local/doc/readline/doc/Makefile.in
/usr/local/doc/readline/doc/fdl.texi
/usr/local/doc/readline/doc/history.0
/usr/local/doc/readline/doc/history.3
/usr/local/doc/readline/doc/history.dvi
/usr/local/doc/readline/doc/history.html
/usr/local/doc/readline/doc/history.info
/usr/local/doc/readline/doc/history.pdf

output truncated

[ verifying class <none> ]

Installation of <SMCreadl> was successful.

Now, you can proceed with your command

bash-3.00# gpg –import mirrors
gpg: key E12E9D2F: “Distribution Manager <dm@blastwave.org>” not changed
gpg: Total number processed: 1
gpg: unchanged: 1

There you are successful!!!!!

Read Full Post »

pkg-get tool will automatically download the appropriate version for your architecture and OS revision and install the package in Solaris OS just like apt-get and yum in Debian and Red hat systems respectively.

Download

http://sunfreeware.com/pkg-get.html

# pkg-get
pkg-get SCCS rev @(#) pkg-get 1.56.1.2@(#)
from http://www.bolthole.com/solaris/

pkg-get is used to install free software packages
pkg-get
Need one of ‘install’, ‘upgrade’, ‘available’,’compare’
  ‘-i|install’   installs a package
  ‘-u|upgrade’   upgrades already installed packages if possible
  ‘-a|available’ lists the known available packages
  ‘-c|compare’   shows installed package versions vs available
  ‘-d|download’  just download the package, not install
  ‘-D|describe’  describe available packages
  ‘-f’           dont ask any questions: force default behaviour
                 Normally used with an override admin file
                 See /var/pkg-get/admin-fullauto

  ‘-s ftp://site/dir’  temporarily override site to get from
                      (change /etc/pkg-get.conf for perm)
  ‘-U|updatecatalog’   updates download site inventory

Example:

Install apache in Solaris 10 with apt-get tool

bash-3.00# cat /etc/release
                       Solaris 10 6/06 s10s_u2wos_09a SPARC
           Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 09 June 2006
bash-3.00# uanme -a
bash: uanme: command not found
bash-3.00# uname -a
SunOS newsystem 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Blade-100

bash-3.00# pkg-get install apache2
ERROR: apache2 unrecognized
Perhaps you need to run pkg-get -U
bash-3.00# pkg-get install apache
Sorry, there are multiple versions possible
Please specify one, in the following syntax
pkg-get install apache-1.3.34
pkg-get install apache-2.0.52
pkg-get install apache-2.0.53
pkg-get install apache-2.0.54
pkg-get install apache-2.0.55
pkg-get install apache-2.0.59
pkg-get install apache-2.2.0
pkg-get install apache-2.2.4
pkg-get install apache-2.2.6
pkg-get install apache-2.2.8

(pkg-get will list all the available versions to be installed in the system)

#pkg-get install apache-2.2.8 <- to install apache-2.2.8

To remove package using pkg-get

bash-3.00# pkginfo | grep apache
application SMCap228                         apache

bash-3.00# pkg-get remove apache
WARNING:  the remove option is not very intelligent.
If there are multiple versions of a package with the same
PKG style name, it will remove the first one it can
(will continue in 5 seconds)
Starting remove operations now…

ERROR: information for “SMCapache” was not found
ERROR: information for “SMCapach2” was not found
ERROR: information for “SMChttpd” was not found
ERROR: information for “SMCapache” was not found
ERROR: information for “SMCaph2” was not found
ERROR: information for “SMCap2059” was not found
ERROR: information for “SMCapch22” was not found
ERROR: information for “SMCap224” was not found
ERROR: information for “SMCap226” was not found
Sorry, there are multiple SysV pkgs installed
This is usually not possible, if pkg-get is used.
You will have to resolve this by hand, [with pkgrm]
or try being more specific about the version of software

The following related SysV packages have been detected
SMCapache SMCapach2 SMChttpd SMCapache SMCaph2 SMCap2059 SMCapch22 SMCap224 SMCap226 SMCap228 SMCap228

bash-3.00# pkgrm SMCap228

The following package is currently installed:
   SMCap228  apache
             (sparc) 2.2.8

Do you want to remove this package? [y,n,?,q]

apg-get will give you detail information if it could not remove the package.

Read Full Post »

In Soloaris 10 routeadm command and the ifconfig command can be used instead of the ndd command to set IP forwarding. The main advantages are

  • The settings are persistent across reboots.
  • The new ifconfig  router and – router commands can be placed in the /etc/hostname.interfaces files, along with other ifconfig commands that are run when the interface is initially configured.

To enable

# routeadm -e ipv4-forwarding
# routeadm -e ipv6-forwarding

To disable

# routeadm -d ipv4-forwarding
# routeadm -d ipv6-forwarding

In the previous Solaris releases

To enable

# ndd -set /dev/ip ip_forwarding 1
# ndd -set /dev/ip ip6_forwarding 1

To disable

# ndd -set /dev/ip ip_forwarding 0
# ndd -set /dev/ip ip6_forwarding 0

If you want to enable IP forwarding on a specific IPv4 interface or IPv6 interface.

# ifconfig bge0 router
# ifconfig bge0 inet6 router

To disable

# ifconfig bge0 -router
# ifconfig bge0 inet6 -router

To precede any routeadm settings to take effect on the running system, use the following command:

# routeadm -u

Read Full Post »

prtconf to Display Product Names

#prtconf -b

name:  SUNW,Sun-Fire-V440
model:  SUNW,501-6910
banner-name:  Sun Fire V440

bash-3.00# prtconf -vb
name:  SUNW,Sun-Fire-V440
model:  SUNW,501-6910
banner-name:  Sun Fire V440
idprom:  xxxxxxxx.xxxxxxxxx.00000000.xxxxxxxx.xxxxxxxx.00000000.00000000.000xxxxx
openprom model:  SUNW,4.17.1
openprom version: ‘OBP 4.17.1 2005/04/11 14:23’

psrinfo -p to Display  the total number of physical processors on a system

# psrinfo -p
2

psrinfo -vp to Display information about each physical processor on a system and the virtual processor associated with each physical processor.

# psrinfo -pv
The physical processor has 1 virtual processor (0)
  UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x24 clock 1062 MHz)
The physical processor has 1 virtual processor (1)
  UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x24 clock 1062 MHz)

isainfo to Determine whether a System Has 32-bit or 64-Bit Solaris Capabilities Enabled

bash-3.00# isainfo -v
64-bit sparcv9 applications
        vis2 vis
32-bit sparc applications
        vis2 vis v8plus div32 mul32

Use isalist command for x86 based System

Display Solaris Release Information

bash-3.00# cat /etc/release
                         Solaris 10 3/05 s10_74L2a SPARC
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 22 January 2005

showrev comman to Display general system information

bash-3.00# showrev
Hostname: server1
Hostid: xxxxxxxx
Release: 5.10
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.10 Generic_118833-36

-p options :Prints only the revision information about patches.

bash-3.00# showrev -p
Patch: 121296-01 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWcsu
Patch: 119574-02 Obsoletes: 119267-01 Requires:  Incompatibles:  Packages: SUNWcsu
Patch: 118918-18 Obsoletes: 116781-02, 121473-01, 121476-01, 121478-01, 121282-02, 121284-02, 121292-01, 121786-01, 119012-03 Requires:  Incompatibles:  Packages: SUNWcsu, SUNWcsr, SUNWcsl, SUNWcnetr, SUNWckr, SUNWcar, SUNWcakr, SUNWmdb, SUNWmdbr, SUNWcslr, SUNWhea
Patch: 121453-02 Obsoletes: 120776-03, 121086-02, 119107-07 Requires: 119574-02, 119254-06 Incompatibles:  Packages: SUNWcsu, SUNWcsr, SUNWppror, SUNWpprou, SUNWppro-plugin-sunos-base
Patch: 118371-07 Obsoletes: 119265-02 Requires:  Incompatibles:  Packages: SUNWcsu, SUNWcsl, SUNWtoo
Patch: 119578-29 Obsoletes: 119330-01, 119331-01, 119559-01, 119576-01, 120635-02, 122396-01 Requires:  Incompatibles:  Packages: SUNWcsu, SUNWcsl, SUNWckr, SUNWfmd, FJSVfmd, SUNWhea, SUNWarc
Patch: 118822-30 Obsoletes: 118548-01, 118550-04, 119719-01, 119205-03, 119207-02, 119564-01, 119215-02, 119334-02, 119566-01, 119831-01, 119682-02, 118859-01

truncated……

Read Full Post »

  • Become superuser or assume an equivalent role.

Determine whether the bad superblock is in the root (/), /usr, or /var file system and select one of
the following:

If the bad superblock is in either the root (/), /usr, or /var file system,

then boot from the network or a locally connected CD.

From a locally-connected CD, use the following command:
ok boot cdrom -s

From the network where a boot or install server is already setup, use the following command:
ok boot net -s

If the bad superblock is not in either the root (/), /usr, /var file system, change to a directory
outside the damaged file system and unmount the file system.

# umount /mount-point

Caution – Be sure to use the newfs -N in the next step. If you omit the -N option, you will destroy
all of the data in the file system and replace it with an empty file system.

  • Display the superblock values by using the newfs -N command.

# newfs -N /dev/rdsk/device-name

  • Provide an alternate superblock by using the fsck command.

# fsck-F ufs -o b=block-number /dev/rdsk/device-name

The fsck command uses the alternate superblock you specify to restore the primary superblock. You
can always try 32 as an alternate block. Or, use any of the alternate blocks shown by the newfs -N
command.

 

Restoring a Bad Superblock (Solaris 8, 9, and 10 Releases)
The following example shows how to restore the superblock copy 5264.

# newfs -N /dev/rdsk/c0t3d0s7
/dev/rdsk/c0t3d0s7: 163944 sectors in 506 cylinders of 9 tracks, 36 sectors
83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
super-block backups (for fsck -b #) at:
32, 5264, 10496, 15728, 20960, 26192, 31424, 36656, 41888,
47120, 52352, 57584, 62816, 68048, 73280, 78512, 82976, 88208,
93440, 98672, 103904, 109136, 114368, 119600, 124832, 130064, 135296,
140528, 145760, 150992, 156224, 161456,
# fsck-F ufs -o b=5264 /dev/rdsk/c0t3d0s7
Alternate superblock location: 5264.
** /dev/rdsk/c0t3d0s7
** Last Mounted on
** Phase 1- Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3 – Check Connectivity
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cyl groups
36 files, 867 used, 75712 free (16 frags, 9462 blocks, 0.0% fragmentation)
***** FILE SYSTEM WAS MODIFIED *****
#

Read Full Post »

Older Posts »