Tuesday, March 5, 2013

/var File System is Full

Do the following:

1) Check for large files over 5 meg in the file system in our case (var):
find /var -type f -xdev -size +5000000c -exec ls -ld {} \;|sort -k 5n

The xdev option tells it not to cross mount points. Since var is the affected file system you wouldn't want to know about large files that may be in /var/spool/sw if you had created a /var/spool/sw file system since it wouldn't be relevant to filling up /var. This is necessary when looking at any file system, like a root file system that is full for the same reason... a large file in var in this case wouldn't be relevant.

The exec option instructs the find command to issue an ls -ld against any file that meets our criteria. The resulting matches are substituted inside the {}, and then executed.

Then the results of the ls -ld output is sent to the sort and sorted based on the 5th column which is the size column. The result is that the larger files are listed at the end.

2) Look at the output and decide if any of the resulting files can be safely removed.

Core Files: Core files result when applications terminate unexpectedly.  They create a core file so that a programmer can analyze them to determine the cause of the abrupt or unexpected termination. These files can be safely removed once verified that they are indeed core files of this nature. They can be quite large in size. Use the unix "file" command to determine if the file is a "valid" core. Example:

file /var/core
/var/core: core file from 'swinstall' - received SIGSEGV

Note: Keep in mind that not all valid core files will generate the above output, but if you see this type of output you can be sure it is a core file that can safely be removed. Users and programmers should not create files or directories named core, but both sometimes incorrectly will do
just this. I mention this so you do not accidentally remove a valid user or program file. Core files can be controlled with the ulimit command. Do a man on ksh and search with /ulimit to jump to the ulimit section.

This is an example of a valid core file which can be removed. You can see that the core file resulted from the swinstall command having received a kill signal of SIGSEGV. Additional information can be obtained from running the what command against the core file:

what /var/core

I will not go into the analysis of the output here because it is a separate topic, but mention it in case you were not aware of this.

Logfiles... see item 3

Patches
If patches seem to be consuming a large amount of space in /var then consider running the cleanup command. I would first install any SD-UX (Software Distributor for Unix) cumulative patches or SD tools patches.
cleanup -c 2

Note: Keep in mind that once the cleanup command has ran removing the patch uninstall information you can not remove the patch. However, it is typically safe to remove a patch that has been superseded twice.

3) Next check for a large number of smaller files that may have passed under the radar of our find command.

Typical reasons for /var to fill up would be:
Print jobs:
lpstat -t
Solution: cancel

syslog.log large (please read the note below before running):
cd /var/adm/syslog ; ls -ld *
> syslog.log

Note: This will remove syslog and mail log info. It may be advised to copy this elsewhere in case you are having another problem. For example the syslog filling up may be due to a hardware problem, or a correctable software configuration issue. cat the file rather than using vi as this will attempt to open it in /var (which in our case is already full)

mail.log large (please read the note below before running):
cd /var/adm/syslog; ls -ld *
> mail.log

If mailq reports numerous mail files, then check the mail log with the mtail command. The mailq is located in /var/spool/mqueue. Correct any issue with mail delivery.

Note: Please read the mail.log prior to removing it. It may indicate a problem that needs to be corrected first. You can use the mtail command to view it, and mailq to see what is queued. cat the file rather than using vi as this will attempt to open it in /var (which in our case is already full)

3) The file may have been removed while a process had the file open. This would remove the file, but not release the space. In this case I would recommend downloading the lsof (LiSt of Open Files) command. It is not installed by default, but can be obtained from the purdue site.

ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/binaries/hpux

I recommend placing this in the /usr/contrib/bin/ directory. Be sure to select the one for your OS, and kernel width. getconf KERNEL_BITS will tell you your OS Kernel width.

The man page will be lsof.8 Place this file in /usr/contrib/man/man8
The man8 directory will need to be created.

lsof /var |sort -k 7n

The second column will give the PID. For example if you see a /dev/vg00/lvol8 listed in the last column and PID reflects that it is
syslogd, then someone tried to do an rm against the syslog.log file while the syslogd daemon still had the file open. To release the space they should have ran:

cat /dev/null > /var/adm/syslog/syslog.log
Or
> /var/adm/syslog/syslog.log

You could use rm, but only if you stopped the syslogd daemon first.

To recover the space... run /sbin/init.d/syslogd stop

If the process is an oracle log file, and someone removed it while it was open, then you would have to stop/start the oracle process to release the desired space. If the process is an essential process you may not want to stop/start it. In this case focus on other means... like removing large syslog, and mail.log or running the cleanup until which time the critical process can be restarted.

Monday, March 4, 2013

