Showing posts with label AIX errors. Show all posts
Showing posts with label AIX errors. Show all posts

Thursday, June 28, 2012

Daily Management



•/etc/passwd                                                                 Contains the basics of a user
•/etc/security/.profile                                                      Providing the user profile
•/etc/security/limits                                                        Contains all the ulimits, or users' system resource limitations
•/etc/security/passwd                                                     Contains the AIX user's password information
•/etc/security/user                                                          Contains the most important settings
•/usr/lib/security/mkuser.default                                       Contains values used when creating user through mkuser

# getconf LOGIN_NAME_MAX                                        To verify the setting in AIX 5.3 and later
# lsattr -El sys0                                                             To verify the setting in AIX 5.3 and later
# chdev -l sys0 -a max_logname=129                              To change the value of sys0

# mkuser xander                                                            To create a user with default settings
# finger xander                                                               Gives the short information of user
# chuser core=1048576 xander                                       To change the User attribute
# chsh xander                                                                To change the user login shell
# chfn xander                                                                 To change GECOS information
# lsuser -f xander                                                           List the user in stanza format
# passwd xander                                                            To set or change password of user
# passwd -f xander                                                         To change user GECOS using passwd command
# passwd -s xander                                                        To change the user SHELL using passwd
# rmuser xander                                                 Remove the user
# rmuser –p xander                                                        To remove fully user information

•/etc/group                                                                    Contains the basics of a group
•/etc/security/group                                                        Contains extended attributes to the specified group

# mkgroup atctest                                                          To create a group
# mkgroup -a atcadmin                                                   To create an admin group
# mkgroup adms=xander xangroup                                  To create a group and add Xander as the administrator of the group
# chgroup id=204 users=xander,atc,amdc xangroup          Change the group's GID and add users
# chgrpmem                                                                  Another way to modify a group's members is with chgrpmem
# chgrpmem xangroup                                                    List the group information
# chgrpmem -m - atc xangroup                                        Remove a user from a group
# lsgroup xangroup                                                         List the info of group
# lsgroup -f xangroup                                                      List info of group in stanza fromat
# rmgroup atctest                                                           Remove the group

•/etc/security/environ                                                      Contains the environment attributes for users
•/etc/security/lastlog                                                      Contains the last login attributes for users
•/usr/lib/security/mkuser.sys                                           Customizes new user accounts
•/etc/security/login.cfg                                                    Contains system default login parameters
•/etc/utmp                                                                     Contains a record of users logged into the system
•/var/adm/wtmp                                                              Contains connect-time accounting records
•/etc/security/failedlogin                                      Records all failed login attempts
•/etc/motd                                                                     Contains the message to be displayed every time user login
•/etc/environment                                                           Specifies the basic environment for all processes.
•/etc/profile                                                                    Specifies additional environment settings for all users.
•$HOME/.profile                                                             Specifies environment settings for a specific user.

# ps -ef                                                                         To display all processes
# ps -f -l -ujim                                                                To list processes owned by specific users
# ps -M                                                                         To list all the 64-bit processes

# kill 1095                                                                     To stop a given process
# kill -kill 2098 1569                                                       To stop several processes that ignore the default signal
# kill -kill 0                                                                     To stop all of your processes and log yourself off
# kill -9 -1                                                                      To stop all processes that you own

# fuser -u /etc/filesystems                                               List a process numbers and user login names of processes
# fuser -k -x -u -c /dev/hd1                                              To terminate all of the processes using a given file system
# fuser -kxuc /home                                                       To terminate all of the processes using a given file system
# fuser -d /usr                                                                To list all processes that are using a file that has been deleted from a given file system
# fuser -xc /tmp                                                             List open references within a specified file system
# find /home -type d -exec fuser -u {} \;                             Process is using a directory within the file system as its                                                                                       current working directory
# topas -i5 -n0 -p10                                                        To view the top 10 processes

The svmon command captures and analyzes a snapshot of virtual memory
The svmon command creates nine types of reports          
# svmon -G                                                                    Global Report
# svmon -U                                                                    User Report
# svmon -C                                                                    Command Report
# svmon -W                                                                   Workload Management Class Report
# svmon -T                                                                    Workload Management Tier Report
# svmon -P                                                                    Process Report
# svmon -S                                                                    Segment Report
# svmon -D                                                                    Detailed Report
# svmon -F                                                                    Framed Report

