Thursday, January 29, 2009

HP-UX--> INIT: Timout Reached - Error in writing to wtmp or wtmps file

It can be:

/tmp or /var is full

or wtmp is corrupt:

1.Boot the server in single user mode
2.Delete /var/adm/wtmp
3.touch /var/adm/wtmp
4.Boot the server using init 3

...yes we can!

Wednesday, January 28, 2009

Are you going to finish strong?

Nick Vujicic has no arms or legs but has come to terms with his lot in life and he delivers an inspirational speech to these school kids that they will probably never forget.

This is a truly a source of inspiration teaching to live life at its best standards in spite of all difficulties. God bless us all.

Inspirational clip: http://www.youtube.com/watch?v=MnlhZyW959k

Tuesday, January 27, 2009

HP-UX : find big files in a directory

1) Find big files in a directory:

# find /dir_path -xdev -size +10000 -exec ll {} \; > /tmp/bigfiles

2) Find new files in a directory:

# find /dir_path -xdev -type f -mtime -2 -exec ll {} \; /tmp/newfiles

3) copy entire file system / directory to new location:

# find /source_dir_path -depth | cpio -pdlmuva /dest_path

..:-)


Monday, January 26, 2009

Basic network commands in HP-UX

FILES

* /etc/hosts - Hosts configuration file (resolve hosts and IPs)
* /etc/rc.config.d/netconf – IP address, routeing address and hostname stored in this file

SCRIPTS

* /etc/init.d/net start – Use to start, stop network service

HPUX Commands
(a) Display lan interface info:
# lanscan

(b) All in one lan configuration utility (lan0 is first Ethernet interface) to configure and view the system IP address:
# ifconfig lan0 - Display IP info such as IP address netmask etc.
# ifconfig lan0 up - Up network interface (allow traffic)
# ifconfig lan0 down - Down network interactive (deny traffc)
# ifconfig lan0 192.168.1.1 netmask 255.255.255.0 up - Setup/change IP adddress

(c) Displaying host name
# hostname

(d) Arp administration (cache)
# arp -a

(e) Display routing table/info:
# netstat -nr

(f) Define new route:
# route add default 192.168.1.254 1

(g) HP’s LAN diagnostic tool
# lanadmin

(h) Test a remote host connectivity
ping host.mycorp.com

(i) Setup various lan properties, dns client, NIS client configuration etc using GUI tool:
# sam
# set_parms

(j) Check dns connectivity:
$ nslookup www.google.co.uk

How to see the top 10 CPU users in HP-UX

try to type this :

UNIX95= ps -e -o pcpu -o ruser -o args|sort -nr|grep -v %CPU|head ???10


Note: pls. don't try this at home.

Sunday, January 25, 2009

Gong Xi Fa Cai 恭喜发财


The most common Chinese ways of saying Happy New Year are Gong Xi Fa Cai (Mandarin) and Gong Hey Fat Choy (Cantonese). Even though the pronunciations are a little different, both are written the same way.

Gong Xi is congratulations or respectfully wishing one joy.
Fa Cai is to become rich or to make money.

Thus, Gong Xi Fa Cai means wishing you to be prosperous in the coming year.

Happy Chinese New Year!

Saturday, January 24, 2009

Sentosa Flowers 2009


Celebrating the season of Spring and ushering in the Year of the Ox with a kaleidoscope of fresh blooms at the annual floral extravaganza. Magnificent displays of unique flowers and soak in the festive mood on the sunny island. The floral displays will be making its way down to the white sandy beaches of Palawan, making it a truly Sentosa experience. Jan 24-Feb 1, 2009 at Sentosa,Singapore.

Friday, January 23, 2009

HP-UX find

Q : Is there a way to run "find" so it reports all files/subdirs under a directory that are over X days old without transposing through all the subdirs?

example
under /X
/X/Y/Z
/X/A/B/C/D
/X/A/E/I/O/U

I would like it to report back only if Y and A have a date stamp older then 30 days.

