Translate

Tuesday 26 November 2013

Backing-up your VIOS server

The easiest way to backup your VIOS servers is to create an NFS mount-point on another machine and then mount it. e.g.

1. Create a new directory/mount-point:

# mkdir /backups
# chmod 0777 /backups

2. Create a public-share in "/etc/exports". (Note this is a quick and dirty method without security)

# cat > /etc/exports
/fixes -public,sec=sys:krb5p:krb5i:krb5:dh,rw

3. Export the filesystem

# exportfs -a
# lsnfsexp
/fixes -public,sec=sys:krb5p:krb5i:krb5:dh,rw

4. Login to your VIOS server as "padmin" and switch to root (You have to do that as “root” because “padmin” uses a restricted shell).

$ oem_setup_env
# mount server:/backups /mnt
# ^d

5. Start the backup. This example does not backup the media-library for quickness, and to save space, however there are many options available:

backupios -file {Directory} [-nosvg][-nomedialib]
       backupios -file {Filename} [-mksysb][-nopak][-nosvg][-nomedialib]
       backupios -tape Device [-blocks Number] [-nopak] [-verify] [-nosvg][-nomedialib]
       backupios -cd Device {-udf | -cdformat} [-accept] [-nosvg][-nomedialib]

$ backupios -file /mnt/backupios.mksysb -mksysb -nomedialib

Creating /mnt/backupios.mksysb
Backup in progress.  This command can take a considerable amount of time
to complete, please be patient...

Creating information file (/image.data) for rootvg.

Creating list of files to back up.

Backing up 107493 files.....................

107493 of 107493 files (100%)
0512-038 savevg: Backup Completed Successfully.

6. Once the backup has completed switch back to root and un-mount "/mnt"

$ oem_setup_env
# umount /mnt

7. Login to the backup server host and check the backup file as follows:

# lsmksysb -sf ./backupios.mksysb | head
New volume on ./imx02.backupios:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Tue Nov 26 08:46:01 CET 2013
Files are backed up by name.
The user is root.
        5576 ./bosinst.data
          11 ./tmp/vgdata/rootvg/image.info
       12736 ./image.data
      316958 ./tmp/vgdata/rootvg/backup.data
           0 ./usr
           0 ./usr/X11R6
          19 ./usr/X11R6/lib
           8 ./usr/adm
           0 ./usr/aix
           0 ./usr/aix/bin





Wednesday 20 November 2013

Undeleting files

Have you ever accidentally deleted a file and wished you had a "Recycle Bin" like in Windows? Well now you can!



j2restore is an IBM DeveloperWorks project that offers a possibility to un-delete files:

or

wget https://www.ibm.com/developerworks/community/blogs/aixworld/resource/j2restorev1.51.zip --no-check-certificate

The only two small catches are that you have to register the tool and purchase a licence, and the filesystem has to be un-mounted during the recovery.

Installing:

unzip ./j2restorev1.51.zip
Archive:  ./j2restorev1.51.zip
  inflating: j2restorelist53
  inflating: j2restorelist61
  inflating: j2restoredemo53
  inflating: j2restoredemo61

chmod 0750 j*

Running the tool:
 
./j2restorelist61
j2restorelist v1.51, Author: Wu Jian Jun <wujianjun-zju@163.com>
Usage: j2restorelist [--fast | -f] [--partial | -p : no|yes|all] <file system>

To get full functional j2restore, pls send following machine ID to <wujianjun-zju@163.com>:
ODAwMDBFRUE4NjYwMDAwMTAwQzlCOEZBNEMwMDAwMDAwMDAwNGU4ZGY0ODA$ IBM,02659B......

umount /test

./j2restoredemo61 -r /test
output file: /var/j2restore/report.log
report only flag: on (just report, no restore action)
fast flag: off (block scan)
partial flag: no (only scan complete file)
Scaning directories...
100% finished
Scaning inodes...
 85.71% finished

Tuesday 19 November 2013

Releasing SAN data locks

Normally when a server opens a LUN it sets a lock-reserve, and it is released again when the servers is shutdown, or failed-over in a cluster. If your server crashes, or there is a problem with your SAN link this flag may have to be cleared manually.

Checking the status of your SAN flags:

# devrsrv -c query -l hdisk14

Device Name                     :  hdisk14
Device Open On Current Host?    :  NO
ODM Reservation Policy          :  NO RESERVE
Device Reservation State        :  NO RESERVE
Device Reservation State Information


To check all your LUNs:

# lspv | awk '{print $1}' | while read D
> do
> devrsrv -c query -l $D
> done


The above example shows a healthy LUN that is not in use. If it is active you will see:

Device Open On Current Host?    :  YES

If a host has crashed, or there is a faulty lock you may see:

Device Name                     :  hdisk10
Device Open On Current Host?    :  NO
ODM Reservation Policy          :  NO RESERVE
Device Reservation State        :  NO RESERVE
Already reserved through SINGLE PATH by other host
Device Reservation State Information

In this case you need to forceably break the lock as follows:

#  devrsrv -c release -l hdisk10
or
# devrsrv -f -l hdisk10

Once the lock has been released you should be able to access the LUN.

If this is a VIOS server ensure that the attribute is permanently set as follows:

$ chdev -dev hdisk11 -attr reserve_policy=no_reserve -perm

The shutdown and power-off your clients, and then do the same with the VIOS, and restart the clients. Powering-off ensures your partition profiles are correct, and also forces a log-out/in of the SAN/Switch.


Wednesday 13 November 2013

Tuesday 12 November 2013

Install Graphviz on AIX 6.1

The Graphviz utility enables you to convert tabular data into pictures. Don't worry if you IBM system does not have a graphics card because you can generate the files and view them on your PC.

wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-doc-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-gd-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-graphs-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-lua-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-perl-2.26.3-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/graphviz/graphviz-python-2.26.3-2.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/python/python-2.7.5-1.aix6.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/python/python-libs-2.7.5-1.aix6.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/python/tkinter-2.7.5-1.aix6.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/swig/swig-1.3.40-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/db4/db4-4.7.25-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/tk/tk-8.5.14-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/tcl/tcl-8.5.14-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libXft/libXft-2.3.1-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/expat/expat-2.1.0-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/expat/expat-devel-2.1.0-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/gdbm/gdbm-1.10-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/openssl/openssl-1.0.1e-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/openssl/openssl-devel-1.0.1e-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/openssl/openssl-doc-1.0.1e-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/gts/gts-0.7.6-1.aix5.1.ppc.rpm

rpm -Uvh ./swig-1.3.40-1.aix5.1.ppc.rpm
rpm -Uvh ./db4-4.7.25-2.aix5.1.ppc.rpm
rpm -Uvh ./tcl-8.5.14-1.aix5.1.ppc.rpm
rpm -Uvh ./libXft-2.3.1-1.aix5.1.ppc.rpm
rpm -Uvh ./tk-8.5.14-1.aix5.1.ppc.rpm
rpm -Uvh ./expat-2.1.0-1.aix5.1.ppc.rpm ./expat-devel-2.1.0-1.aix5.1.ppc.rpm
rpm -Uvh ./gdbm-1.10-1.aix5.1.ppc.rpm
rpm -Uvh ./openssl*rpm
rpm -Uvh ./tkinter-2.7.5-1.aix6.1.ppc.rpm ./pyth*
rpm -Uvh ./gts-0.7.6-1.aix5.1.ppc.rpm
rpm -Uvh ./graphviz*rpm --nodeps

Monday 11 November 2013

AIX editions

If you are running AIX 6.1 or above you should have set the "edition" type when you installed it. The default seems to be "Express" which restricts the size of memory and number of procs in a partition.

There are three editions for AIX 6.1 and 7.1:

Express which is the basic/entry level and was designed to make available a low-cost version of the OS, and is generally constrained to a maximum of 4 cores and 8 GB of memory per core in a single partition, and there are also limits on cluster-aware-AIX in AIX 7.1.

Standard edition is the one IBM expects most people to use, and basically is only limited by the hardware IBM offers you.

Enterprise which includes many extra tools for clustering and monitoring.

To check which version you are running:


# chedition -l
standard

To switch editions:

chedition: Change to express edition
      chedition -x [-d Device [-p]]

chedition: Change to standard edition
      chedition -s [-d Device [-p]]

chedition: Change to enterprise edition
      chedition -e [-d Device [-p]]

The command can be run with a reboot, however it is unclear as to how this affects AIX's actual usage of the system's resources. IBM has also recently announced that a lot of the restriction imposed by the Express edition will now only apply to compute-nodes in their Pure systems.








Friday 8 November 2013

Installing gnuplot on AIX 6.1

Installing RPMs on AIX is generally a nightmare due to the sheer number of dependencies and the lack of a tool such as YUM, however here is how I did it. My test system is directly connected to the Internet and so I downloaded the packages using WGET. If your system is not connected you will need to use a laptop (or similar) to download the software and then transfer it to the AIX system.

It is important to remember that RPM versions are changing all the time so the links may need to be modified/updated.

1. Installing the RPMs


wget http://www.oss4aix.org/download/RPMS/gnuplot/gnuplot-4.6.4-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/glib2/glib2-2.34.3-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libffi/libffi-3.0.13-1.aix5.1.ppc.rpm
rpm -Uvh ./glib2-2.34.3-1.aix5.1.ppc.rpm ./libffi-3.0.13-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/pango/pango-1.24.5-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libthai/libthai-0.1.18-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libdatrie/libdatrie-0.2.4-1.aix5.1.ppc.rpm
rpm -Uvh ./libthai-0.1.18-1.aix5.1.ppc.rpm ./libdatrie-0.2.4-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libXrender/libXrender-0.9.8-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/renderproto/renderproto-0.11.1-1.aix5.1.ppc.rpm
rpm -Uvh ./libXrender-0.9.8-1.aix5.1.ppc.rpm --force --nodeps (Had to do this as my AIX-rpm was too new)
rpm -Uvh ./pango-1.24.5-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/lzo/lzo-2.06-1.aix5.1.ppc.rpm
rpm -Uvh ./lzo-2.06-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/libXpm/libXpm-3.5.10-2.aix6.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/xorg-compat-aix/xorg-compat-aix-1.2-1.aix5.1.ppc.rpm
rpm -Uvh ./xorg-compat-aix-1.2-1.aix5.1.ppc.rpm ././libXpm-3.5.10-2.aix6.1.ppc.rpm --force

