How To:Install Amanda Server on AIX

From wiki.zmanda.com
Jump to navigation Jump to search

How to install amanda 2.5.0p2 on AIX 5.2

In this article is described how amanda server can be made to run using an old AIX 5.2 system and a non-IBM tape library.

Description of the system

IBM p-Server 630 (7028-6C4) with four cpu's/8 Gb memory

disks:

4*36 Gb internal scsi

12* 73 Gb 7133-D40 SSA disks

4 * 36 Gb 7133-D40 SSA disk


3 * 10/100 ethernetcards

1 * 10/100/1000 ethernet (5701)

1 * SSA card (4P with 128 Mb write cache)

HP Storageworks 1/8 Autoloader LTO2

Software

AIX 5.2 ML9 (5200-08)

Latest firmware upgrade for the hardware from IBM

amanda-2.5.0p2 (source)

mtx-1.3.11.tar.gz (source)

make-3.81.tar.gz (source)

gsc-1.1.tar.gz (source)

gcc.4.1.1.tar.Z (Precompiled set of binaries from UCLA AIX site)

no IBM xlC compiler

Getting amanda to work

In order to get amanda to work the following actions have to be taken:

0) Prerequisites

1) Install compiler

2) Install GNU make

3) Install GSC (generic scsi driver for AIX)

4) Install mtx for AIX

5) Connect the tapedrive

6) Test the tapedrive

7) Compile amanda

8) Configuration

Prerequisites

take care that /usr/local is sufficiently big (2 Gb).

PATH=/usr/local/bin:/usr/local/sbin:$PATH

Amanda amanda-2.5.0p2 is the most recent version that can be made to work on AIX. Never versions 2.5.1/2.5.2 do not pass the "configure", or strand on compilation errors. There seem to be issues with 32/64 bit, although this task may not be impossible, latest is that there is a conflict between definitions from /usr/include/stdio.h and the gnu compiler versions on 64-bit defines like fseek64/ftell64 etc.

Parameters for configure: ./configure --with-user=amanda --with-group=tapes --without-ipv6 --disable-shared --includedir=/usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include --oldincludedir=/usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include --disable-largefile --with-cflags=-DAIX_BACKUP

User settings for amanda User amanda should be member of group "system", otherwise the AIX backup command /usr/bin/backup -0uf - /dev/r<fs> will fail due to "permission denied" messages because /usr/bin/backup writes a lock in /etc/locks/fs directory.

Install compiler

Thx to UCLA there is a recent GNU compiler for AIX, version 4.1.1.

Download this, and install the binaries: cat gcc.4.1.1.tar.Z | uncompress | (cd / ; tar xvf -)


Install GNU make

This is necessary for mtx to compile, they use GNU make specific statements. Compiling and installation is straightforward.

Install GSC

This is necessary to get any non-IBM autoloader to work. AIX only seems to support autoloaders when TSM is bought.

HP does not provide AIX autoloader support for its autoloaders.

GSC was tested with the standard xlC compiler from IBM, in order to compile with gcc the makefile has to be adapted:

- CC = gcc

- LDFLAGS = -b"I:/lib/kernex.exp I:/lib/syscalls.exp" -lcsys -lsys

- install bos.adt.syscalls (for libcsys)

Compiling gsc

- type "make"

Follow instructions in the README provided with gsc source code.

Important note: cp gscdds.h /usr/include/sys (otherwise compilation of mtx will fail).

Surviving reboots with GSC

In my case the autoloader device gets into state "defined" after a reboot:

catfish# lsdev -Cc generic

gsc0 Defined 10-89-00-5,1 Feral Software Generic SCSI Release 1.1

The following statements activate the autoloader, and the original device name will be preserved: During system boot (inittab runstate 2) run following statements:

1) rmdev -l gsc0 -d

2) When the autoloader is connected to scsi adapter P and has scsi-id Y and LUN Z type:

3) catfish# mkdev -c generic -s scsi -t gsc -pscsiP -wY,Z

gsc0 Available

4) Ownerships device nodes (amanda, group tapes):

chown amanda:tapes /dev/rmt* /dev/gsc*

chmod 660 /dev/rmt* /dev/gsc*

5) Check with: lsdev -Cs scsi

gsc0 Available 10-89-00-5,1 Feral Software Generic SCSI Release 1.1

rmt0 Available 10-89-00-5,0 Other SCSI Tape Drive

Note: Amanda will need the non-rewinding device in its amanda.conf. On Aix this is /dev/rmtX.1, where X=the number of the drive listed in lsdev

GSC and Atape driver

The "tapeutil" program packaged with Atape does not work with GSC scsi autoloader devices.

All actions result in the same error message: Operation failed with errno 25: Not a typewriter

That is why installation of "mtx" program on AIX is necessary.

Install mtx for AIX

MTX should now compile straighforward, except that during "make install" a strip command fails, this is solved by editting the Makefile and changing the line starting with "install:" into:

install: $(BINS) #$(DBGS)

Then it installs (and runs) fine.

Configuration

In order to make amanda run properly, the following settings should be implemented:

1) Amanda should have group "system" on all AIX backup clients.

2) Run during system boot from inittab a /etc/rc.local containing following statements:

# Network tuning 1 Gbit

/usr/sbin/no -o thewall=1000000

/usr/sbin/no -o sb_max=1000000

/usr/sbin/no -o tcp_sendspace=800000

/usr/sbin/no -o tcp_recvspace=800000

/usr/sbin/no -o udp_sendspace=500000

/usr/sbin/no -o udp_recvspace=500000

/usr/sbin/no -o rfc1323=1

/usr/sbin/no -o tcp_keepcnt=16

/usr/sbin/no -r -o ipqmaxlen=1000


# Y is number of your tape device (lsdev -Cc tape)
# A=scsi-ID  of tapechanger 
# B = scsi-LUN of tapechanger
# Example: lsdev -Cs scsi
# gsc0   Available 1S-09-00-5,1  Feral Software Generic SCSI Release 1.
# shows that tapechanger has scsi-id=5, lun=1
# Basic checks can be done with "diag", task-selection/analyse SCSI bus

rmdev -l gscX -d

mkdev -c generic -s scsi -t gsc -pscsi1 -wA,B

chdev -l rmtY -a block_size=0 # Very important

# Correct ownership for tape devices

chown amanda:tapes /dev/rmt* /dev/gscX

chmod 660 /dev/rmt0 /dev/gscX


Why AIX

The procedure described here seems to be quite elaborate. Although the advantage of Linux on an Intel box are often mentioned, using an AIX box as amanda server has in some situations strong advantages:

1) Many organisations have a policy of only using commercial Unix versions.

2) Integrating amanda into the existing support organization is much easier when a platform is used fitting into existing system management practices.

3) p-Series machines are very good quality and seldom break.

4) Support of IBM is excellent, also on older machines. This applies to hardware, but also to AIX.

5) IBM has great internet support, also for older systems.

6) p-Series machines like p-Series 615/630/650 are fast, and can transport large amounts of data.

7) Using SSA or SCSI-320 disks as spool disk for amanda results in a backup server that can easy do 2TB in a single amdump run of 8 hrs if traffic is spread among multiple gigabit ethernet adapters. If a SAN is used it is not recommended to use storage of the same SAN box which serves the amanda clients, for amanda spooldisk.

In general using Open-Source software on a commercial Unix like AIX can be a good idea. In this case there never will be any discussion about the quality of the hardware and OS, and the same support procedures will apply for the amanda server as for the corporate database server. The sysadmin can in this case concentrate on support of amanda, and does not need to bother about low-level HW and SW support of the box itself.