Data Protector Support for Non-Supported Libraries (Oxymoron)



How to configure an unsupported Tape Library with Data Protector

The first step would be to consult the Data Protector support matrix to determine if you are using an unsupported tape library.  You can also check /opt/omni/scsitab text file to see if your tape library and tape drives are listed in this file.  The scsitab file can be updated and updates can be found on HP's site for your specific version of Data Protector.  http://www.hp.com/go/bizsupport




External control
When using the Data Protector "Next Step Wizard" select "Configure New Devices" option and select the device type as "External Control".


 








External control is a means to control libraries not known to Data Protector. If Data Protector does not support a particular device, a user can write a script/program, that will run the robotic control to load a medium from a particular slot into the specified drive. It is possible to configure a library as an external control by referring to a special script.


External Reference:
http://www.hp.com/go/ebs  (HP Enterprise Backup Solution... both the design guides and the compatibility matrix can be found at this hp "go" URL)
http://www.hp.com/go/dataprotector
http://www.hp.com/go/bizsupport 

Bryan Payne on Linkedin https://www.linkedin.com/in/paynebryan

Friday, March 1, 2013

How to create an Ignite Boot helper DVD from ISO


For two step booting (as was previously required for Itanium systems) use the following command:

/opt/ignite/data/scripts/examples/make_media_install -r B.11.31 -m/var/opt/ignite/bryan

NOTE:  Be sure you have enough room in the -m (Media Directory) that you intend to write to.(You can also specify -r as B.11.23 for example)

CAUTION:  Be sure to create this on a system that has the same version of Ignite-UX as you intend to use for the recovery... whether that be from tape or from an Ignite server using make_net_recovery.

This will create the ISO file, and burn it if you have a DVD-RW, but you can transfer this ISO image file to your PC to burn it from here if you do not have a DVD-RW connected to your HP-UX Unix System.

Output will look like this:
/opt/ignite/data/scripts/examples/make_media_install -r B.11.31 -m /var/opt/ignite/bryan

WARNING: Non-default -m option value specified along with default -p option value; the default directory could run out of disk space, should both options be given?
=== Step 1: Make Ignite-UX config files for golden image archive(s) ===
=== Step 2: Copy SD depot(s) and make config files for them ===
=== Step 3: Make a boot-image (LIF volume) ===
+ /opt/ignite/bin/make_medialif -a -r B.11.31 -f /opt/ignite/data/Rel_B.11.31/config -l /var/opt/ignite/media/pseudo_root/bootvol.lif
+ /opt/ignite/bin/instl_adm -b -F /var/opt/ignite/media/pseudo_root/bootvol.lif
=== Step 4: Make ISO media image ===
+ cp -p /opt/ignite/boot/Rel_B.11.31/EFI_CD_image /var/opt/ignite/media/pseudo_root
+ /opt/ignite/lbin/mkisofs -U -max-iso9660-filenames -no-emul-boot -b EFI_CD_image -R -eltorito-alt-boot -no-emul-boot -b bootvol.lif -o /var/opt/ignite/bryan/image.iso /var/opt/ignite/media/pseudo_root
Warning: creating filesystem that does not conform to ISO-9660.
Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.
Size of boot image is 10240 sectors -> No emulation
Size of boot image is 995440 sectors -> No emulation
  1.99% done, estimate finish Fri Mar  1 17:59:04 2013
  3.98% done, estimate finish Fri Mar  1 17:59:29 2013
  5.96% done, estimate finish Fri Mar  1 17:59:37 2013
  7.95% done, estimate finish Fri Mar  1 17:59:41 2013
  9.94% done, estimate finish Fri Mar  1 17:59:44 2013
 11.93% done, estimate finish Fri Mar  1 17:59:37 2013
 13.91% done, estimate finish Fri Mar  1 17:59:32 2013
 15.90% done, estimate finish Fri Mar  1 17:59:29 2013
 17.89% done, estimate finish Fri Mar  1 17:59:26 2013
 19.88% done, estimate finish Fri Mar  1 17:59:29 2013
 21.86% done, estimate finish Fri Mar  1 17:59:26 2013
 23.85% done, estimate finish Fri Mar  1 17:59:29 2013
 25.84% done, estimate finish Fri Mar  1 17:59:27 2013
 27.83% done, estimate finish Fri Mar  1 17:59:25 2013
 29.81% done, estimate finish Fri Mar  1 17:59:27 2013
 31.80% done, estimate finish Fri Mar  1 17:59:26 2013
 33.79% done, estimate finish Fri Mar  1 17:59:27 2013
 35.78% done, estimate finish Fri Mar  1 17:59:29 2013
 37.76% done, estimate finish Fri Mar  1 17:59:27 2013
 39.75% done, estimate finish Fri Mar  1 17:59:29 2013
 41.74% done, estimate finish Fri Mar  1 17:59:30 2013
 43.73% done, estimate finish Fri Mar  1 17:59:29 2013
 45.71% done, estimate finish Fri Mar  1 17:59:30 2013
 47.70% done, estimate finish Fri Mar  1 17:59:31 2013
 49.68% done, estimate finish Fri Mar  1 17:59:32 2013
 51.67% done, estimate finish Fri Mar  1 17:59:31 2013
 53.66% done, estimate finish Fri Mar  1 17:59:31 2013
 55.65% done, estimate finish Fri Mar  1 17:59:30 2013
 57.63% done, estimate finish Fri Mar  1 17:59:31 2013
 59.62% done, estimate finish Fri Mar  1 17:59:32 2013
 61.61% done, estimate finish Fri Mar  1 17:59:33 2013
 63.60% done, estimate finish Fri Mar  1 17:59:32 2013
 65.58% done, estimate finish Fri Mar  1 17:59:32 2013
 67.57% done, estimate finish Fri Mar  1 17:59:33 2013
 69.56% done, estimate finish Fri Mar  1 17:59:34 2013
 71.55% done, estimate finish Fri Mar  1 17:59:33 2013
 73.53% done, estimate finish Fri Mar  1 17:59:33 2013
 75.52% done, estimate finish Fri Mar  1 17:59:34 2013
 77.51% done, estimate finish Fri Mar  1 17:59:34 2013
 79.50% done, estimate finish Fri Mar  1 17:59:34 2013
 81.48% done, estimate finish Fri Mar  1 17:59:34 2013
 83.47% done, estimate finish Fri Mar  1 17:59:35 2013
 85.46% done, estimate finish Fri Mar  1 17:59:35 2013
 87.45% done, estimate finish Fri Mar  1 17:59:34 2013
 89.43% done, estimate finish Fri Mar  1 17:59:35 2013
 91.42% done, estimate finish Fri Mar  1 17:59:35 2013
 93.40% done, estimate finish Fri Mar  1 17:59:35 2013
 95.40% done, estimate finish Fri Mar  1 17:59:35 2013
 97.38% done, estimate finish Fri Mar  1 17:59:35 2013
 99.37% done, estimate finish Fri Mar  1 17:59:36 2013
