Month: January 2010

Removing a Logical Volume in AIX

To remove a logical volume, use rmlv. The -f switch is to remove without user confirmation.

Usage: rmlv [ -B ] [ -f ]  [ -p Physical Volume ]  LogicalVolume …
Removes a logical volume.

root@aix:/ # /usr/sbin/rmlv -f rawdevice19
rmlv: Logical volume rawdevice19 is removed.

Discovering what library is necessary to run an application

I needed to install rsync in a Solaris 9 so I headed to Sunfreeware and download the package. It had the following description:

Rsync is a replacement for rcp that has many more features – installs in /usr/local. Dependencies: popt, libiconv, libintl, and having libgcc_s.so.1 in /usr/local/lib is required. This can be done by installing libgcc-3.4.6 or gcc-3.4.6 or higher, packages also. There are some new features of version 3 that may require your attention of you have used rsync in the past. See the Details link below for more information.

After you install the package, there is a big probability that it won’t work because it will need the libraries listed in the description. Let’s install and find what my system is missing.

root@solaris9:/tmp/rsync # pkgadd -d rsync-3.0.6-sol9-sparc-local

The following packages are available:
1  SMCrsync     rsync
(sparc) 3.0.6

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SMCrsync> from </tmp/rsync/rsync-3.0.6-sol9-sparc-local>

rsync
(sparc) 3.0.6
The Rsync Group
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
2 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing rsync as <SMCrsync>

## Installing part 1 of 1.
/usr/local/bin/rsync
/usr/local/doc/rsync/COPYING
/usr/local/doc/rsync/INSTALL
/usr/local/doc/rsync/NEWS
/usr/local/doc/rsync/OLDNEWS
/usr/local/doc/rsync/README
/usr/local/doc/rsync/TODO
/usr/local/doc/rsync/csprotocol.txt
/usr/local/doc/rsync/doc/README-SGML
/usr/local/doc/rsync/doc/profile.txt
/usr/local/doc/rsync/doc/rsync.sgml
/usr/local/doc/rsync/rsync3.txt
/usr/local/doc/rsync/rsyncsh.txt
/usr/local/doc/rsync/tech_report.tex
/usr/local/doc/rsync/wildtest.txt
/usr/local/share/man/man1/rsync.1
/usr/local/share/man/man5/rsyncd.conf.5
[ verifying class <none> ]

Installation of <SMCrsync> was successful.

Here I invoke ldd to see what my system is missing. It reported libiconv.so.2, so I need to download the libiconv package as said before.

root@solaris9:/tmp/rsync # ldd /usr/local/bin/rsync
libpopt.so.0 =>  /usr/lib/libpopt.so.0
libsec.so.1 =>   /usr/lib/libsec.so.1
libsocket.so.1 =>        /usr/lib/libsocket.so.1
libnsl.so.1 =>   /usr/lib/libnsl.so.1
libiconv.so.2 =>         (file not found)
libc.so.1 =>     /usr/lib/libc.so.1
libdl.so.1 =>    /usr/lib/libdl.so.1
libmp.so.2 =>    /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1

root@solaris9:/tmp/rsync # pkgadd -d libiconv-1.11-sol9-sparc-local

The following packages are available:
1  SMCliconv     libiconv
(sparc) 1.11

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SMCliconv> from </tmp/rsync/libiconv-1.11-sol9-sparc-local>

