Showing posts with label UNIX Troubleshooting. Show all posts
Showing posts with label UNIX Troubleshooting. Show all posts

Thursday, January 13, 2011

Cron (solaris) "bad user" error

cron (solaris) "bad user" error message in /var/log/cron
--------------------------------------------------------

Cron needs to be able to access a shell as the cron user in order to
do its thing. The easiest work-around for this is to edit the
/etc/shadow file and change the *LK* to *NP* for the affected
accounts.

read more...

Tuesday, January 11, 2011

vxrestore / vxdump

# vxdump 0fu /dev/rmt/0m /var ; dump vxfs file system /var to tape /dev/rmt/0m using level 0 and update /var/adm/dumpdates

# vxrestore tf /dev/rmt/0m | grep eaaa ; obtain table of contents from tape /dev/rmt/0m and look for filename containing "eaaa"

# vxrestore -yxf /dev/rmt/0m ; restore the whole content of the tape into current dir, answer 1 and y

# mt -f /dev/rmt/0m rewind ; rewind tape after listing the tape

read more...

Tuesday, August 21, 2007

HP-UX, bdf, du and ...

If you ever encounter a file system full, say, at this particular partition:
[ROOT gitu2]Z24/X41 # uname -a
HP-UX gitu2 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT gitu2]Z24/X41 # bdf /usr/sap/Z24/X41
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol30 4620288 4610752 9038 100% /usr/sap/Z24/X41
[ROOT gitu2]Z24/X41#


and you have been trimming, deleting files like crazy, say, you've delete a 1.7G file but when you issue bdf, the utilization still at 100%. But when you checked with du, it shows the current utilization on that particular partition/directory has been reduced. WTF?!

Don't worry dude/dudette. Basically, there are some processes running that currently writing on some files on that directories and until those processes are stopped finishing writting you will not see the free space in bdf.

To identify the processes, run this:
[ROOT gitu2]Z24/X41 # fuser -cu /usr/sap/Z24/X41
/usr/sap/Z24/X41: 7314co(z24adm) 15790co(z24adm) 24426co(z24adm) 10374co(z24adm) 8094mcto(z24adm) 10514co(z24adm) 24418co(z24adm) 24433co(z24adm) 24458co(z24adm) 24432co(z24adm) 24446co(z24adm) 22457co(z24adm) 24385co(z24adm) 12656co(z24adm) 24444co(z24adm) 24439co(z24adm) 24442co(z24adm) 24451co(z24adm) 24438co(z24adm) 24386co(z24adm) 26313co(z24adm) 4756co(z24adm) 24428co(z24adm) 24435co(z24adm) 17512co(z24adm) 24459co(z24adm) 20846co(z24adm) 24431co(z24adm) 24460co(z24adm) 9184co(z24adm) 3585co(z24adm) 24440co(z24adm) 24448co(z24adm) 24417co(z24adm) 24430co(z24adm) 24443co(z24adm) 24338c(z24adm) 24441co(z24adm) 12555co(z24adm) 24461co(z24adm) 24434co(z24adm) 24436co(z24adm) 24445co(z24adm) 24429co(z24adm) 4539c(root) 24437co(z24adm) 11852co(z24adm) 24449co(z24adm) 24450co(z24adm) 26830co(z24adm) 28242c(root)

[ROOT gitu2]Z24/X41 #


Ah-ha! It will listed all the eeeviiilll processes. What you need to do is kill all those processes and voila!, you'll get your free space back.

** ACHTUNG **
Don't simply kill the processes until you pretty sure it is safe to kill with the owner of the processes (backup team, or whatever). Use j00r brain d00dz.
** ACHTUNG **

read more...

Friday, August 10, 2007

HP-UX: kthread: table is full

If you ever encounter this error in dmesg or syslog.log
[root abc12]home/root # dmesg | tail
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
[root abc12]home/root #
[root abc12]home/root # cat /var/adm/syslog/syslog.log | grep kthread
Aug 9 21:37:12 abc12 vmunix: kthread: table is full
Aug 9 21:37:14 abc12 vmunix: kthread: table is full
Aug 10 14:07:18 abc12 vmunix: kthread: table is full
Aug 10 14:07:20 abc12 vmunix: kthread: table is full
[root abc12]home/root #


Then what you need to do is increase the maxusers kernel param in /stand/system

Steps:
1. Log in as root and edit/add maxusers 200 (16-way systems) or maxusers 400 (large 64-way systems i.e. SuperDome) in /stand/system

2. Run these commands:
mk_kernel -v -o /stand/vmunix
kmupdate
reboot -r


3. For God sake don't copy and paste the above commands, as the last command is reboot! Make sure you're safe/authorized to do a reboot before hitting the last command, or else, you're SuperDOOM.

To monitor the processes utilization, issue this command:
[root abc12]home/root # sar -v 1 5

HP-UX abc12 B.11.11 U 9000/800 08/10/07

17:58:07 text-sz ov proc-sz ov inod-sz ov file-sz ov
17:58:08 N/A N/A 172/664 0 1087/7360 0 1209/12018 0
17:58:09 N/A N/A 172/664 0 1087/7360 0 1209/12018 0
17:58:10 N/A N/A 172/664 0 1087/7360 0 1207/12018 0
17:58:11 N/A N/A 172/664 0 1087/7360 0 1207/12018 0
17:58:12 N/A N/A 172/664 0 1087/7360 0 1207/12018 0

[root abc12]home/root #


Look under proc-sz column, the 172/664 values represent the current number of processes (172) and the maximum number of processes (664).

To view the current value of maxusers:
[root abc12]home/root # cat /stand/system | grep maxusers
maxusers 200
[root abc12]home/root #


or

[root abc12]home/root # kmtune | sed q;kmtune | grep maxusers

Parameter             Current Dyn Planned                    Module     Version
maxusers 200 - 200

[root abc12]home/root #

*2nd option tu nampak cam terrer la sikit

If you wanna choose a less-headache version, use SAM. Don't know how to use SAM? Eat yourself.

read more...

Monday, August 6, 2007

HP-UX Stuffs

1. List installed HP-UX patches
swlist -l product 'PH??_*'

2. ioscan command hang/slow.
Check for zombie processes of ioscan, try to kill 'em (if you know how to kill a ghost), or kill PPID (make sure PPID != 1 !!)

read more...

Monday, July 30, 2007

SunOS: Route delete problem

If you ever encouter problem deleting routing in SunOS, make sure you specify the netmask.

For example:
1. add routing:
root@xyz # route add -net 123.45.57.0 34.56.78.1 -netmask 255.255.255.192

2. out of no reason, you want to delete routing that u just add:
root@xyz # route delete -net 123.45.57.0 34.56.78.1
delete net 123.45.57.0: gateway 34.56.78.1: not in table
root@xyz #


you will received error msg as above.

So, what you need to do is to specify the netmask, such as:
root@xyz # route delete -net 123.45.57.0/26 34.56.78.1

* to check netmask for the specific entry, use command: root@xyz # netstat -rvn
Voila!

read more...