Thursday, April 10, 2008

Veritas how to change the vxfs fs size

#fsadm -b 10m /opt/apps
- works even on a mounted fs
- increase does not work if fs 100% full ;-( errno 28 )

Thursday, April 3, 2008

AIX Restricted Shell to certain user

#vi /etc/security/login.cfg
* Others Security Attribute
usw:
shells = /bin/sh, .....,/usr/bin/Rsh

#chuser shell=/usr/bin/Rsh john
Now, John can't
- change the current dir
- Change the PATH variable
- Use COMMANd contains slashes
- Redirect standard output (>, >>)

Providing a limited set of commands
To give a limited set of commands to a user, copy the command to /usr/rbin and add /usr/rbin to the user 's PATH

AIX Performance Tools

Cpu Bottlenecks
#tprof -x sleep 60
#more sleep.prof (aix 5.3) or #more __prof.all (aix 5.2)


Memory Bottlenecks
global report
#svmon -G
top 3 users of memory
#svmon -Pt 3

I/O Bottlenecks
start monitoring disk activity
# filemon -o fmout
stop monitoring and create report
#trcstop
to see the report
#more fmout

To break it down further, seeing individual files
#filemon -O all -o fmout

Wednesday, April 2, 2008

AIX backup/restore a non-rootvg volume group

To list VG
# lsvg
old_rootvg
rootvg
testvg10
testvg1
#
To Save **this only backups mounted filesystem on that VG
#savevg -f /louisedata/testvg10_backup testvg10
To Rstore
#restvg -l -f /louisedata/testvg10_backup

AIX Tape Operation

To change block size
# chdev -l rmt0 -a block_size=512
# chdev -l rmt0 -a block_size=0 ##if need to use dd command for tape

The most common tctl subcommands are: fsf Moves the tape forward the number of file marks specified by Count.
# tctl -f bsf
Moves the tape backwards the number of file marks specified by Count.
# tctl -f rewind
Rewinds the tape.
# tctl -f erase
Erases all contents on the tape and rewinds it.
# tctl -f retension
Fast-forwards, then rewinds the tapeBackupsAIXbackup_AIXAIXBackupsbackup_AIX

Tuesday, April 1, 2008

AIX telinit and run levels

Examples
To request the init command to reexamine the /etc/inittab file, enter:
telinit q

To request the init command to enter maintenance mode, enter:
telinit s

Aix How to check if disk is bootable(mirror environment)

see last line
#ipl_varyon -i
PVNAME BOOT DEVICE PVID VOLUME GROUP ID
hdisk0 YES 0002f67fafcf9d4d0000000000000000 0002f67f00004c00
hdisk1 NO 0002f67f0a7b63c30000000000000000 0002f67f00004c00
hdisk2 NO 0002f67ff0849cc60000000000000000 0002f67f00004c00
hdisk3 NO 0002f67f0a7338570000000000000000 0002f67f00004c00
hdisk4 NO 0002f67f0a5c6f180000000000000000 0002f67f00004c00
#

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...