Operating System - HP-UX
1834942 Members
2165 Online
110071 Solutions
New Discussion

Re: Problem with some commands

 
SOLVED
Go to solution
Henk Geurts
Esteemed Contributor

Re: Problem with some commands

hi Victor

for cleaning of /var lots of options and things to check.

1 let 's see the output of:
cd /var
du -sk * |sort -n

this will show largest files/dir at the end.

2 cd /var/mail
any large files here ?

3 cd /var/adm/crash
any old crash.* directories ? can be removed.

let me know and then we will look further if nessecary.
regards.
Pete Randall
Outstanding Contributor

Re: Problem with some commands

/dev/vg00/lvol9 is /var and it's full, that's why. Try removing /var/tmp:

rm -rf /var/tmp/*

and /var/tombstones:

rm -rf /var/tombstones/*

Then run the cleanup command to commit any patches that have been superceded:

cleanup -c 2

Then run bdf again to see if we've gained any room in /var


Pete

Pete
Naveej.K.A
Honored Contributor

Re: Problem with some commands

Victor,

You may also:

rm -rf /var/tmp/*

Regards,
Naveej
practice makes a man perfect!!!
Victor_138
Regular Advisor

Re: Problem with some commands

The /var/adm seems to be the biggest.

kcspecdp # pwd
/var
kcspecdp # du -sk * |sort -n
0 X11
0 lost+found
0 ncs
0 news
0 ppl
0 preserve
0 rap
0 rbootd
0 uucp
1 mail
2 run
2 statmon
4 dt
39 yp
116 tombstones
181 tmp
187 spool
526 sam
5670 opt
29284 stm
481590 adm

kcspecdp # /var/mail
sh: /var/mail: Execute permission denied.
kcspecdp # cd mail
kcspecdp # pwd
/var/mail
kcspecdp # du -sk *|sort -n
1 ~.sh_history

kcspecdp # cd /var
kcspecdp # cd /adm
sh: /adm: not found.
kcspecdp # cd adm
kcspecdp # cd crash
kcspecdp # du -sk * |sort -n
du: *: No such file or directory
0 *
kcspecdp # pwd
/var/adm/crash
kcspecdp # ll
total 0
kcspecdp #
Victor_138
Regular Advisor

Re: Problem with some commands

Contents of /var/adm

kcspecdp # du -sk *|sort -n
0 acct
0 automount.log
0 crash
0 diag
0 eisa
0 rc.log
0 shutdownlog
0 sm.bin
0 streams
0 xferlog
1 OLDsulog
1 conslog.opts
1 fbackupfiles
1 new._ACL
1 new._OWNER
1 new._PROD_DFLT_ACL
1 new._SOC_DFLT_ACL
1 new.secrets
1 rpc.lockd.log
1 rpc.statd.log
1 sbtab
1 sulog
2 inetd.sec
2 lp
3 btmp
3 nettl.LOG00
6 snmpd.log
7 cron
7 ptydaemonlog
7 vtdaemonlog
12 ps_data
24 syslog
67 wtmp
481437 sw
kcspecdp #
Victor_138
Regular Advisor

Re: Problem with some commands

Contents of /var/adm/sw

kcspecdp # du -sk *|sort -n
0 host_object
0 software
0 targets
0 ui
1 cleanupfile.prev
1 config.prev
1 getdate.templ
1 save_custom
2 defaults
2 swverify.log
4 install.log
7 needs_config.prev
7 security
10 queue
11 sessions
31 save
35 swagentd.log
42 swconfig.log
126 swinstall.log
1283 swmodify.log
2315 swagent.log
23409 products
454147 patch
kcspecdp #
TommyT
Valued Contributor

Re: Problem with some commands

HI Victor.

Do as Pete Randall said. Use cleanup and you will free space. See manpage for cleanup.


//Tommy
tompa
Victor_138
Regular Advisor

Re: Problem with some commands

Did the rm's successfully but didn't liked the cleanup command.

kcspecdp # cleanup -c 2
usage: /usr/sbin/cleanup [-F][-t]
/usr/sbin/cleanup -i
/usr/sbin/cleanup -d

Note: The -i and -d options cannot be used with
any other options.

-F : Force removal of all obsolete data from the
/var/adm/sw/patch directory. Do not save 1
level of backup.
-t : Trim SD logfiles only. Don't remove any other data.
Trim the logs to the last 5 entries.
-i : Remove patch information from the SD-UX Installed Product
Database (IPD) for patches that have been overwritten by
software product installations or upgrades.
-d : Remove patches from the depot that have been superseded
by newer patches also available in the same depot. The
depot must be resident on the local system.

kcspecdp #
Victor_138
Regular Advisor

Re: Problem with some commands

Tommy, thaks for the suggestion but can't use man or more on the system; get a permission denied error and that was the original discussion here.
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Victor,

I didn't realize you were on a 10.20 system - they syntax for cleanup is different then. Try running :

cleanup -i


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

Cleanup results

kcspecdp # cleanup -i

This utility will identify the patches that have been overwritten by the installation of software products during an upgrade or install process. Once the patches are identified, it will request confirmation
before removing the patch information from the SD-UX Installed Prod Database.

Obtaining the list of installed products and patches... done!

Comparing installed product and patches information...

/usr/sbin/cleanup: more: Execute permission denied.


Hit [Return] to continue...
/usr/sbin/cleanup: more: Execute permission denied.


Hit [Return] to continue...

Would you like to remove all the listed patches from the IPD? y

Please be patient, this could take several minutes.


Removing patch information from the IPD...
>>>> Removed PHKL_16751 from the IPD 05/20/05 0
>>>> Removed PHKL_20097 from the IPD 05/20/05 0

Would you like to remove the backup files for the listed patches? y

Please be patient, this could take several minutes.


Removing backup files for patches...

>>>> Removed backup directory: PHKL_16751 05/20/05 08:14:12
>>>> Removed backup directory: PHKL_20097 05/20/05 08:14:12

The overwritten patches have been removed from the IPD.

kcspecdp # bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 147456 21739 117907 16% /
/dev/vg00/lvol1 83733 31469 43890 42% /stand
/dev/vg00/lvol9 524288 516938 7205 99% /var
/dev/vg00/lvol8 565248 408152 147298 73% /usr
/dev/vg02/lvol4 8192000 3321462 4566362 42% /u08
/dev/vg02/lvol3 8192000 6425107 1656530 80% /u07
/dev/vg01/lvol4 6144000 4099709 1916528 68% /u06
/dev/vg01/lvol3 2048000 357290 1585045 18% /u05
/dev/vg02/lvol2 2048000 104022 1822483 5% /u04
/dev/vg02/lvol1 2048000 187017 1744677 10% /u03
/dev/vg01/lvol2 3072000 54145 2829242 2% /u02
/dev/vg01/lvol1 3072000 636244 2283584 22% /u01
/dev/vg00/lvol7 65536 2896 58777 5% /tmp
/dev/vg00/lvol6 618496 162932 427129 28% /opt
/dev/vg00/lvol5 24576 1110 22007 5% /home
kcspecdp #
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Well, that didn't gain us much space but it did gain some. Try going back into SAM to see if you can extend /var now.


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

Finally!!!

Had to kill a couple of hung processes and finally SAM worked. Here's the result:

kcspecdp # bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 147456 21931 117727 16% /
/dev/vg00/lvol1 83733 31469 43890 42% /stand
/dev/vg00/lvol9 1536000 517322 955324 35% /var
/dev/vg00/lvol8 565248 408152 147298 73% /usr
/dev/vg02/lvol4 8192000 3321462 4566362 42% /u08
/dev/vg02/lvol3 8192000 6425107 1656530 80% /u07
/dev/vg01/lvol4 6144000 4099709 1916528 68% /u06
/dev/vg01/lvol3 2048000 357290 1585045 18% /u05
/dev/vg02/lvol2 2048000 104022 1822483 5% /u04
/dev/vg02/lvol1 2048000 187017 1744677 10% /u03
/dev/vg01/lvol2 3072000 54145 2829242 2% /u02
/dev/vg01/lvol1 3072000 636244 2283584 22% /u01
/dev/vg00/lvol7 65536 2912 58762 5% /tmp
/dev/vg00/lvol6 618496 162932 427129 28% /opt
/dev/vg00/lvol5 24576 1110 22007 5% /home
kcspecdp #
Henk Geurts
Esteemed Contributor

Re: Problem with some commands

Great!

at last it worked !

nevertheless i advise you to create different filesystems under /var to avoid this kind of problems in the future.

here is how we in our company generally do it :
bdf |grep var
/dev/vg00/lvol8 2097152 605368 1480224 29% /var
/dev/vg00/lvol11 524288 2010 490411 0% /var/tmp
/dev/vg00/lvol9 1048576 583477 436077 57% /var/adm
/dev/vg00/lvol10 2064384 114183 1828317 6% /var/adm/crash


regards.
Henk
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Now that we've got /var sorted out, are you still unable to run "more"?


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

Still get the same error.

kcspecdp # more
sh: more: Execute permission denied.
kcspecdp #

Happens to any user on any shell.
Victor_138
Regular Advisor

Re: Problem with some commands

Henk,

To achieve something like this:

/dev/vg00/lvol8 2097152 605368 1480224 29% /var
/dev/vg00/lvol11 524288 2010 490411 0% /var/tmp
/dev/vg00/lvol9 1048576 583477 436077 57% /var/adm
/dev/vg00/lvol10 2064384 114183 1828317 6% /var/adm/crash

Do I need to re-create the logical volumes?
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Do you have another system available that you could copy the more command from?


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

No but copied it from the OS disks and had the same result.
Victor_138
Regular Advisor

Re: Problem with some commands

This system was a NIS client and after a divestiture NIS was disabled because we don't have a NIS server anymore, could that be the reason or be somehow related?

Pete Randall
Outstanding Contributor

Re: Problem with some commands

Victor,

Try running "whence more".

It should look like this:

# whence more
/usr/bin/more


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

kcspecdp # whence more
/usr/bin/more
kcspecdp #
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Victor,

Try "type more":

# type more
more is /usr/bin/more

Also, you see you copied it from the OS disks. How did you do that? What OS disks are you referring to?


Pete

Pete
Victor_138
Regular Advisor

Re: Problem with some commands

kcspecdp # type more
more is /usr/bin/more
kcspecdp #

The file was transfered using ftp from a pc, the disk used was 10.20 Hardware Extensions 2.0 and the path to the file is F:\OS-Core\CMDS-MIN\usr\bin
Pete Randall
Outstanding Contributor

Re: Problem with some commands

Did you use binary mode on the ftp from the PC?


Pete

Pete