Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Saturday, 1 March 2014

AIX 6.1


The purpose is to create a Standard Operating Environment which can be installed through NIM, and offers all functionality as configured on 5.3:
  • All default configuration and setup
    • For example DNS, NTP, filesystems, additional software, etc.
  • Tuning
    • For example limitations, unnecessary software and services, etc.
  • User Environment
    • Profile and homedir configuration
  • Security
    • AIX security
    • LDAP authentication on eDirectory
    • Sudo
    • Syslog
Although the paragraphs will refer to more necessary when necessary the overall document on which this article is based is AIX Post Install. That document was created on AIX 5.3 and gives a lot of background information. This document adds specific information for AIX 6.1, but does not copy the background information which is also valid for AIX 5.3. So, in conclusion, if you need more information the AIX Post Install is your best place to start.

Installation

The installation is performed through NIM and the version installed is:
6100-04-03-1009
which was released in February 2010. During the install I accepted all default settings.

Default Configuration

Change Root

  • Change root's password by issuing the command 'passwd' on the commandline after login.
  • Change root's account through smitty by issuing the command 'smitty users' on the commandline:
    • Change / Show Characteristics of a User
      • Select the root user
        • Set root's home directory to /home/root
Note:
  • You'll have to create the /home/root directory and set permissions.
  • Because Root's home is initially set to / you might want to copy root's files to it's new home directory.

DNS

Setup DNS by editing the 'resolv.conf' configuration file:
# vi /etc/resolv.conf
nameserver      10.10.10.100
nameserver      10.10.10.101
search  intranet.company.nl company.local
Note:
  • The search entry can have up to a maximum of 1024 characater strings for the DomainName variable.
  • The first DomainName variable is interpreted as the default domain name.
  • The DomainName variable is the name of a domain that should be included in the search list.
  • The domain entry and search entry are mutually exclusive. If both entries are used, the one that appears last will override the other.

NTP

Timezone

Setup the timezone through 'smitty':
  • System Environments
    • Change / Show Date, Time, and Time Zone
      • Change Time Zone Using System Defined Values
      • Select your country (NL - Netherlands)
      • Select your time zone name (Europe/Amsterdam - (GMT+01:00/GMT+02:00) Central Europe)
      • Confirm

NTP Config

Setup NTP by editing the 'ntp.conf' configuration file:
# vi /etc/ntp.conf
#broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
server ntp.company.nl

Set the Time

# ntpdate ntp.company.nl
 3 Mar 10:02:29 ntpdate[250036]: step time server 10.10.10.100 offset 0.975368 sec
# ntpdate ntp.company.nl
 3 Mar 10:02:39 ntpdate[250040]: adjust time server 10.10.10.100 offset 0.000045 sec

NTP Service

Configure the NTP service to start automatically through 'smitty xntpd':
  • Start Using the xntpd Subsystem
    • BOTH

Reboot

To completely setup time and related services correctly reboot since the timezone change requires one.

NFS

Add the company NFS share through 'smitty manfs'
  • Network File System (NFS)
    • Network File System (NFS)
      • Add a File System for Mounting
      • Pathname of mount point [/exports/install]
      • Pathname of remote directory [/exports/install]
      • Host where remote directory resides [fileserver.company.nl]
      • Mount now, add entry to /etc/filesystems or both? [both]
      • /etc/filesystems entry will mount the directory on system restart. [yes]
      • Mode for this NFS file system [read-only]
      • Transport protocol to use [udp]
      • Allow execution of setuid and setgid programs in this file system? [no]
      • Allow device access via this mount? [no]

Check

There is a new filesystem defined in /etc/filesystems:
/exports/install:
        dev             = "/exports/install"
        vfs             = nfs
        nodename        = fileserver.company.nl
        mount           = true
        options         = ro,bg,hard,intr,proto=udp,nodev,nosuid,sec=sys
        account         = false
This filesystem is already mounted:
# mount
  node       mounted        mounted over    vfs       date        options
-------- ---------------  ---------------  ------ ------------ ---------------
         /dev/hd4         /                jfs2   Mar 03 10:13 rw,log=/dev/hd8
         /dev/hd2         /usr             jfs2   Mar 03 10:13 rw,log=/dev/hd8
         /dev/hd9var      /var             jfs2   Mar 03 10:13 rw,log=/dev/hd8
         /dev/hd3         /tmp             jfs2   Mar 03 10:13 rw,log=/dev/hd8
         /dev/hd1         /home            jfs2   Mar 03 10:14 rw,log=/dev/hd8
         /dev/hd11admin   /admin           jfs2   Mar 03 10:14 rw,log=/dev/hd8
         /proc            /proc            procfs Mar 03 10:14 rw
         /dev/hd10opt     /opt             jfs2   Mar 03 10:14 rw,log=/dev/hd8
         /dev/livedump    /var/adm/ras/livedump jfs2   Mar 03 10:14 rw,log=/dev/hd8
fileserver.company.nl /exports/install /exports/install nfs3   Mar 03 10:32 ro,bg,hard,intr,proto=udp,nodev,nosuid,sec=sys

Filesystems

When AIX gets installed the filesystem gets a certain amount of space dependent on the size of the disk and what is installed:
# df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         320.00    154.38   52%    12990    25% /
/dev/hd2        2144.00    355.22   84%    39261    31% /usr
/dev/hd9var      192.00     17.66   91%     6439    57% /var
/dev/hd3          64.00     61.55    4%       24     1% /tmp
/dev/hd1          32.00     31.62    2%       11     1% /home
/dev/hd11admin    128.00    127.63    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt      96.00     12.57   87%     1886    37% /opt
/dev/livedump    256.00    255.64    1%        4     1% /var/adm/ras/livedump
Change the size of the filesystems using the 'chfs' command:
# chfs -a size=2G /
# chfs -a size=4G /usr
# chfs -a size=1G /var
# chfs -a size=1G /tmp
# chfs -a size=512M /home
# chfs -a size=10G /opt
Result:
# df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4        2048.00   1882.11    9%    12990     3% /
/dev/hd2        4096.00   2306.92   44%    39261     7% /usr
/dev/hd9var     1024.00    849.48   18%     6441     4% /var
/dev/hd3        1024.00   1021.37    1%       24     1% /tmp
/dev/hd1         512.00    511.55    1%       11     1% /home
/dev/hd11admin    128.00    127.63    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt   10240.00  10155.02    1%     1886     1% /opt
/dev/livedump    256.00    255.64    1%        4     1% /var/adm/ras/livedump

Additional Software

Download the latest rpms:
IBM AIX Toolbox for Linux Applications Information page
Actual FTP download site
Get SSH and SSL from the AIX installation and expansion DVDs.

Install AIX Software

Install AIX software with 'smitty install_latest':
  • enter dir with software
......
Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
rpm.rte                     3.0.5.51        USR         APPLY       SUCCESS
rpm.rte                     3.0.5.51        ROOT        APPLY       SUCCESS
openssl.base                0.9.8.1100      USR         APPLY       SUCCESS
openssl.base                0.9.8.1100      ROOT        APPLY       SUCCESS
openssh.base.client         5.2.0.5300      USR         APPLY       SUCCESS
openssh.base.server         5.2.0.5300      USR         APPLY       SUCCESS
openssh.base.client         5.2.0.5300      ROOT        APPLY       SUCCESS
openssh.base.server         5.2.0.5300      ROOT        APPLY       SUCCESS