# aclget status                                                               To display the access control information of status file
# aclput -i acldefs status                                     To set the access control information of status from acldefs
# aclget plans | aclput status                                          To set the access control information of status from plans
# acledit plans                                                               To edit the access control information of the plans

#chown -R john:build /tmp/src                                         To change the owner & group of all files in the directory
# chmod 644 text                                                           To use the absolute mode
#chgrp -R staff proposals                                                Change the group ownership of the directory named                                                                                              proposals of dir stuff
# at -f filename -t CCYYMMDDhhmmSS Increment           Submit a job to be run at a later time
# at now -f appl/program > /dev/null 2>&1             To start at job now
# atq                                                                             List the at jobs
# at -r root.1134169200.a                                                Remove the at job
# ls /var/spool/cron/atjobs                                               Location of at jobs

# ls -l /var/spool/cron/crontabs                                         Location of cron jobs
# crontab -l                                                                    List the all cron jobs
# crontab -e                                                                   To edit crontab file
# crontab -v username                                                    Lists the status of the user's cron jobs
# crontab -r                                                                    Remove the crontab file
# crontab ~deploy/deploy.schedule                                  Runs the crontab file under user deploy

•/var/adm/cron/log                                                          The cron daemon logs file
•/var/adm/cron/cron.deny                                                Deny cron access to user for cron schedular
•/var/adm/cron/cron.allow                                                Allow cron access to user for cron schedular
•/var/adm/cron/at.allow                                                   Allow cron access to user for at schedular
•/var/adm/cron/at.deny                                                    Deny cron access to user for at schedular

# telinit                                                                          Directs the actions of the init process
# telinit M                                                                      Goes into the maintainance mode
# telinit q                                                                       Tell the init command to reprocess the /etc/inittab

Normally, you do not need to restart srcmstr. If the srcmstr daemon terminates abnormally, the respawn action specified in the /etc/inittab restarts the srcmstr  daemon.

A command is a request to perform an operation or run a program. A program or command that is actually running on the computer is referred to as a process.

The common types of processes are:
Foreground and background processes
Processes that require a user to start them or to interact with them are called foreground processes. Processes that are run independently of a user are referred to as background processes. Programs and commands run as foreground processes by default.

Daemon processes
Daemons are processes that run unattended. They are constantly in the background and are available at all times. Daemons are usually started when the system starts, and they run until the system stops. A daemon process typically performs system services and is available at all times to more than one task or user. Daemon processes are started by the root user or root shell and can be stopped only by the root user. For example, the qdaemon process provides access to system resources such as printers. Another common daemon is the sendmail daemon.

Zombie processes
A zombie process is a dead process that is no longer executing but is still recognized in the process table (in other words, it has a PID number). It has no other system space allocated to it. Zombie processes have been killed or have exited and continue to exist in the process table until the parent process dies or the system is shut down and restarted. Zombie processes display as <defunct> when listed by the ps command.

Ctrl-C                To intrrupt the process
Ctrl-Z                To stop process

# fg 589934                                                                   To bring the process in to the foreground
# find / -type f > dir.paths &                                             Run the find command in the background
# nohup find / -type f &                                       To run the find command and leave it running after you log off in Bg

0 Represents standard input (stdin)         <
1 Represents standard output (stdout)     > or >> (append)
2 Represents standard error (stderr)         2> or 2>> (append)
                                                            2>&1                Redirects stderr to stdout.
                                                            1>&2                Redirects stdout to stderr


Performance Monitoring

# nice -10 foo                                                     Add 10 to current nice value (Lower Priority)
# nice -n 10 foo                                                  Add 10 to current nice value (Lower Priority)
# nice - -10 foo                                                   Subtract 10 from current value (Higher Priority)
# nice -n -10 foo                                                 Subtract 10 from current value (Higher Priority)

# renice -10 –p 563                                            Add 10 to default nice value (Lower Priority)
# renice –n 10 –p 563                                         Add 10 to current nice value (Lower Priority)
# renice - -10 –p 563                                          Subtract 10 from default nice value (Higher Priority)
# renice –n -10 –p 563                                        Subtract 10 from current nice value (Higher Priority)