Total translation table size: 2048
Total rockridge attributes bytes: 846
Total directory bytes: 4096
Path table size(bytes): 40
Max brk space used f000
251599 extents written (491 MB)
=== Step 5: Combine LIF volume and media image ===
+ /opt/ignite/lbin/instl_combine -C /var/opt/ignite/bryan/image.iso
El Torito offset for LIF volume is: 0x50e800
Adjusting LIF file: ISL (Old iplstart: 4096; New iplstart: 5306368)
Adjusting LIF file: AUTO
Adjusting LIF file: INDEX
Adjusting LIF file: CONFIG
Adjusting LIF file: HPUX
Adjusting LIF file: FWWKAR6
Adjusting LIF file: FWWKAR7
Adjusting LIF file: FWWKAR8
Adjusting LIF file: WINSTALL
Adjusting LIF file: WINSTALLFS
Adjusting LIF file: IINSTALL
Adjusting LIF file: IINSTALLFS
Adjusting LIF file: INSTCMDS
Adjusting LIF file: SYSCMDS
Adjusting LIF file: INSTCMDSIA
Adjusting LIF file: SYSCMDSIA
Adjusting LIF file: SCRIPTS
Adjusting LIF file: PAD
=== Step 6: Write image file to tape/CD/DVD media ===
+ /opt/ignite/lbin/growisofs -Z /dev/rdsk/c0t0d0=/var/opt/ignite/bryan/image.iso
:-( "/dev/rdsk/c0t0d0=/var/opt/ignite/bryan/image.iso": unexpected errno:No such file or directory
+ Error 83 /opt/ignite/lbin/growisofs failed.
/opt/ignite/data/scripts/examples/make_media_install: ERROR: /opt/ignite/lbin/growisofs failed.
# cd /var/opt/ignite/bryan
# ls -l
total 1006414
drwxr-xr-x   3 root       sys             96 Mar  1 17:59 .
drwxr-xr-x  15 root       sys           1024 Mar  1 17:57 ..
drwxr-xr-x   2 root       sys             96 Mar  1 17:57 cfgs
-rw-r--r--   1 root       sys        515274752 Mar  1 17:59 image.iso

This is the image.iso file you will need.