Install RPMS

This is a selection of RPMS I like to install on an AIX system:
# rpm -iv *.rpm
bash-3.2-1
gcc-4.2.0-3
gettext-0.10.40-8
less-382-1
lsof-4.61-3
sudo-1.6.9p15-2noldap
tar-1.14-2
vim-common-6.3-1
vim-enhanced-6.3-1
vim-minimal-6.3-1
which-2.14-1

SSH and SSL Config

SSH must be configured so X11 forwarding works as well. In a later configuration stage root will be forbidden to logon remotely, but for now that is still allowed. Configuration includes two files: /etc/ssh/sshd_config and /etc/ssh/ssh_config:
bash-3.2# cat /etc/ssh/sshd_config | grep '^[A-z]'
Protocol 2
PermitRootLogin yes
IgnoreRhosts yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
TCPKeepAlive yes
XauthLocation /usr/bin/X11/xauth
Banner /etc/secure_banner
Subsystem       sftp    /usr/libexec/sftp-server
bash-3.2# cat /etc/ssh/ssh_config | grep '^[A-z]'
ForwardX11 yes
ConnectTimeout 30
Protocol 2
Restart the ssh daemon:
# /etc/rc.d/rc2.d/Ssshd stop
# /etc/rc.d/rc2.d/Ssshd start
After restarting your session you can issue 'xclock' to see if it's working.
See CygWin - X op Windows to see how to setup your local Windows installation for X11 forwarding.
Note: Don't forget to create and place you secure_banner in /etc.

Oracle Requirements

Oracle has a few requirements when installed on an AIX box, and one of them is not installed by default: bos.adt.libm. The package can be installed using the NIM server:
bash-3.2# lslpp -l bos.adt.libm                                                                                        
lslpp: Fileset bos.adt.libm not installed. 

bash-3.2# nimclient -l -L ms-soe6
......
lpp_6100_04_03      lpp_source
......
bash-3.2# nimclient -o allocate -a lpp_source=lpp_6100_04_03
bash-3.2# nimclient -l -c resources ms-soe6
lpp_6100_04_03     lpp_source
bash-3.2# nimclient -o cust -a lpp_source=lpp_6100_04_03 -a filesets=bos.adt.libm
......

bash-3.2# lslpp -l bos.adt.libm
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.adt.libm               6.1.4.0  APPLIED    Base Application Development
                                                 Math Library
See AIX NIM for more information on how to install software using a NIM server.

Tuning

AIX Limitations

For system stability reasons AIX has a few limitations which interfere (within our company) with production processes.

SWAP

By default, the swap space is defined as 512 MB which is a little bit low when oracle, websphere or any other demanding application is running.
Set the paging space to 4 GB for better performance:
bash-3.2# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active Auto  Type Chksum
hd6             hdisk0            rootvg         512MB     2   yes   yes    lv     0
bash-3.2# chps -s 112 hd6
bash-3.2# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active Auto  Type Chksum
hd6             hdisk0            rootvg        4096MB     1   yes   yes    lv     0

Large Files

By default no one on the system is allowed to work with large files to prevent the filesystems from becoming full too fast, but we need root to work with large files. To do so, adjust the /etc/security/limits and these lines in the root section:
root:
        fsize = -1
        data = -1
        stack = -1

Network

By default, AIX waits 200 ms before sending the TCP acknowledgement. To disable this setting issue:
bash-3.2# no -p -o tcp_nodelayack=1
Setting tcp_nodelayack to 1
Setting tcp_nodelayack to 1 in nextboot file
In AIX Post Install are extended tests regarding AIX performance and more background information.

Memory

When running Oracle the memory is better adjusted to meet the demands Oracle can make:
bash-3.2# vmo -p -o minperm%=5 -o maxperm%=90 -o maxclient%=90 -o lru_file_repage=0
Setting minperm% to 5 in nextboot file
Modification to restricted tunable maxperm%, confirmation required yes/no yes
Setting maxperm% to 90 in nextboot file
Modification to restricted tunable maxclient%, confirmation required yes/no yes
Setting maxclient% to 90 in nextboot file
Modification to restricted tunable lru_file_repage, confirmation required yes/no yes
Setting lru_file_repage to 0 in nextboot file
Setting minperm% to 5
Setting maxperm% to 90
Warning: a restricted tunable has been modified
Setting maxclient% to 90
Warning: a restricted tunable has been modified
Setting lru_file_repage to 0
Warning: a restricted tunable has been modified
The default settings are:
vmo -p -o minperm%=20 -o maxperm%=80 -o maxclient%=80 -o lru_file_repage=1

Unnecessary Software

Software that is unnecessary:
  • Alternate Disk Installation:
    • bos.alt_disk_install.boot_images
    • bos.alt_disk_install.rte
  • Cluster Systems Management:
    • csm.client
    • csm.core
    • csm.deploy
    • csm.diagnostics
    • csm.dsh
    • csm.gui.dcem
To remove these packages issue:
installp -u bos.alt_disk_install.boot_images bos.alt_disk_install.rte csm.client csm.core csm.deploy csm.diagnostics csm.dsh csm.gui.dcem

According to KPMG security

  • AIX Security Hardening:
    • bos.aixpert.cmds
    • bos.aixpert.websm
  • Reliable Scalable Cluster Technology (RSCT)
    • rsct.core.gui
    • rsct.core.lprm
    • rsct.core.sensorrm
installp -u bos.aixpert.cmds bos.aixpert.websm rsct.core.gui rsct.core.lprm rsct.core.sensorrm

Unnecessary Services

For more information about the services see the AIX Services Documentation.

Unnecessary Inetd Subservers

Use these commands to turn all subservers off:
chsubserver -d -v ftp -p tcp
chsubserver -d -v telnet -p tcp
chsubserver -d -v shell -p tcp
chsubserver -d -v kshell -p tcp
chsubserver -d -v login -p tcp
chsubserver -d -v klogin -p tcp
chsubserver -d -v exec -p tcp
chsubserver -d -v comsat -p udp
chsubserver -d -v uucp -p tcp
chsubserver -d -v bootps -p udp
chsubserver -d -v finger -p tcp
chsubserver -d -v systat -p tcp
chsubserver -d -v netstat -p tcp
chsubserver -d -v tftp -p udp
chsubserver -d -v talk -p udp
chsubserver -d -v ntalk -p udp
chsubserver -d -v rquotad -p udp
chsubserver -d -v rexd -p tcp
chsubserver -d -v rstatd -p udp
chsubserver -d -v rusersd -p udp
chsubserver -d -v rwalld -p udp
chsubserver -d -v sprayd -p udp
chsubserver -d -v pcnfsd -p udp
chsubserver -d -v echo -p tcp
chsubserver -d -v echo -p udp
chsubserver -d -v discard -p tcp
chsubserver -d -v discard -p udp
chsubserver -d -v chargen -p tcp
chsubserver -d -v chargen -p udp
chsubserver -d -v daytime -p tcp
chsubserver -d -v daytime -p udp
chsubserver -d -v time -p tcp
chsubserver -d -v time -p udp
chsubserver -d -v instsrv -p tcp
chsubserver -d -v xmquery -p udp
chsubserver -d -v imap2 -p tcp
chsubserver -d -v pop3 -p tcp
chsubserver -d -v wsmserver -p tcp 
After disabling all subservers don't forget to refresh the inetd daemon:
refresh -s inetd