http://www.oss4aix.org/download/RPMS/lua/lua-5.2.2-1.aix5.1.ppc.rpm
rpm -Uvh ./lua-5.2.2-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/pixman/pixman-0.28.2-1.aix5.1.ppc.rpm
rpm -Uvh ./pixman-0.28.2-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/libxcb/libxcb-1.7-1.aix5.1.ppc.rpm
rpm -Uvh ./libxcb-1.7-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/librsvg2/librsvg2-2.34.2-1.aix5.1.ppc.rpm
rpm -Uvh ./librsvg2-2.34.2-1.aix5.1.ppc.rpm

http://www.oss4aix.org/download/RPMS/gtk2/gtk2-2.20.1-2.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/jasper/jasper-1.900.1-2.aix5.1.ppc.rpm
rpm -Uvh ./jasper-1.900.1-2.aix5.1.ppc.rpm

http://www.oss4aix.org/download/RPMS/libpng/libpng-1.6.6-1.aix5.1.ppc.rpm
rpm -Uvh ./libpng-1.6.6-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/atk/atk-1.32.0-1.aix5.1.ppc.rpm
rpm -Uvh ./atk-1.32.0-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/libtiff/libtiff-4.0.3-1.aix5.1.ppc.rpm
rpm -Uvh ./libtiff-4.0.3-1.aix5.1.ppc.rpm --nodeps

wget http://www.oss4aix.org/download/RPMS/librsvg2/librsvg2-2.34.2-1.aix5.1.ppc.rpm
wget http://www.oss4aix.org/download/RPMS/libart_lgpl/libart_lgpl-2.3.21-1.aix5.1.ppc.rpm
rpm -Uvh ./libart_lgpl-2.3.21-1.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/libcroco/libcroco-0.6.5-1.aix5.1.ppc.rpm
rpm -Uvh ./libcroco-0.6.5-1.aix5.1.ppc.rpm

rpm -Uvh ./gnuplot-4.6.4-1.aix5.1.ppc.rpm ./cairo-1.12.14-1.aix5.1.ppc.rpm ./librsvg2-2.34.2-1.aix5.1.ppc.rpm ./gtk2-2.20.1-2.aix5.1.ppc.rpm


2. Download the demo packages



wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.6.4/gnuplot-4.6.4.tar.gz

gzip -dc ./gnuplot-4.6.4.tar.gz | tar xvf -
cd gnuplot-4.6.4

3.   A quick test:

set your $DISPLAY variable and run: gnuplot
Enter the command "test" and this should open a new X-Window

4. Useful links


http://cairographics.org/

http://www.gnuplot.info/

Thursday 7 November 2013

Building Linux Clusters

This is an extremely interesting product that enables you to integrate IBM Power and Intel clouds:

xCAT Extreme Cloud Administration Toolkit

IBM and Social media

IBM has been very active lately with social media and now has a major presence on all the major networks:

Twitter
    @linux_at_ibm
    @ibmpowerlinux

Facebook (search for "Linux at IBM")

IBM PowerLinux™ Community Blog
IBM DeveloperWorks Blogs

There are also lots of useful phone Apps. Just go to your App Store and search on "IBM". One particular favourite of mine is the "IBM Flex System Manager".

Printer problems and fault finding

If you are having problems printing to a remote device/queue start by ensuring that you can ping the device, and that all the local hosts and DNS settings are correct. if the print still fails refer to the rembak man page as there are several useful options that can help you to debug the problem:

 rembak -S Server -P Queue [ -R ] [ -N  Filter] [ -L ] [ -p ] [ -q ] [-x ] [ -# JobNumber ] [ -u  UserName ] [ -X ] [ -o Option ] [ -T Timeout] [ -C] [ -D DebugOutputFile] [ File ... ]

Tuesday 5 November 2013

Printer accounting

A simple but seldom used function of process-accounting is the ability to track printer usage, an perhaps to (internally) charge. Individual printer usage can be logged and reports produced as follows:


1. Create a log file 
touch /var/log/printer.log

2. Add an entry to the print device stanza in "/etc/qdaemon"
acctfile = /var/log/printer.log

3. Restart the printer daemon
stopsrc -s qdaemon ; startsrc -s qdaemon

Now when a job is submitted it is added to the accounting file which can be read as follows:

# /usr/sbin/pac -Php_6030_pcl
  Login               pages/feet   runs               price
root                        1.00    1                USD .02

total                       1.00    1                USD .02

See the "pac" man page for charging options.