A : find * -type d -prune -mtime +60
EXAMPLES (HP-UX man pages)
Search the two directories /example and /new/example for files
containing the string Where are you and print the names of the files:

find /example /new/example -exec grep -l 'Where are you' {} \;

Remove all files named a.out or *.o that have not been accessed for a
week:
find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm {} \;

Note that the spaces delimiting the escaped parentheses are
required.

Print the names of all files in /bin that are context-dependent; that
is, hidden directories:
find /bin -type H -print

Print the names of all files on this machine. Avoid walking nfs
directories while still printing the nfs mount points:

find / -fsonly hfs -print

Copy the entire file system to a disk mounted on /Disk, avoiding the
recursive copy problem. Both commands are equivalent (note the use of
-path instead of -name):
cd /; find . ! -path ./Disk -only -print | cpio -pdxm /Disk
cd /; find . -path ./Disk -prune -o -print | cpio -pdxm /Disk

Copy the root disk to a disk mounted on /Disk, skipping all mounted
file systems below /. Note that -xdev does not cause / to be skipped,
even though it is a mount point. This is because / is the starting
point and -xdev only affects entries below starting points.
More on man pages from HP-UX...kampai!

Saturday, January 17, 2009

How can I find the HP-UX equivalent for a given Solaris/AIX/etc.. commands?

-->Rosetta Stone for UNIX (A Sysadmin's Universal Translator; or
"What do they call that in this world?") provides a very nice AIX/
DG-UX/FreeBSD/HP-UX/IRIX/Linux/NetBSD/OpenBSD/Solaris/
SunOS/Tru64/Ultrix etc quivalency table at:

http://bhami.com/rosetta.html

-->UNIXguide.net also provides a
AIX/FreeBSD/HP-UX/Linux(RedHat)/Solaris/Tru64 equivalency
table, at:

http://www.unixguide.net/unixguide.shtml

Friday, January 16, 2009

How to change hostname on HP-UX 11i

::without reboot

HP-UX 11iv2 and v3 allows you to change the hostname on the fly, so if you want to change the hostname on HP-UX 11i server you can do it without rebooting your server. I have documented here several steps to change the hostname on your HP-UX 11i server.
Steps to change the hostname on HP-UX:

1. First run the hostname command to HP-UX server to change the hostname on HP-UX 11i server:

root@hpuxdev:/> hostname hpuxdev11

I am changing hostname on Integrity Itanium rx6600 running HP-UX 11iv2 from hpuxdev to hpuxdev11

2. Next execute uname command to set the nodename like hostname:

root@hpuxdev:/> uname –S hpuxdev11

running uname with –S option changes the nodename to required hostname value on HP-UX 11i server

3. Change network configuration file (netconf) to make the change permanent during reboots. The netconf files exists

under /etc/rc.config.d direcotory on HP-UX servers

root@hpuxdev:/> cd /etc/rc.config.d/netconf

root@nedunix6:/etc/rc.config.d> vi netconf

Open the netconf file using vi editor and search for HOSTNAME variable, replace the old hostname value to new hostname value. It is recommended by HP to keep the value enclosed in double quotes (" ")

root@nedunix6:/etc/rc.config.d> vi netconf

HOSTNAME="hpuxdev"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

After changing the HOSTNAME , the netconf file portion with HOSTNAME directives looks like this :

root@nedunix6:/etc/rc.config.d> vi netconf

HOSTNAME="hpuxdev11"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

5.Restart the network configuration settings on HP-UX server by running following command .Make sure you run these command from the CONSOLE or MP (Management processor) , sometimes ui have noticed network timeout for few seconds while restarting network settings :

root@hpuxdev:/> /sbin/init.d/net start

Verify changes hostname on HP-UX:

Finally run following commands to make sure hostname and nodename is changed to newer name :

root@hpuxdev:/> hostname

hpuxdev11

root@hpuxdev:/> nodename

hpuxdev11

:with REBOOT

There is a *much* simpler way:

set_parms hostname

Answer a prompt or two, and.... Done!

Monday, January 12, 2009