Unnecessary Subsystems

Use these commands to stop and disable subsystems that are automatically started by AIX but are not needed:
chrctcp -S -d inetd
chrctcp -S -d snmpd
chrctcp -S -d hostmibd
chrctcp -S -d snmpmibd
chrctcp -S -d aixmibd
chrctcp -S -d writesrv
chrctcp -S -d qdaemon
  • inetd: nternet daemon
  • snmpd: simple network management protocol
  • snmpmibd: extends snmp possibilities
  • hostmibd: extends snmp possibilities
  • aixmibd: extends snmp possibilities
  • writesrv: enables the ability to receive massages from users from a remote system
  • qdaemon: printer queue daemon

Remove Services from Inittab

Inittab starts a few more services which can be removed from inittab using these commands:
rmitab piobe
rmitab writesrv
rmitab qdaemon
rmitab naudio
rmitab naudio2
rmitab xmdaily
rmitab pconsole
  • piobe: spooler backend
  • naudio(2): configures pci audio devices
  • xmdaily: collects data regarding performance information
  • pconsole: system director console (web administration tool)

SLP DA

Since the introduction of AIX 6.1 TL 3 an extra service can be disabled. More information can be found in this pdf (page 16).

To disable this Systems Director Common Agent (which is like a SLP DA) follow these steps:
  • Comment out these line in /etc/inittab:
#platform_agent:2:once:/usr/bin/startsrc -s platform_agent >/dev/null 2>&1
#cimservices:2:once:/usr/bin/startsrc -s cimsys >/dev/null 2>&1
  • Also run these commands:
sudo /opt/ibm/director/agent/runtime/agent/bin/endpoint.sh stop
The LWI Nonstop Profile was not running.
sudo /opt/ibm/director/agent/runtime/nonstop/bin/installnonstop.sh -uninstallservice

User Environment

Profile

I used AIX Profile to setup the profile for all users.

Home Directory

I used AIX Home Directory to setup the automatic creation of home directories for users.

Security

AIX Security

Intruder Lockout

To prevent brute force account hacking enable intruder lockout. This can be done by editing '/etc/security/login.cfg': 
default:
        sak_enabled = false
        logintimes =
        logindisable = 4
        logininterval = 60
        loginreenable = 30
        logindelay = 5
For more information about these settings please check this page.

Valid Shells

Add bash to the list of valid shells, which can be done in the same file, '/etc/security/login.cfg':
usw:
         shells = /bin/sh,/bin/bsh,/bin/csh,/bin/ksh,/bin/tsh,/bin/ksh93,/usr/bin/sh,/usr/bin/bsh,/usr/bin/csh,/u
sr/bin/ksh,/usr/bin/tsh,/usr/bin/ksh93,/usr/bin/rksh,/usr/bin/rksh93,/usr/sbin/sliplogin,/usr/sbin/uucp/uucico,/usr/sbin
/snappd,/bin/bash,/usr/bin/bash
         maxlogins = 32767
         logintimeout = 60
         maxroles = 8
         auth_type = STD_AUTH

Default User Settings

Set the default options for new created users to a higher level of security, 'vi /etc/security/user':
default:
        admin = false
        login = false
        su = false
        daemon = true
        rlogin = true
        sugroups =
        admgroups =
        ttys = ALL
        auth1 = SYSTEM
        auth2 = NONE
        tpath = nosak
        umask = 022
        expires = 0
        SYSTEM = "compat"
        logintimes =
        pwdwarntime = 7
        account_locked = false
        loginretries = 3
        histexpire = 26
        histsize = 4
        minage = 1
        maxage = 13
        maxexpired = -1
        minalpha = 5
        minother = 3
        minlen = 8
        mindiff = 1
        maxrepeats = 2
        dictionlist =
        pwdchecks =

Root Login

Set, in the same file, that root is allowed to login, 'vi /etc/security/user':
root
       login = true

Automatic Timeout

Set an automatic timeout for sessions of one hour, 'vi /etc/profile': 
.......
# Automatic logout, include in export line if uncommented
TMOUT=3600
......
export LOGNAME MAIL MAILMSG TERM TMOUT
......

Sendmail Privacy

Edit the /etc/sendmail.cf file to minimize the information sendmail shows on connection:
# privacy flags
O PrivacyOptions=goaway
See Sendmail Security Quick Fixes for more information about sendmail security.
Don't forget to restart sendmail afterwards.

LDAP

LDAP authentication has been setup as described in AIX LDAP authentication on eDirectory.

Sudo

Sudo security has been setup as described in Sudo.

Root

You now have to make the final changes to the root account. Since you now have sudo rights for LDAP users root should no longer be allowed to login, except in emergencies. So, make sure users are allowed to 'su' to root and that root is only allowed a local login. You can change that in 'smitty users':
  • Change / Show Characteristics of a User
    • Select root
    • Another user can SU TO USER?
      • Set from “false” to “true”.
    • User can LOGIN REMOTELY(rsh,tn,rlogin)?
      • Set from “true” to “false”.
Also, don't forget to change the '/etc/ssh/sshd_config' to make sure root is not allowed to log in over ssh as well:
PermitRootLogin no

Syslog

Syslog has been setup as described in SYSLOG.

AIX VIOS


This article shows you how to install a VIOS server on a blade and what post-installation steps should or could be taken.

Installation

This installation is done by CDROM on a blade. After starting up you'll see the first screen:
aixvios01.jpg
Press F1 and continue to the next screen:
aixvios02.jpg
Press 1 to have English during install and continue to the next screen:
aixvios03.jpg
Press 2 to see the installation options:
aixvios04.jpg
If you press now you'll start the installation right away:
aixvios05.jpg 

Post-Installation

You have to login using the account padmin. After login you'll have to change the password immediately. After that you'll have to do a couple of things to get everything started:
  • Accept the license
  • Configure tcpip
  • Configure date and time

The license

You can accept the licence with this command:
license -accept

TCP/IP

You can configure tcpip with this command:
mktcpip -hostname vios -inetaddr 10.10.10.10 -interface en0 -netmask 255.255.0.0 -gateway 10.10.10.1 -nsrvaddr 10.10.10.100 -nsrvdomain company.local -start
Explanation:
  • interface
    • The network card you want to configure. You need this option in cas eyou have multiple networkcards
  • nsrv
    • name server / dns server
  • start
    • Start the network card after configuration

Date and Time

All previous steps and also this one can also be performed using the cfgassist tool. Enter this command:
cfgassist
And you'll see this screen:
aixvios06.jpg
Select “Set Date and TimeZone” and answer the questions about the timezone. Afterwards you can set the time and date:
aixvios07.jpg 