# ps –ekl                                                           Long listing of kernel processes with priority
# ps –L 483445 –l                                              It list the child the processes of parent process
# ps –kmo THREAD –p 16396                             It list the threads of particular processes

# schedo                                                           To change the CPU usage priority decay rate

Context Switch : A context switch is when one thread is taken off a CPU and another thread is despatched onto the same CPU.

User Mode : User mode is when thread is executing its own application code or shared library code. Time spent in user mode is reflected as %user time in output of commands such as vmstat, topas, iostat, sar.

System Mode : System Mode is when the CPU is executing code in the kernel. CPU time spent in kernel mode is reflected as system time in output of vmstat, topas, iostat, sar commands. Context switch time, system calls, device interrupts, NFS I/O, and anything else in the kernel is considered as system time.

# time                                                                           It show the elapsed time in system and user mode
# vmstat 5 3

# vmstat -f                                                                     To display fork statistics
# vmstat -s                                                                    To display count of various events

# sar –P ALL 5 1                                                            All CPU related usage
# sar –q 5 3                                                                   Queue details
# ps aux                                                                        Locating the dominant processes
# tprof –x sleep 60                                                         Reports processor usages                                             

# lparstat 2 3                                                                 System wide CPU report
# sar –P ALL 2 2                                                            Viewing CPU statistic with SMT
# sar -d 1 2                                                                    Disk I/O statistic
# smtctl                                                                                    To check SMT is enabled or not
# smtctl –m on –w now                                                   Tern on SMT immediately
# smtctl –m on –w boot                                                  Tern on SMT at next reboot
# bindprocessor –q                                                         To check logical CPU

# iostat                                                                         I/O device statistics


# iostat -d hdisk2 2                                                        Continuous disk report
# netstat                                                                       network statistic
# netstat -rn                                                                   Network routing table
# netstat -rs                                                                   Network routing statistic

CPU bound A system is said to be CPU-bound if the total system (sy) and user (us) CPU usage is approaching 100 percent. This would imply that idle time and wait time for CPU are approaching zero.

Memory bound A system is memory-bound if some virtual memory is forced out to disk, meaning the system is waiting on a relatively slow disk instead of relatively fast RAM. This is indicated by a non-zero value in the page-in (pi) and page-out (po) values.

Paging rate is the average number of page-ins and page-outs per CPU cycle.

Idle time calculation:
Total CPU Idle Time % = wait % + Idle Time %
Ex:
Average CPU Idle Time percentage = ((99+1) + (97+2) + (95+4) + (99+1))/4 = 99.5%


                       


Saturday, March 31, 2012

disk attribute - reserve_policy

There were 900 disks in that server which was running on 53-09-04 . I wanted to change the disk attribute of all disks from  reserve_policy reserve  to reserve_policy no_reserve . I have written below for loop to check and there was another for loop to change it too !

for i in `lspv|grep -v root|awk '{print $1}'`
do
echo $i >>/tmp/123
lsattr -El $i|grep reserve_policy|awk '{print $2}' >>/tmp/123
done

This for loop will check all disks and apend the /tmp/123 file with result.

Thanks,
Dipak Warade,
www.unix4you.com

Thursday, March 29, 2012

What I am doing ?

Hi Guys,

Thanks for your response and visit to my website ; Please do write comments they encourage me and help me to write more and more .

I am starting a series of articles and i will discuss all the things I am learning and doing :) I know it will be great fun !

those topics will includes VIO , HACMP , HMC , SCRIPTING perl/shell, tricks of Unix and much more so be tuned and enjoy learning and working.

Please let me know if you want some changes or any specific topic here if don't know i will ask some one to write it as there are many techniiiiiieeee guys here.

Yes,

I always welcome questions and promise to write their answers OR find out if don't know.

Thanks,
Dipak Warade

Wednesday, March 28, 2012

Some useful commands and interview questions with answer :)

How to create pvid on the hdisk6?
    unix4you# chdev –l hdisk6 –a pv=yes
2.    How to clear pvid on the hdisk6?
    unix4you# chdev –l hdisk6 –a pv=clear
