Posts Tagged ‘aix’

How to mount a windows share under AIX

Thursday, September 8th, 2011

To mount a windows share from an AIX server it’s needed the CIFS support to be installed.

If Your server /sbin/helpers directory contains a file called mount_cifs no problem

ls -l /sbin/helpers
total 488
-r-xr-xr-x    1 root     system        33198 Jul 13 2010  aufsmnthelp
drwxrwxr-x    2 root     system         4096 Apr 15 2010  jfs2
-r-xr-xr-x    1 root     system        23224 Jul 13 2010  mount_cifs
-r-xr-xr-x    1 root     system        35638 Jul 13 2010  nfsmnthelp
-r-xr-xr-x    1 bin      bin            6268 Dec 18 2009  udfmnthelp
-r-xr-xr-x    1 bin      bin          138292 Dec 18 2009  v3fshelper

Otherwise You need to install it.

Then You can try to mount the Windows share using the mount command, specifying the cifs filesystem, the node name/IP, username, password and so on…

mount -v cifs -n node/username/passw [-o options] /winshare /directory

e.g.

mount -v cifs -n 192.168.1.28/george/HareKrishna \
-o wrkgrp=BEATLES,fmode=755 \
IndiaPics /opt/holidays/meditation/india1967

compiling bacula-sd 2.4.4 on AIX

Tuesday, January 11th, 2011

Recently I compiled an old release of Bacula on an AIX 5.3 host (oslevel command shows “5.3.0.0” as output), using a gcc 3.3.2 version. My need was to make a bacula-sd binary file. To end my compilation I performed some quick and dirty hack.
First, I downloaded and installed the MySQL includes and client, as a prerequisite:

# rpm -Uvh MySQL-client-3.23.58-2.aix5.1.ppc.rpm MySQL-devel-3.23.58-2.aix5.1.ppc.rpm

after downloading the tar.gz file, I uncompressed and opened it in a temporary directory. Then I moved to the bacula-2.4.4 directory and run the configure command with several options:

./configure -prefix=/usr/local/bacula -enable-largefile -disable-libtool -with-pid-dir=/usr/local/bacula/var/run -with-subsys-dir=/usr/local/bacula/var/run/subsys –disable-conio –enable-build-stored –with-mysql

Then, I opened the Makefile to comment out the line with .PATH variable definition

#.PATH:         .

and I added some line to the ./src/bacula.h file before the pthread.h inclusion:

/* Beginning of the code added by hand */
#define __SIZEOF_PTHREAD_BARRIER_T 20
#define __SIZEOF_PTHREAD_BARRIERATTR_T 4

typedef volatile int pthread_spinlock_t;

typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIER_T];
long int __align;
} pthread_barrier_t;

typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
int __align;
} pthread_barrierattr_t;
/* end of the added code, next line was the original one */
#include <pthread.h>

in the file ./src/stored/stored.h I made me sure to include mtio.h in the right place:

//#ifdef HAVE_MTIO_H
//#include <mtio.h>
//#else
//# ifdef HAVE_SYS_MTIO_H
# include <sys/mtio.h>
//# else
//#   ifdef HAVE_SYS_TAPE_H
//#   include <sys/tape.h>
//#   endif
//# endif
//#endif

then in src./lib/bsys.c I commented out the initgroups definition:

/*
#ifdef HAVE_AIX_OS
extern “C” int initgroups(const char *,int);
#endif
*/

finally, as root, I commented out the line 104 of /usr/include/sys/mtio.h file (Yes, I know, It’s an ugly solution)

#ifndef _MTEXTEND_H
/*  #include <sys/mtextend.h> */   /* XXXXX commented in order to compile bacula */
#endif

After making all theese changes, I was able to end the bacula-sd (and other) part of bacula suite.
Before the installation, You may find useful to strip the binary files

# cd ./src/stored
# strip bacula-sd bscan btape bcopy bextract bls
# make install

At this point I tested my bacula-sd starting it in foreground, verbose and debug mode

# /usr/local/bacula/sbin/bacula-sd -v -f -d 516

and I started my backup test.

editing the AIX /var/adm/wtmp file

Monday, October 25th, 2010

I can’t see any useful reason, but if You like to modify the output of the “last” command on an AIX system, You can convert to an ASCII file the /var/adm/wtmp file, editing it and then rebuild it. E.g.

/usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/temp.file
vi /tmp/temp.file
/usr/sbin/acct/fwtmp -ic < /tmp/temp.file > /var/adm/wtmp
rm /tmp/temp.file

NFS mount from an AIX client (reprise)

Thursday, April 22nd, 2010

Today I needed to mount a linux nfs exported directory from a very old AIX server:

AIX prompt> uname -a
AIX matusalem 3 4 00202856E800

This time, I had to do an additional operation to my previous notes about nfs and AIX.
The mount command issued on the AIX matusalem client failed with the error

vmount: Not owner

and the linux server reported

Apr 22 12:21:03 linuxbox kernel: nfsd: request from insecure port (192.168.5.5:34506)!

in /var/log/messages file, where 192.168.5.5 is the old AIX IP address.
After adding the word “insecure” in the nfs option of my /etc/exports file in the linux server I was able to mount the nfs share.

/opt/share/dir 192.168.5.5(rw,sync,insecure)

NFS mount from an AIX client

Wednesday, August 26th, 2009

Today I had to mount a NFS linux machine (e.g. 192.168.33.33) from an AIX client.
So I noticed the “normal” mount command may not work:

# mount 192.168.33.33:/opt/something /home/guest/tmp
mount: 1831-008 giving up on:
192.168.33.33:/opt/something
vmount: Operation not permitted.

As reported by Doomlands of the Lunatics, apparently, AIX uses high ports to establish the connectivity to NFS Server, but Linux NFS Server requires low ports (below 1024). For this reason We have to tell AIX to use those reserved ports.

# nfso -o nfs_use_reserved_ports=1
Setting nfs_use_reserved_ports to 1

OK, now We can mount the directory on the Linux NFS server:

# mount 192.168.33.33:/opt/something /home/guest/tmp