What you should know about VIOS

Login

There is no root account on a vios, the admin account is called padmin.

IVM

When the VIOS gets installed it tries to detect a HMC. If it does not detect one, IVM gets automatically installed. IVM stands for Integrated Virtualization Manager and is accessible through a web interface (port 80) on the same IP-address you configured the VIOS on. It provides most (but not all) of the functionality your HMC would normally. See, for example this page on how to create a LPAR in IVM.

Commandline

Before going on there is something you should know about the command line in VIOS. After you log in as padmin you'll work in a restricted shell. In this shell there are only a few commands you can perform, there's no way to change directories and most commands have changed names. You can become root so these restrictions do not apply anymore:
login as: padmin
padmin@10.10.10.10's password:
Last login: Wed Mar 11 08:01:15 CDT 2009 on /dev/lft0 from localhost
$
$ oem_setup_env
#
As you can see, after entering “oem_setup_env” the prompt also changes. That's an easy way to remember you're root. You can exit this mode by typing “exit”.
Small overview of commands:
AIXVIOSComment
cfgmgrcfgdevDiscover new devices

VIOS update

VIOS updates download site When updating VIOS you should always follow the directions from the specific update/fix. These can change between fixes. Here is just an overview of some basic commands:
  • ioslevel
    • Gives you the level of the current installed VIOS.
  • updateios -commit
    • Commits previous updates and should be done prior to installing new updates
  • shutdown -restart
    • Will restart the VIOS server, and is necessary after updates.

VIOS IVM ISO library

The VIOS IVM has the possibility to create an ISO library, so you can directly attach ISOs to a partition. To create one, follow these steps:
  • Go to “View/Modify Virtual Storage” and click on the “Optical Devices” tab.
  • Create a Virtual Library on a volume group that still has enough unassigned PPs left.
  • After creation, click on “Add Media” to add an ISO to the library:
aixviosiso01.jpg
Because of the speed of the physical CD/DVD player in the bladecenter this can take some time:
aixviosiso02.jpg
The entire creation took just over 2 hours, for a DVD of 3.6 GB. You can check the progress in the ”“View/Modify Virtual Storage”:
aixviosiso03.jpg
As you can see, the process is now 1.8 GB far, and it will update this value if you press the “refresh” button (circled in red).

Filesystem

The ISO library get created as a filesystem:
$ df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         192.00    174.03   10%     2055     5% /
/dev/hd2        3776.00    277.93   93%    82360    55% /usr
/dev/hd9var      576.00    496.54   14%      494     1% /var
/dev/hd3        2496.00   2489.92    1%       48     1% /tmp
/dev/fwdump     1088.00    892.10   19%        7     1% /var/adm/ras/platform
/dev/hd1       10240.00  10225.46    1%       45     1% /home
/proc                 -         -    -         -     -  /proc
/dev/hd10opt     960.00    266.77   73%    11212    16% /opt
/dev/VMLibrary_LV  10208.00   5796.47   44%        6     1% /var/vio/VMLibrary

$ lslv VMLibrary_LV
LOGICAL VOLUME:     VMLibrary_LV           VOLUME GROUP:   isovg
LV IDENTIFIER:      000153ba0000d400000001223c42fb0a.1 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            32512                  PP SIZE:        16 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                638                    PPs:            638
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    32
MOUNT POINT:        /var/vio/VMLibrary     LABEL:          /var/vio/VMLibrary
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO

VIOS And LPAR Management

List all LPARs

$ lssyscfg -r lpar -F name,state
ms-vios,Running
ms-nim,Running
ms-soe6,Running
ms-lpar02,Running
ms-lpar05,Not Activated
ms-soe,Running
ms-lpar04,Running
ms-lpar06,Running
ms-lpar07,Running
ms-lpar08,Not Activated

Shutdown LPAR

$ chsysstate -o osshutdown -r lpar -n ms-lpar04

Activate LPAR

chsysstate -o on -r lpar -n ms-lpar05

Aix Q&A.....................


1.How do I know if my volume group is normal, big, or scalable?
Run the lsvg command on the volume group and look at the value for MAX PVs. The value is 32 for normal, 128 for big and 1,024 for scalable volume group.
2.How do I create a volume group?
Use the following command, where s partition_size sets the number of megabytes (MB) in each physical partition where the partition_size is expressed in units of MB from one through 1,024. (It’s one through 131,072 for AIX 5.3.)
mkvg -y name_of_volume_group -s partition_size list_of_hard_disks
The partition_size variable must be equal to a power of two (for example: one, two, four or eight). The default value for standard and big volume groups is the lowest value to remain within the limitation of 1,016 physical partitions per physical volume. The default value for scalable volume groups is the lowest value to accommodate 2,040 physical partitions per physical volume.
3.How can I change the characteristics of a volume group?
You use the chvg command to change the characteristics of a volume group.
4.How do I create a logical volume?

#mklv -y name_of_logical_volume name_of_volume_group number_of_partition
5.How do I increase the size of a logical volume?
To increase the size of the logical volume represented by the lv05 directory by three logical partitions, for example, type extendlv lv05 3.
6.How do I display all logical volumes that are part of a volume group (e,g, rootvg)?
You can display all logical volumes that are part of rootvg by typing the following command: #lsvg -l rootvg/
7.How do I list information about  logical volumes?
Run the following command to display information about the logical volume #lv1: lslv lv1.
8.How can I clone the rootvg?
You can run the alt_disk_copy command to copy the current rootvg to an alternate disk. The following example shows how to clone the rootvg to hdisk1: alt_disk_copy -d hdisk1.]
9.How do I replace a disk?
extendvg VolumeGroupName hdisk_new
migratepv hdisk_bad hdisk_new
reducevg -d VolumeGroupName hdisk_bad
10.How do I mirror a logical volume? 
mklvcopy LogicalVolumeName Numberofcopies
syncvg VolumeGroupName
11.How can I display or set values for network parameters?
The no command sets or displays current or next boot values for network tuning parameters
12.How do I get the IP address of my machine?
Type one of the following: ifconfig -a or host Fully_Qualified_Host_Name. For example, host cyclop.austin.ibm.com.
13.How do I identify the network interfaces on my server?
Either of the following two commands will display the network interfaces: lsdev -Cc if orifconfig -a. To get information about one specific network interface, for eaxample tr0, run the command ifconfig tr0.
14.How do I activate a network interface?
To activate the network interface tr0, run the command ifconfig tr0 up.
15.How do I display routing table, interface and protocol information?
To display routing table information for an Internet interface, type netstat -r -f inet. To display interface information for an Internet interface, type netstat -i -f inet. To display statistics for each protocol, type netstat -s -f inet.
16.How will you create a file if a disk is given to you?
#mkvg –y datavg –s 128 hdisk1 (pv name)
#mklv -y datalv –t jfs2 datavg 1
#crfs –v jfs2 –d datalv –g datavg –a size=10M –m /fs1
17.Difference between JFS & JFS2?
JFS:
JFS is normal filesystem. We cannot create large files in JFS.
Files can be access dynamically.
Max file system size=1TB
Max file size=64GB
Inode size=128b
JFS2:-
Can create a large size filesystems.
Files can be access accordingly as required. (not randomly or sequentially)
Max files system size=4PB
Max file size=4PB
Inode size=512
18.How will you find the inode number?
# ls –li
# istat /etc/passwd
19.How will you find LTG size?
#lsvg vgname
#lquerypv –M hdiskname
20.How will you change LTG size?
#rmdev -l hdiskx
#chdev -l hdiskx -a max_transfer=0*80000
#mkdev -l hdiskx
21.How will you find whether a quorum is up or not?
# lsvg vg name
22.How to copy a LV from one VG to another?
# cplv -v
23.Mirroring concept?
Check disk size belong to vg , take two same size disk to mirror
# bootinfo –s hdisk2
#lsvg –p rootvg
Add one more disk of same size of already have disk having rootvg.
# extendvg rootvg hdisk2
# lsvg –p rootvg
Now mirror vg with background sync LV. It sync LVs in background with new LVs
# mirrorvg –s rootvg
Create a boot image
# bosboot –ad /dev/hdisk2
#bosboot –ad /dev/hdisk1
Add a blv
record of newly added disk, first check and then add.
# bootlist –m normal -o
#bootlist –m normal hdisk2 hdisk1
24.How will you unmirror a VG if a PV gets failed?
First check the blv record using,
# bootlist –m normal –o
Remove the old blv record, using
# chpv –c hdisk2
# bootlist –m normal hdisk1
# bootlist –m normal hdisk2
Now unmirrorvg
# unmirrorvg rootvg hdisk2
# reducevg rootvg hdisk2
#lsvg –p rootvg
# lspv
# bootlist –m normal –o
 25.How will you change a PP size?