libiconv
(sparc) 1.11
Bruno Haible
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
5 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
/usr/local/doc/libiconv/ChangeLog
/usr/local/doc/libiconv/DESIGN
/usr/local/doc/libiconv/INSTALL.generic
/usr/local/doc/libiconv/NEWS
/usr/local/doc/libiconv/NOTES
/usr/local/doc/libiconv/PORTS
/usr/local/doc/libiconv/README
/usr/local/doc/libiconv/README.djgpp
/usr/local/doc/libiconv/README.os2
/usr/local/doc/libiconv/README.woe32
/usr/local/doc/libiconv/THANKS
/usr/local/include/iconv.h
/usr/local/include/libcharset.h
/usr/local/include/localcharset.h
/usr/local/lib/libcharset.a
/usr/local/lib/libcharset.la
/usr/local/lib/libcharset.so <symbolic link>
/usr/local/lib/libcharset.so.1 <symbolic link>
/usr/local/lib/libcharset.so.1.0.0
/usr/local/lib/libiconv.la
/usr/local/lib/libiconv.so <symbolic link>
/usr/local/lib/libiconv.so.2 <symbolic link>
/usr/local/lib/libiconv.so.2.4.0
/usr/local/lib/preloadable_libiconv.so
/usr/local/man/man1/iconv.1
/usr/local/man/man3/iconv.3
/usr/local/man/man3/iconv_close.3
/usr/local/man/man3/iconv_open.3
/usr/local/man/man3/iconvctl.3
/usr/local/share/doc/iconv.1.html
/usr/local/share/doc/iconv.3.html
/usr/local/share/doc/iconv_close.3.html
/usr/local/share/doc/iconv_open.3.html
/usr/local/share/doc/iconvctl.3.html
[ verifying class <none> ]

Installation of <SMCliconv> was successful.

Invoking ldd again to see if all dependencies are met. Now I need to install libgcc.

root@solaris9:/tmp/rsync # ldd /usr/local/bin/rsync
libpopt.so.0 =>  /usr/lib/libpopt.so.0
libsec.so.1 =>   /usr/lib/libsec.so.1
libsocket.so.1 =>        /usr/lib/libsocket.so.1
libnsl.so.1 =>   /usr/lib/libnsl.so.1
libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
libc.so.1 =>     /usr/lib/libc.so.1
libdl.so.1 =>    /usr/lib/libdl.so.1
libmp.so.2 =>    /usr/lib/libmp.so.2
libgcc_s.so.1 =>        (file not found)
/usr/platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1

root@solaris9:/tmp/rsync # pkgadd -d libgcc-3.4.6-sol9-sparc-local

The following packages are available:
1  SMClgcc346     libgcc
(sparc) 3.4.6

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SMClgcc346> from </tmp/rsync/libgcc-3.4.6-sol9-sparc-local>

libgcc
(sparc) 3.4.6
FSF
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing libgcc as <SMClgcc346>

## Installing part 1 of 1.
/usr/local/lib/libg2c.so <symbolic link>
/usr/local/lib/libg2c.so.0 <symbolic link>
/usr/local/lib/libg2c.so.0.0.0
/usr/local/lib/libgcc_s.so <symbolic link>
/usr/local/lib/libgcc_s.so.1
/usr/local/lib/libstdc++.so.6 <symbolic link>
/usr/local/lib/libstdc++.so.6.0.3
[ verifying class <none> ]

Installation of <SMClgcc346> was successful.

No more messages saying that some file is missing. The application is running as expected.

root@solaris9:/tmp/rsync # ldd /usr/local/bin/rsync
libpopt.so.0 =>  /usr/lib/libpopt.so.0
libsec.so.1 =>   /usr/lib/libsec.so.1
libsocket.so.1 =>        /usr/lib/libsocket.so.1
libnsl.so.1 =>   /usr/lib/libnsl.so.1
libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
libc.so.1 =>     /usr/lib/libc.so.1
libdl.so.1 =>    /usr/lib/libdl.so.1
libmp.so.2 =>    /usr/lib/libmp.so.2
libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
/usr/platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1

root@solaris9 # rsync
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, no IPv6, batchfiles, inplace,
append, ACLs, no xattrs, iconv, no symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.

How to perform a Sun SC Failover

Check if there is any data synchronization running between the System Controllers. The File Propagation State must be set as active and there must not show any file in Active File or Queued Files.

e20k-sc0:sms-svc> showdatasync
File Propagation State: ACTIVE
Active File:            –
Queued Files:           0

