To use a DVD-RAM for writing and reading like a file system, use the following commands. This will work only at AIX 5.2 and above:
- Put a DVD-RAM into the drive
# udfcreate -d /dev/cd0
- Mount the DVD-RAM:
# mount -V udfs /dev/cd0 /mnt
If you get an error, ensure /etc/vfs contains this line (and retry the mount command after validating):udfs 34 /sbin/helpers/udfmnthelp
Topics: AIX, Backup & restore, System Admin↑
DVD-RAM Backup
You can use a DVD-RAM to create a system backup. To do so, enter:
# smitty mkdvdThis works in AIX 5.2 and above.
Topics: AIX, System Admin↑
Korn Shell history
To retrieve a list of all recent commands:
# history -100This shows you the last 100 entries.
Topics: AIX, System Admin↑
Log file rotation script
A little script to rotate a log while not upsetting the process which is logging to the file. This script will copy and compress the log file, and then zero the log file out. Then the script will search for older log files and remove them after +3 days since last modification.
DATE=`date +%d%h-%I%p`
BASE_DIR='/var'
if [ -f $BASE_DIR/logname.log ]; then
cp $BASE_DIR/logname.log $BASE_DIR/logname.log.$DATE
> $BASE_DIR/logname.log
compress $BASE_DIR/logname.log.$DATE
fi
find $BASE_DIR -name 'logname.log.*' -a -mtime +3 -exec rm {} \;
To find the status of the batteries of an SSA adapter, enter as root:
# ssa_fw_status -a ssaXX is the number of your adapter, for example:
# ssa_fw_status -a ssa0After installing a new battery, enter the following command:
Fast write cache size: 32
Expected battery life: 22000
Powered on hours: 20706
Battery state: Active
# ssa_format - l ssaX - bThis will reset the lifetime counter.
Topics: AIX, System Admin↑
Fast IPL
Using FAST IPL only works on some RS6000 systems, like SP's or J/G/R30/40's.
To configure FAST IPL:
# mpcfg -cf 11 1Check current configuration:
# mpcfg -dfIf you can only use a terminal to configure the Fast IPL:
Put the key into service mode, press [ENTER] on the keyboard. Then type: sbb. Using the menu you can configure Fast IPL. Then reboot and switch the key back to Normal.
Topics: AIX, Security, System Admin↑
HOWTO: set up ssh keys
First, install OpenSSH and OpenSSL on two UNIX servers, serverA and serverB. This works best using DSA keys and SSH2 by default as far as I can tell. All the other HOWTOs I've seen seem to deal with RSA keys and SSH1, and the instructions not surprisingly fail to work with SSH2.
On each server type ssh someserver.example.com and make a connection with your regular password. This will create a .ssh dir in your home directory with the proper permissions. On your primary server where you want your secret keys to live (let's say serverA), type:
# ssh-keygen -t dsaThis will prompt you for a secret passphrase. If this is your primary identity key, use an empty passphrase (which is not secure, but the easiest to work with). If this works right, you will get two files called id_dsa and id_dsa.pub in your .ssh dir.
Copy the id_dsa.pub file to the other host's .ssh dir with the name authorized_keys2:
# scp ~/.ssh/id_dsa.pub serverB:.ssh/authorized_keys2Now serverB is ready to accept your ssh key.
For a test, type:
# ssh serverBThis should let you in without typing a password or passphrase. Hooray! You can ssh and scp all you want and not have to type any password or passphrase.
How to copy a filesystem from one server to another:
Make sure you can execute a remote shell on the target host (by adding an entry of the source host in the /.rhosts file). Login to the source system as root and enter:
# (cd LOCAL_MOUNTPOINT && tar cpvBf - . ) | rsh REMOTEHOST 'cd REMOTE_MOUNTPOINT && tar xpvBf -'For ssh, use the following command:
# tar -cf - myfiles | ssh user@host "umask 000 ; cat | tar -xpf -"You might also have run into the problem that, when FTP'ing CD software on a Windows PC to a remote AIX system, files with lowercase names suddenly change to uppercase file names. This is how to copy the complete contents of a CD on a Red Hat Linux system to a remote AIX system as a tar file:
- Login as root on the Linux system.
- Mount the CD-ROM:
# mount /mnt/cdrom # cd /mnt/cdrom
- Tar the contents:
# tar -cvf - . | ssh userid@hostname "cd /path/to/where/you/want/it/on/the/target/system ; cat > filename.tar"
- Unmount the CD-ROM:
# cd / # umount /mnt/cdrom
AIX is short for Advanced Interactive eXecutive.
AIX is the UNIX operating system from IBM for RS/6000, pSeries and the latest Power systems. Currently, it is called "System P". IBM is nowadays the largest UNIX hardware vendor worldwide. AIX and RS/6000 was released on the 14th of February, 1990 in London.
Currently, the latest release of AIX is version 6.1. Also AIX 5.3 exists and is still supported by IBM. Older versions (e.g. 3.2.5, 4.3.3., 5.1 and 5.2) have reached end-of-program services and thus are no longer supported by IBM.
AIX supports Logical Partioning (short: LPAR). With LPAR you can create mulitple system environments on a single machine, thus sharing the processor and memory resources of a single machine by several operating system
instances. From AIX 5.2 on, AIX supports DLPAR, Dynamic Logical Partitioning, which enables administrators to add, remove or move system resouces such as memory, adapters and CPU between partitions without the need to reboot each partion. From AIX 5.3, AIX supports micro-partitioning.
With LPAR, a single CPU can only be used by a single Operating System instance. With micro-partitioning, a CPU can be shared by up to 10 operating system instances. From AIX 5.3 also the sharing of disk and network resources by several operating system instances is supported. Later versions of AIX and Power hardware now also include the ability to share I/O amongst several operating system images, through the use of a Virtual I/O server (VIO).
IBM used to supply Maintenance Levels for AIX. Nowadays, they supply Technology Levels, one in February and one in July each year.
A "how-to" restore a mksysb through NIM:
- Create a mksysb resource in NIM: Logon to the NIM server as user root. Run smitty nim, Perform NIM Administration Tasks, Manage resources, Define a resource, select mksysb, type name mksysb_
, enter "master" as Server of Resource, enter the full path to the mksysb file at Location of Resource: e.g. /backup/hostname.image. - Add the mksysb resource to the defined machine in NIM, together with the original SPOT and LPP source of the host: Run: smitty nim, Perform NIM Administration Tasks, Manage Machines, Manage Network Install Resource Allocation, Allocate Network Install Resources, select the machine, select the mksysb resource defined in the previous step, along with the correct SPOT and LPP_SOURCE of the oslevel of the system.
- Do a perform operation on the machine in NIM and set it to mksysb: Run smitty nim, Perform NIM Administration Tasks, Manage Machines, Perform Operations on Machines, select the machine, select bos_inst, set the Source for BOS Runtime Files to mksysb, set Remain NIM client after install to no, set Initiate Boot Operation on Client to no, set Accept new license agreements to yes.
- Start up the system in SMS mode and boot from the NIM server, using a virtual terminal on the HMC. Select the disks to install to. Make sure that you set import user volume groups to "yes". Restore the system.
# smitty nim_bosinst
Displaying results: 291 - 300.