PP size can be changed using a T-factor. If not then add a partitions in VG by adding one disk.
# chvg –t3 rootvg
 26.T – Factor?
T – factor means that it will change the pp size to increase the efficiency of vg
#chvg –t16 datavg
Cal-if suppose that datavg pp size is 1016 we can take t factor is 16 then it comes to 2048 and pv contains in vg is 2.
27. What is the default PP Size in AIX?
128MB
 28.How will you rename a VG?
Unmount all filesystems in VG.
# umount /test (mount point name)
#varyoffvg datavg
#exportvg datavg0
Importvg with new name
# importvg –y newvg hdisk4
 29.What is major number?
A major number refers to a type of device. A device number is a major number, and a minor number specifies a particular device of that type or sometimes the operation mode of that device type.
 30.What will you do if a disk gets failed?
diag command
31. How to enable & disable quorum?
# chvg –vy pv_name
# chvg –vn pv_name
#chvg –Qn vgname
#chvg –Qs vgname
32.What are the types of error?
1.H/W error
2. S/W error
3. Operator error
4. Unknown error.
33.What are the error levels severity?
1. permanent
2. Temporary
3. Informational
4. Unknown.
34.What is the command to see the error log?
# errpt –a
# errpt –d H [H/W]
# errpt –d S [S/W]
35.What is the command to clear the errorlog?
# errclear
36.What is the command to increase the size of error log when it is ful?
#usr/lib/errdemon –s ____ [ size ]
37.What is the command to start , stop, restart and list a demon?
# startsrc –g [ Demon name ]
# stopsrc [Demon name ]
# refrest [Demon name ]
# lssrc –al
 38.When does error demon start in boot process?
rc.boot phase 3
39.Which file that error daemon stay?
/usr/lib/errdemon
40.Two states of device availability and explain them?
Available state and defined state. When device is in defined state it means it cannot use. Not in ready state. Run cfgmgr try to make available known in the system that device. Available state means that device is ready to use
# lsdev –Cc disk
It displays which disks are available
41.How will you check whether a device is installed or not?
# lsdev –Cc disk
42.How to change a 64 bit kernel to 32 bit kernel?
1. Modify the /usr/lib/boot/unix directory and the /unix directory to be   a symbolic link to the binary for the desired kernel.
2. Run the bosboot command to write a new system boot image.
3. Reboot the system.
The path name of the 64-bit kernel is /usr/lib/boot/unix_64, and the
path name of the multiprocessor versions of the 32-bit kernel is
/usr/lib/boot/unix_mp.
# ln -sf /usr/lib/boot/unix_mp /unix
# ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
# lslv -m hd5
# bosboot -ad /dev/ipldevice
# shutdown -Fr
# bootinfo -K (should now be 32)
43.How to change a 32 bit kernel to 64 bit kernel?
To truly change the kernel to 64-bit from 32-bit, the system must be at the AIX® 5.1 or AIX 5.2levels.
# bootinfo –y
It shows a kernel is either 32-bit or 64-bit.
To truly change the kernel to 64-bit from 32-bit, the system must be at the AIX® 5.1 or AIX 5.2levels.
# bootinfo –y
It shows a kernel is either 32-bit or 64-bit.
To change to a 64-bit kernel, enter the following commands:
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# lslv -m hd5
# bosboot -ad /dev/ipldevice
# shutdown -Fr
44. How many VGs can be created in a LVM?
255 any no. of vg can create.
45.Types of VG & explain about them?
Normal vg -32 pv, 256 lv
# mkvg –y normvg –s 128 hdisk4
Big vg :- 128pv,512lv
# mkvg -B –y bigvg –s 128 hdisk9
Scalable vg: -1024pv, 4096 lv
# mkvg –S –y scalvg –s  512 hdisk1
46. How to convert a normal VG to big & scalable VG and also Big to Scalable VG?
#chvg –B vgname      /big vg
# chvg –S/-G vgname  /scale vg
47.What is VGDA, VGSA?
VGDA: Volume Group Descriptor Area. It contains the information about volume group to which the physical volume belongs to. It also contains the information about physical partitions, logical partitions and logical volumes.
VGSA: Volume Group Status Area it contains the information about physical partition from all physical volumes of the same volume group. It contains the status of VG
48.Default dump device?
hd6
49.Default secondary dump device?
/dev/sysdumpdevnull
50.How find a system dump?
#sysdumpdev -L
51.Where the file does the paging space stay?
/etc/swapspaces
52.How will check whether a fix is installed or not?
# instfix –ik  ptfname
53.What are the two states of installation?
Applied and commit state
In applied state if want to do any changes on installed software then we can do
But in commit the changes are not allowed to do. Once did installation.
committed fileset update cannot be rejected.
Output from the installp -s command, which is used to get a list of applied software fileset     updates and updates that are available to be either committed or rejected.
54.How will you reject a committed fileset?
# installp –r –g fileset name
55.How will you check whether service pack is installed or not?
# oslevel –s
56.What is the latest OS level?
#oslevel -rq
57.How will you check whether software is installed or not?
# lslpp -L |grep -i   (software_name)
58.How do you find history of a file set?
  #lslpp –h