Barack Obama is featured on the upcoming issue of The Amazing Spider-Man comic book in commemoration of his upcoming inauguration as the 44th President of the USA. Since Obama is a self confessed Spider-Man comics geek when he was a kid, Marvel Comics thought it would be cool to honor the new president this way...
The issue hits the comic stands on Jan 14, this is gonna be huge!

HP-UX LVM creation

ex. create /oracle/J1Q/sapdata13 under volume group vg_J1Q_04
using luns c14t1d4(primary) & c14t8d1(alternate)

-->check if fs existed
bdf /oracle/J1Q/sapdata13

--> check the latest disk report
cd /var/opt/soeg/rpt
ll *disk*

--> check for available luns
more 20080423diskinfo.rpt | grep -i lvm | grep -v "0(" | sort -u

-->compares the current hardware configuration (pairing of luns)
xpinfo -il | grep c12t0d1
xpinfo -il | grep 04:28

--> check if controller exists already
pvdisplay /dev/dsk/c14t8d1
pvdisplay /dev/dsk/c14t1d4
vgdisplay -v | grep -iE "c14t8d1|c12t0d1"

ll /dev/*/group | sort -u

-->create directory/device
mkdir /dev/vg_J1Q_04

-->create a character file type group
mknod /dev/vg_J1Q_04/group c 64 0x410000

-->initialize/format physical volume
pvcreate -f /dev/rdsk/c12t0d1

-->create volume group
vgcreate -e 10000 /dev/vg_J1Q_04 /dev/dsk/c12t0d1 /dev/dsk/c14t8d1
vgdisplay /dev/vg_J1Q_04

-->create logical volume
lvcreate -L 8624 -n lv_data13 /dev/vg_J1Q_04

-->construct the new file system
newfs -F vxfs -o largefiles /dev/vg_J1Q_04/rlv_data13

-->create directory
mkdir -p /oracle/J1Q/sapdata13

-->update /etc/fstab

--> mount created new directory
mount /oracle/J1Q/sapdata13

-->check file permission and ownership
chgrp oraj1q:dba sapdata13
chown oraj1q:dba sapdata13


note: the above syntax are derived from true to life experience
and im not liable in case you use it on a production box and
it didn't works. :-)

Monday, January 5, 2009

HP-UX reviewer 4

:: if you can't remove Volume Group w/ 'ghost' logical volume

# vgremove /dev/vg
vgremove: Volume group "/dev/vg" still contains a logical volume(s).
vgremove: Couldn't remove volume group "/dev/vg".

ans:

#vgchange -a n /dev/vg
#vgexport /dev/vg

your volume group will be removed from /etc/lvmtab..
It is equal to vgremove...tried it and it worked.

sa susunod ulit...ciao...

Sunday, January 4, 2009

HP-UX reviewer 3

:: NFS mounting

ex : mount directory /sapcd of sihp8080 to sihp8085

@sihp8080 -->
[root@sihp8080:/sapcd]
# bdf /sapcd
Filesystem kbytes used avail %used Mounted on
/dev/vg_sapcd2_temp/lv_sapcd2
106770432 54467240 51894584 51% /sapcd

[root@sihp8080:/sapcd]
# more /etc/exports | grep -i sapcd
/sapcd -root=sihp8085:sihp8086:sihp8087,access=sihp8085:sihp8086:sihp8087

[root@sihp8080:/sapcd]
# exportfs -av
re-exported /sapcd
re-exported /usr/sap/put

@sihp8085-->
[root@sihp8085:/sapcd]
#
bdf /sapcd
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lv_root 819200 179488 634768 22% /

[root@sihp8085:/sapcd]
# more /etc/fstab | grep -i sapcd
sihp8080:/sapcd /sapcd nfs rw,suid 0 0

[root@sihp8085:/sapcd]
# mount /sapcd

more to come....chalo
('lets go' in Hindi).

Friday, January 2, 2009

2009 Year of the Earth OX January 26, 2009 - February 13, 2010


Peoples' Park, Chinatown in Singapore 2009

The Chinese calendar is based on solar and lunar cycles and thus the new year falls on a different day of the Western solar calendar each year.

Year Ahead:
The OX year is a conservative year, one of traditions and values. This is not a year to be outrageous. A slow but steady year.

This OX year will bring stability and growth where patience and diligence pays off.

This is a year of Harvest - when we reap what we have sown. Take care of business this year, do not let things slide.

Thursday, January 1, 2009

Different uses of the word F_U

Eto try nyo, sinend sa akin..

Explanation of the word F_u_ c_k.mp3
download the file here.

HP-UX reviewer 2

....continued from my HP-UX kodigo....
  • Exporting and Importing disks across system.
1. make the volume group unavailable
vgchange -a n /dev/vgdata

2. Export the the disk while creating a logical volume map file.
vgexport -v -m data_map vgdata

3. Disconnect the drives and move to new system.
4. Move the data_map file to the new system.
5. On the new system recreate the volume group directory
mkdir /dev/vgdata
mknod /dev/vgdata/group c 64 0x02000

6. Import the disks to the new system
vgimport -v -m data_map /dev/vgdata /dev/dsk/c2t1d0 /dev/dsk/c2t2d0

7. Enable the new volume group
vgchange -a y /dev/vgdata
  • Renaming a logical volume
    /dev/vgdata/lvol1 -> /dev/vgdata/data_lv
umount /dev/vgdata/lvol1
ll /dev/vgdata/lvol1
take note of the minor ( e.g 0x010001 )
brw-r----- 1 root root 64 0x010001 Dec 31 17:59 lvol1
mknod /dev/vgdata/data_lv b 64 0x010001 create new logical volume name
mknod /dev/vgdata/rdata_lv c 64 0x010001
vi /etc/fstab { reflect the new logical volume }
mount -a
rmsf /dev/vgdata/lvol1
rmsf /dev/vgdata/rlvol1

to be continued.....

HP-UX reviewer

naks, kala nyo genius ako sa HP-UX? Kodigo ko lang ito in case of emergency..ito ung laman ng halo-halo.txt na naka-save sa lagi kong dala na vintage 128mb flash disk tuwing may duty ako.

HP-UX: Disk and Filesystem tasks
  • Search for attached disk
    ioscan -fnC disk
  • Initialize a disk for use with LVM
    pvcreate -f /dev/rdsk/c0t1d0
  • Create the device structure needed for a new volume group.
    cd /dev
    mkdir vgdata
    cd vgdata
    mknod group c 64 0x010000
  • Create volume group vgdata
    vgcreate vgdata /dev/dsk/c0t1d0
    { if your expecting to use more than 16 physical disks use the -p option, range from 1 to 256 disks. }
  • Display volume group vgdata
    vgdisplay -v vg01
  • Add another disk to volume group
    pvcreate -f /dev/rdsk/c0t4d0
    vgextend vg01 /dev/dsk/c0t4d0

  • Remove disk from volume group
    vgreduce vg01 /dev/dsk/c0t4d0
  • Create a 100 MB logical volume lvdata
    lvcreate -L 100 -n lvdata vgdata
    newfs -F vxfs /dev/vgdata/rlvdata
  • Extend logical volume to 200 MB
    lvextend -L 200 /dev/vgdata/lvdata
  • Extend file system to 200 MB

    :: NO online JFS installed
    fuser -ku /dev/vgdata/lvdata { kill all process that has open files on this volume. }
    umount /dev/vgdata/lvdata
    extendfs /data

    ::Online JFS {ex. 200 MB / 4 MB = 50 LE; 50 x 1024 = 51200 blocks }
    fsadm -F vxfs -b 51200 /data
  • Set largefiles to support files greater than 2GB
    fsadm -F vxfs -o largefiles /data

Paunawa:kung hindi maintindihan, magtanong sa katabing ofismate...more to come.

New year - new challenge


Marina Bay - New Year, Singapore 2009

We will open the book. Its pages are blank. We are going to put words on them ourselves. The book is called Opportunity and its first chapter is New Year’s Day.--Edith Lovejoy Pierce