3.    How to see summary of the hdisk2 as well as the pvid?
    unix4you# lspv hdisk2
4.    How to see Pp distribution on the hdisk2?
    unix4you# lspv –p hdisk2
5.    How to create Vg ?
    unix4you# mkvg –y datavg –s 64 hdisk2 hdisk3
6.    How to list logical volume in vg?
    unix4you# lsvg –l rootvg
7.    Detail information of datavg
    unix4you# lvg datavg
8.    How to list vg to know disk and distribution?
    unix4you# lsvg –p datavg
9.    How to extend datavg ? Or how to add disk into datavg?
    unix4you# extendvg datavg hdisk2
10.    How to remove disk from vg ?
    unix4you# reducevg datavg hdisk2
11.    How to migrate data from hdisk4 to hdisk2 and hdisk 1
    unix4you# migratepv hdisk4 hdisk2 hdisk1
12.    How to close volume group?
    unix4you# varyoffvg datavg
13.    How to open the volume group?
    unix4you# varryonvg datavg
14.    How to create the logical volume?
    unix4you# mklv –y lv05 –c 2 datavg 20
15.    How to remove logical volume ?
    unix4you# rmlv lv06
16.    How to extend logical volume ?
    unix4you# extendlv lv06 20

17.    How to create file system ?
    unix4you# crfs –v  jfs/jfs2 –g [vg_name –a size=] Or –d lv_name – m mount_point
    unix4you# mkfs –v jfs/jfs2  /dev/vl06
18.    How to change the file system size?
    unix4you# chfs –a size=+64M /data
    unix4you# chfs –a size=-64M /data
19.    How to list all file system?
    unix4you# lsfs
20.    How to list all jfs file system?
    unix4you# lsfs –v jfs
21.    How to cop to a new LV called "NeWLogicalVolume"                   
    unix4you# cplv -v VolumeGroup -y NewLogicalVolume SourceLogicalVolume        
22.    How to copy lv to existing lv ?
    unix4you# cplv -e DestinationLogicalVolume SourceLogicalVolume
23.    How to close the physical volume ?
    unix4you# chpv –v r hdisk2
24.    How to open the physical volume?
    unix4you# chpv –v a hdisk2
25.    How to clear boot record on the physical volume?
    unix4you# chpv –c hdisk2
26.    How to disable the quorum ?
    unix4you# chvg –Qn datavg
27.    How to enable the quorum?
    unix4you# chvg –Qy datavg

Tuesday, November 15, 2011

0516-066: Physical volume is not a volume group member.

Why i am getting below error?
#lsvg oravg
0516-066: Physical volume is not a volume group member.
Check the physical volume name specified

hdiskpower9 00f64abb7024b22a oravg active
hdiskpower10 00f64abb70216920 oravg active
hdiskpower11 00f64abb701cf0ad oravg active
hdiskpower12 00f64abb701dfefc oravg active

Answer :- www.unix4you.com

Monday, December 20, 2010

AIX interview Questions and answers




1)       What is mean by AIX?(AIX interview Questions and answers)
a)      AIX means advanced interactive executive. IBM has invented AIX which is   nothing but the advanced UNIX.

2)      How to reset Password in AIX? (AIX interview Questions and answers)
a)      Log in as root or admin user.
b)      Use passwd command to reset the password.
c)      #passwd user_name
d)      This will ask you
e)      New password:
f)      Enter new password and confirm again.
g)      Password change completed.

3)      How to set password to non expiry in AIX? (AIX interview Questions and answers)
a)      Log in as root or admin user.
b)      Use pwdadm –C username command to set non expiry passwd.
c)      # pwdadm –C username

4)      How to create User in aix? (AIX interview Questions and answers)
a)      Log in as root or admin user.
b)      Use smitty mkuser .
c)      User name is only mandatory field.
d)      Enter user name and press enter.
e)      If you see command run OK. You have created user.

5)      How to list user attributes? (AIX interview Questions and answers)
a)      Log in as root or admin user.
b)       Use lsuser  command to list user attributes.
c)      Eg.# lsuser user_name
d)      Above command list all attributes of user_name.



Popular Posts

Is this site helping you ?