59.How to remove a failed package installation?
#installp -C
60.How do remove the entries of the device in the odm?
#rmdev -dl
61.What are the types of ODM Database ?
Pre-defined database PdDv, PdAt
Customised database CuDv, CuAt
62.ODM Commands.
odmcreate: To customize Odm
To remove ODM: odmdrop
odmdelete: To remove object from ODM
To see info in ODM  odmget
To change the fields in object class  odmchange
To add object to ODM  odmadd
63. Types of Installation?
New and complete overwrite
Migration
Preservation
64.Where does log files resides?
AIX logs messages as specified in /etc/syslog.conf file.
65.How to unlock user account?
chuser –a account=true username
66. How to lock a user’s account?
#chuser account_lock=true username
67.How do u take backup of file systems?
#backup -f /dev/rmt0
68.How will u restore a file from already take backup using backup?
#restore -xvqf /dev/rmt0
69.How will u append a file to a previous archive take by Tar?
#tar -rvf /dev/rmt0
70.What command to take backup other vg’s?
# savevg –if /dev/rmt0 /vgname
71.What command to restore backup of non – rootvg?
# restvg  –x –d –f /dev/rmt0

Create a NIM Server from Scratch


1. INTRODUCTION

AIX 7.1 is out. SP2 is already existing. Time to evaluate AIX 7.1 for productive use. And time to create a new NIM server to serve AIX 7.1.
This article assumes that the LPAR you want to use as a NIM server is already installed with AIX 7.1 SP2. 

2. INSTALL NIM MASTER FILESETS

master# smitty install_latest
                                Install Software
Ty+--------------------------------------------------------------------------+
Pr|                           SOFTWARE to install                            |
  |                                                                          |