Each system controller must not have any status different from Good to prevent the failover. The failover must be active.

e20k-sc0:sms-svc> showfailover -v
SC Failover Status:     ACTIVE
Status of Shared Memory:
HASRAM (CSB at CS0):     …………………………………Good
HASRAM (CSB at CS1):     …………………………………Good

Status of e20k-sc0:
Role:                    …………………………………MAIN
SMS Daemons:             …………………………………Good
System Clock:            …………………………………Good
Private I2 Network:      …………………………………Good
Private HASRAM Network:  …………………………………Good
Public Network:
Group “C1”:      …………………………………..Up
eri0:              …………………………………..Up
eri3:              …………………………………..Up
Logical IP Addr. – C1:…………………………………..Up
System Memory:           ………………………………….4.9%
Disk Status:
/:                   ………………………………….3.6%
Console Bus Status:
EXB at EX0:          …………………………………Good
EXB at EX1:          …………………………………Good
EXB at EX2:          …………………………………Good
EXB at EX3:          …………………………………Good
EXB at EX4:          …………………………………Good
EXB at EX5:          …………………………………Good
EXB at EX6:          …………………………………Good
EXB at EX8:          …………………………………Good
EXB at EX9:          …………………………………Good
EXB at EX10:         …………………………………Good
EXB at EX11:         …………………………………Good
EXB at EX12:         …………………………………Good
EXB at EX13:         …………………………………Good
EXB at EX14:         …………………………………Good
EXB at EX15:         …………………………………Good
EXB at EX16:         …………………………………Good
EXB at EX17:         …………………………………Good

Status of e20k-sc1:
Role:                    ………………………………..SPARE
SMS Daemons:             …………………………………Good
System Clock:            …………………………………Good
Private I2 Network:      …………………………………Good
Private HASRAM Network:  …………………………………Good
Public Network:
Group “C1”:      …………………………………..Up
eri0:              …………………………………..Up
eri3:              …………………………………..Up
Logical IP Addr. – C1:……………………………..Inactive
System Memory:           ………………………………….4.6%
Disk Status:
/:                   ………………………………….3.5%
Console Bus Status:
EXB at EX0:          …………………………………Good
EXB at EX1:          …………………………………Good
EXB at EX2:          …………………………………Good
EXB at EX3:          …………………………………Good
EXB at EX4:          …………………………………Good
EXB at EX5:          …………………………………Good
EXB at EX6:          …………………………………Good
EXB at EX8:          …………………………………Good
EXB at EX9:          …………………………………Good
EXB at EX10:         …………………………………Good
EXB at EX11:         …………………………………Good
EXB at EX12:         …………………………………Good
EXB at EX13:         …………………………………Good
EXB at EX14:         …………………………………Good
EXB at EX15:         …………………………………Good
EXB at EX16:         …………………………………Good
EXB at EX17:         …………………………………Good

You run setfailover force to perform the failover. If there is a problem on the spare clock input, it can cause a domain stop (it is going to power off all the domains)

e20k-sc0:sms-svc> setfailover force
Forcing failover. Do you want to continue (yes/no)? yes
The spare clock input on some boards might be bad. Forcing a failover now is likely to cause the affected domains to domain stop (Dstop).
Do you want to continue (yes/no)? yes

Checking service status

e20k-sc0:sms-svc> showfailover -r
SPARE

When you manually failover, the automatic failover is disabled

e20k-sc0:sms-svc> showfailover –v | grep “SC Failover Status”
SC Failover Status:     DISABLED

You need to manually activate the automatic failover again to return to the previous status

e20k-sc0:sms-svc> setfailover on
e20k-sc0:sms-svc> showfailover -v | grep “SC Failover Status”
SC Failover Status:     ACTIVATING

e20k-sc1:sms-svc> showfailover -v | grep “SC Failover Status”
SC Failover Status:     ACTIVE