[T| Move cursor to desired item and press F7. Use arrow keys to scroll.      |
* |     ONE OR MORE items can be selected.                                   |
* | Press Enter AFTER making all selections.                                 |
  |                                                                          |
  | [MORE...537]                                                             |
  |    @ 7.1.0.0  Filesystem Quota Commands                                  |
  |    @ 7.1.0.0  License Management                                         |
  |    @ 7.1.0.0  Network Install Manager - Client Tools                     |
  | >  + 7.1.0.0  Network Install Manager - Master Tools                     |
  | >  + 7.1.0.0  Network Install Manager - SPOT                             | 
  |    @ 7.1.0.0  Software Trace Service Aids                                | 
  |    @ 7.1.0.0  System Backup and BOS Install Utilities                    | 
  |    @ 7.1.0.0  System Management Interface Tool (SMIT)                    | 
  | [MORE...1188]                                                            | 
[M|                                                                          | 
  | F1=Help                 F2=Refresh              F3=Cancel                | 
F1| F7=Select               F8=Image                F10=Exit                 | 
F5| Enter=Do                /=Find                  n=Find Next              | 
F9+--------------------------------------------------------------------------+ 
 

3. CREATE FILESYSTEMS

First we create the NIM volume group, the loglv, and the base filesystem for the NIM resources:
master# mkvg -f -S -s 32 -y nim_master hdisk1
master# mklv -t jfs2log -y nim_jfs2log nim_master 16 
master# logform /dev/nim_jfs2log
logform: destroy /dev/rnim_jfs2log (y)?y
master# mklv -t jfs2 -y nim_base nim_master 2
master# crfs -v jfs2 -d /dev/nim_base -m /nim -p rw -A yes -u NIM
master# mount /nim
Then we create a filesystem for installation images:
master# mklv -t jfs2 -y nim_images nim_master 200
master# crfs -v jfs2 -d /dev/nim_images -m /nim/images -p rw -A yes -u NIM
master# mount /nim/images
... a filesystems for LPP sources...
master# mklv -t jfs2 -y nim_lppsrc nim_master 200
master# crfs -v jfs2 -d /dev/nim_lppsrc -m /nim/lppsource -p rw -A yes -u NIM
master# mount /nim/lppsource
... and a filesystem for the spots:
master# mklv -t jfs2 -y nim_spot nim_master 30
master# crfs -v jfs2 -d /dev/nim_spot -m /nim/spot -p rw -A yes -u NIM
master# mount /nim/spot
Let's check what we created:
master# df
Filesystem     512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           393216      4976   99%    10019    88% /
/dev/hd2          4063232    427232   90%    42567    46% /usr
/dev/hd9var        786432    244304   69%     5720    17% /var
/dev/hd3          1572864    850168   46%      159     1% /tmp
/dev/hd1           131072    129880    1%       62     1% /home
/dev/hd11admin     262144    261384    1%        5     1% /admin
/proc                   -         -    -         -     -  /proc
/dev/hd10opt       786432    398288   50%     7253    14% /opt
/dev/livedump      524288    523552    1%        4     1% /var/adm/ras/livedump
/dev/nim_base      131072    130328    1%        8     1% /nim
/dev/nim_images  13107200  13104544    1%        4     1% /nim/images
/dev/nim_lppsrc  13107200  13104544    1%        4     1% /nim/lppsource
/dev/nim_spot     1966080   1965120    1%        4     1% /nim/spot

4. INITIALIZE NIM

Let's say our NIM server's ethernet interface for NIM tasks is en6 and is configured with the IP address 10.255.127.10 and a subnet mask of 255.255.255.0, then we can initialize the NIM server with a command like this:
master# nimconfig -a netname=net_10_255_127 -a pif_name=en6 -a netboot_kernel=64 \
                  -a cable_type=tp -a client_reg=no
0513-071 The nimesis Subsystem has been added.
0513-071 The nimd Subsystem has been added.
0513-059 The nimesis Subsystem has been started. Subsystem PID is 7340138.
After initialization there are already some base NIM resources configured:
master# lsnim
master             machines        master
boot               resources       boot
nim_script         resources       nim_script
net_10_255_127     networks        ent

5. CREATE BASIC NIM RESOURCES

Three types of basic resources have to be created:
  • an LPP source (NIM object of type lppsource)
  • a SPOT (NIM object of type spot)
  • NIM scripts (NIM objects of type script and fb_script)

5.1 CREATE LPP SOURCE FROM DVD

First we want to create an LPP source from an AIX 7.1 installation DVD. As a first step we copy the files to our target filesystem (/nim/lppsource) using bffcreate. Since we want to be able to serve more than one LPP source we decide to store the files in a subfolder lpp_aix710:
master# mkdir /nim/lppsource/lpp_aix710
master# smitty bffcreate

  |      Copy Software to Hard Disk for Future Installation
  |
  | Type or select values in entry fields.
  | Press Enter AFTER making all desired changes.
  |                                                         [Entry Fields]
  | * INPUT device / directory for software               /dev/cd0
  | * SOFTWARE package to copy                           [all]                       +
  | * DIRECTORY for storing software package             [/nim/lppsource/lpp_aix710]
  |   DIRECTORY for temporary storage during copying     [/tmp]
  |   EXTEND file systems if space needed?                yes                        +
  |   Process multiple volumes?                           yes                        +
There is no TL out yet for AIX 7.1 only Service Packs are available. In the below example we assume that we stored the filesets for SP2 under/tmp/ibmfixes/710/tl00/sp02. We now copy the filesets into the LPP source. Please note the target directory in the example below!
  master# smitty bffcreate

  |     Copy Software to Hard Disk for Future Installation
  |
  | Type or select values in entry fields.
  | Press Enter AFTER making all desired changes.
  |                                                         [Entry Fields]
  | * INPUT device / directory for software               /tmp/ibmfixes/710/tl00/sp02
  | * SOFTWARE package to copy                           [all]                       +
  | * DIRECTORY for storing software package             [/nim/lppsource/lpp_aix710/installp/ppc]
  |   DIRECTORY for temporary storage during copying     [/tmp]
  |   EXTEND file systems if space needed?                yes                        +
  |   Process multiple volumes?                           yes                        +
If there would be a TL out we had to do this step twice - once for the TL and another time for the SP.
Now we are ready to define the LPP source:
master# cd /nim/lppsource/lpp_aix710/installp/ppc
master# inutoc .
master# nim -o define -t lpp_source \
            -a server=master \
            -a location=/nim/lppsource/lpp_aix710 \
            -a comments='Full AIX 7100-00-02 source' \
          lpp_aix710
To save some space we remove superseeded filesets and language bloat:
master# smitty nim_lppmgr
 
  |      Eliminate Unnecessary Software Images in an lpp_source
  | Type or select values in entry fields.
  | Press Enter AFTER making all desired changes.
  |                                                      [Entry Fields]
  |   TARGET lpp_source                                   lpp_aix710
  |   PREVIEW only?                                       no                       +
  |   REMOVE DUPLICATE software                           yes                      +
  |   REMOVE SUPERSEDED updates                           yes                      +
  |   REMOVE LANGUAGE software                            yes                      +
  |       PRESERVE language                              [en_US]
  |   REMOVE NON-SIMAGES software                         no                       +
  |   SAVE removed files                                  no                       +
  |       DIRECTORY for storing saved files              []
  |   EXTEND filesystems if space needed?                 yes                      +
If you want to keep the language filesets set  REMOVE LANGUAGE software to no

5.2 CREATE SPOT

After we successfully created the LPP source we are ready to create a spot from the source:
master# nim -o define -t spot \
            -a server=master \
            -a source=lpp_aix710 \
            -a location=/nim/spot \
            -a comments='Spot created from lpp_aix710' \
          spot_aix710
Note that we didn't use a separate path name for our spot under  location - just/nim/spot! NIM automatically appends the objectname (spot_aix710 here) to the path. You would find the spot under /nim/spot/spot_aix710/usr

5.3 CREATE SCRIPTS

Let's say we have a first boot script called fb_aix7.sh and a postinstall script calledaix7_post.sh in place, then we have to define two more NIM resources:
Firstboot Script
master# vi fb_aix7.sh
master# chmod ug+x fb_aix7.sh
master# nim -o define -t fb_script \
            -a server=master \
            -a comments='Firstboot script for AIX 7' \
            -a location=/nim/scripts/fb_aix7.sh \
          fb_aix7
Postinstall Script
master# vi aix7_post.sh
master# chmod ug+x aix7_post.sh
master# nim -o define -t script \
            -a server=master \
            -a comments='Postinstall script for AIX 7 installations' \
            -a location=/nim/scripts/aix7_post.sh \
          script_aix7_post

6. CREATE AN INSTALLATION IMAGE

This step is only required if you intend to install your servers from an mksysb image rather than from an LPP source.
In order to define an MKSYSB resource you need an mksysb from an existing AIX7 installation. Copy it over to the NIM master. If there is no AIX7 server in your environment you have two options:
  1. Create an mksysb image from your NIM master (you should do this before you configure the server as a NIM master!)
  2. Do an LPP installation of a spare LPAR, do your site customization, and create a mksysb from this server
Once you have a mksysb image of an AIX 7.1 SP2 server in place you can define the NIM resource with a command like this:
master# nim -o define -t mksysb \
            -a server=master \
            -a comments='Mksysb AIX 7.1 TL0 SP2 - created 22.12.2010' \
            -a location=/nim/install_images/mksysb_aix710-sp02_test \
          mksysb_aix710-sp02_test

Wednesday, 26 February 2014

AIX troubleshooting : PART 1



IBM has announced "AIX5L".  It's essentialy AIX Version 5.  The 'L' stands
for "Linux Affinity".  A statement that AIX is going to support some of the
Linux API's and interfaces (for instance: the /proc filesystem)

Some changes to the filesystem limits, virtual IP's, dynamic dealocation
of swapspaces.

Using SMIT is probably very different from your normal way of doing
system administration, but could prove very useful in the long run. In
some areas, in particular TCP/IP, NFS, etc., you can also do things the
normal way, but it is unfortunately difficult to know exactly when the
normal way works. Again, always using SMIT is probably your best way
to go, even when you have to learn a new tool. 

What SMIT actually does is build up commands with all required options
to perform the functions requested and execute them. The commands
called and the output they produce are stored in the files smit.script
and smit.log in your home directory. Looking in smit.script may teach
you more about system administration.

How do I import an /etc/passwd or /etc/group file
                 from another box?

If the other box is non-AIX,  copy the password and group entries for
the non-system users into AIX's /etc/passwd and /etc/group files.
Then run /bin/pwdck -t ALL.  This will create the proper entries in
the shadow password file (/etc/security/users).  You should also run
usrck and grpck.

To duplicate the password and  group entries from another AIX box,
copy /etc/passwd, /etc/group, /etc/security/passwd, /etc/security/group,
/etc/security/user, /etc/security/limits, /etc/security/environ.  The
last three are optional unless you modified them.  If you modified
/etc/security/login.cfg, you should also copy that file.

How to fsck the root filesystem

You can run fsck either in maintenance mode or on mounted filesystems.
Try this:

  1. boot from diskette (AIX 3 only --- AIX 4 boot from CD or tape)
  2. select maintenance mode
  3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
     not hdisk0)
  4. fsck /dev/hd4

How can I unmount /usr to run fsck on it?

In order to fsck /usr, it has to be unmounted. But /usr cannot be
unmounted because /bin is symbolically linked to /usr/bin. Also
/etc/fsck is symbolically linked to /usr/sbin/fsck.

To work around this, when you boot from the boot/maintenance diskettes
and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of
"getrootfs hdisk0" where hdisk0 is the name of the boot disk. Then run
"fsck /dev/hd2".

How do I see/change parameters like number of
                processes per user?

You can use SMIT as described below or simply use lsattr/chdev.
The former will list the current setting as in:

  # lsattr -E -l sys0 -a maxuproc
  maxuproc 40 Maximum # of processes allowed per user True

and you can then increase the maxuproc parameter:

  # chdev -l sys0 -a maxuproc=200
  sys0 changed

If you just type 'lsattr -E -l sys0' you will get a list of all
parameters, some of which can be changed but not others.

If you want to use smit, do as follows:

smit
  System Environments and Processes
    Change / Show Operating System Parameters
      - on this screen you can change by overtyping the following fields:
        - Maximum number of PROCESSES allowed per user
        - Maximum number of pages in block I/O BUFFER CACHE
        - Maximum Kbytes of real memory allowed for MBUFS
      - toggle fields exist for:
        - Automatically REBOOT system after a crash  (false/true)
        - Continuously maintain DISK I/O history (true/false)


How do I shrink the default paging space on hd6?

create a paging space to use temporarily
   mkps -s 20 -a rootvg
change default paging space hd6 so it is not used at next reboot
   chps -a n hd6
swapon /dev/paging00

sysdumpdev -p /dev/paging00

Update information in boot logical volume

   bosboot -ad /dev/hdisk0 

reboot
remove current hd6 and create a new one of smaller size
   rmps hd6
   mklv -y hd6 -t paging rootvg 

swapon /dev/hd6

change the dump device back to hd6:

   sysdumpdev -p /dev/hd6

Update information in boot logical volume

   bosboot -ad hdisk0

change current paging device (paging00) so it is inactive at next boot
   chps -a n /dev/paging00

shutdown, reboot, remove paging00 using the command:
    rmps paging00

You can check your paging space with `lsps -a`

The swapper seems to use enormous amounts of paging space, why?

When you run ps, you may see a line like:

USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
root     0 0.0%  14% 386528  8688      -    S 17:06 swapper

This is normal behavior, the swapper looks to ps like it has the entire
paging space plus real memory allocated.

How do I remove a committed lpp?

installp has a new option, uninstall (-u) which can be used to remove lpps.  BEWARE of pre-requisite chains.

How can I recover space after installing updates?

Note: If you are a /usr server, do not use this because the files
      mentioned below are needed by /usr clients and cannot be deleted.

Installp creates numerous files in /usr to clean up after failed/rejected installs and also for de-installing uncommitted lpps. Once you have COMMITted packages you can remove these files safely. Depending on your installation activity the numbers can be significant: hundreds-to-thousands of files, megabytes of data.

Files eligible for removal are associated with each "product" you have installed; the largest collection being due to bos. After COMMITting bos lpps, you may safely remove all files of the form:

/usr/lpp/bos/deinstl*
              /usr/lpp/bos/inst_U4*
              /usr/lpp/bosadt/deinstl*
        and   /usr/lpp/bosadt/inst_U4*

You may repeat this for all additional COMMITted products (e.g.,bostext1, bosnet, xlc) you have on your system.
This problem of lingering install files is a known defect in installp. If you have installed PTF U411711 (or any superseder of it: U412397, U413366, U413425) the deadwood in /usr will not be quite as prevalent. No single PTF currently available completely corrects this problem.

On my own 320, the following freed up 12.4M in /usr:

       # rm -R /usr/lpp/bos/deinstl*
       # rm -R /usr/lpp/bos/inst_U4*

Where are the AIX log files kept?

AIX logs messages as specified in /etc/syslog.conf.  Here's an
example

#
*.err;kern.debug;auth.notice;user.none          /dev/console
*.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
lpr.debug                                       /var/adm/lpd-errs

*.alert;kern.err;daemon.err;user.none           operator
*.alert;user.none                               root
*.emerg;user.none                               *

# for loghost machines, to have authentication messages (su, login, etc.)
# logged to a file, un-comment out the following line and adjust the 
# file name as appropriate.
#
# if a non-loghost machine chooses to have such messages 
# sent to the loghost machine, un-comment out the following line.
#
auth.notice                     /var/log/authlog
mail.debug                      /var/log/syslog

# following line for compatibility with old sendmails. they will send
# messages with no facility code, which will be turned into "user" messages
# by the local syslog daemon. only the "loghost" machine needs the following
# line, to cause these old sendmail log messages to be logged in the
# mail syslog file.
#
user.alert                       /var/log/syslog
#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
user.err                         /dev/console
user.err                         /var/adm/messages
user.alert                       `root, operator'
user.emerg                       *

How can I log information about ftp accesses to a file?

1) In /etc/syslog.conf, add the line:
   daemon.debug  /tmp/daemon.log

2) # touch  /tmp/daemon.log
   # refresh -s syslogd

3) Modify your inetd.conf so that ftpd is called with the "-l" flag.
   You may also want the "-d" flag. This can be done with 'smit inetdconf'.

All the syslog messages from various system daemons should now appear in
the file "/tmp/daemon.log".

How do I find a file name from the inode number?

ncheck -i nnnn /mntpoint

AIX troubleshooting : PART 2



How do I set the tty name associated with a physical port?

Let's say you wanted to make a tty on the s1 port and call it rs0000 and a tty on the s2 port and call it rs0001.

You could run:

mkdev -c tty -s rs232 -t tty -l rs0000 -p sa0 -w s1   # creates rs0000
and
mkdev -c tty -s rs232 -t tty -l rs0001 -p sa1 -w s2   # creates rs0001

How do I use mksysb to clone a system?

I use the following steps on the master machine to clone an AIX system:
1) Remove the password from root.
2) Remove the NIS line from the end of the /etc/group file (the last
   line with the +: )
3) Change most of the level '2' designations in /etc/inittab to level
   '3' to prevent them from being started up when the new system is
   booted (the minimum ones to change are rc.nfs and rc.tcpip)
4) Boot in service mode and change the name and ip address to a "spare"
   set to avoid address collision.
5) Clear /tmp, /usr/tmp and /usr/spool/lpd/stat.
6) Run mkszfile and edit it to be sure /usr is as small as possible;
   then mksysb from the command line.

The above changes allow me to boot in normal mode the first time, get in
as root, change the above files back and do the other things necessary
to configure the new system.

Then, of course, I go back and clean up and reboot my master machine.

Note: 1 and 2 lets you log in even if you can't get on the network. 
   It prevents the login process from trying to reach an NIS server. 
   Step 2 needed only if you use NIS.

How do I remove a non-existant physical volume?

To delete a phantom disk from the ODM use reducevg with the pvid instead of the disk name.  You are running some command such as lsvg or varyonvg and it is griping about a disk that is no longer findable right?  In that warning message, it should give you a pvid.  Try one of the following, (note: reducevg updates the VGDA but not the ODM).

reducevg -f  

ldeletepv -g VGid -p PVid
      -g Required, specify the VGid of the volume group you are
         removing the physical volume from
      -p Required, specify the PVid of the PV to be removed

How do I kill a process that ignores   kill -QUIT -KILL -STOP

If there is i/o pending in a device driver, and the driver does not catch the signal, you can't kill it - a reboot is the only way to clear it.

Furthermore, if the process stays hung for more than a few minutes, you can find out what device is wedged by doing this --

% echo trace -k $(expr  / 256) | crash | tee stack


How can I see "console" messages?

Use the swcons command to redirect the console to a file.  Or use chcons to do it permanently.

How do I merge my /etc/password and /etc/security/password for Crack?

/usr/sbin/mrgpwd.  You must have permissions to read /etc/security/password.

I lost the root password, what should I do?

Boot from boot diskettes, bootable tape, or bootable CD.  
At the Installation/Maint menu select item 4, "Start a limited function
 maintenance shell.
At the subsequent "#" prompt enter the command:
 getrootfs hdiskN
 (where "N" is replaced by the number of a disk on your system
 that is in rootvg.)
That will run for about a minute or so and you get a # prompt back.  At this
 point you are logged in as root in single user mode.
Change to /etc/security and edit the passwd file.  Delete the three lines
 under root: password, update time (or whatever it's called), and
 flags.  Save the file.
Then at the prompt, give root a new password.
Shutdown/reboot in normal mode.  Log in with new password.