Topics: AIX, Performance, Storage, System Admin

Creating a large file

When you wish to create a very large file for test purposes, try this command:

# dd if=/dev/zero bs=1024 count=2097152 of=./test.large.file
This wil create a file consisting of 2097152 blocks of 1024 bytes, which is 2GB. You can change the count value to anything you like.

Be aware of the fact, that if you wish to create files larger than 2GB, that your file system needs to be created as a "large file enabled file system", otherwise the upper file size limit is 2GB (under JFS; under JFS2 the upper limit is 64GB). Also check the ulimit values of the user-id you use to create the large file: set the file limit to -1, which is unlimited. Usually, the file limit is default set to 2097151 in /etc/security/limits, which stands for 2097151 blocks of 512 bytes = 1GB.

Another way to create a large file is:
# /usr/sbin/lmktemp ./test.large.file 2147483648
This will create a file of 2147483648 bytes (which is 1024 * 2097152 = 2GB).

You can use this large file for adapter throughput testing purposes:

Write large sequential I/O test:
# cd /BIG
# time /usr/sbin/lmktemp 2GBtestfile 2147483648
Divide 2048/#seconds for MB/sec write speed.

Read large sequential I/O test:
# umount /BIG
(This will flush file from memory)
# mount /BIG
# time cp 2GBtestfile /dev/null
Divide 2048/#seconds for MB/sec read speed.

Tip: Run nmon (select a for adapter) in another window. You will see the throughput for each adapter.

More information on JFS and JFS2 can be found here.

Topics: AIX, Networking, System Admin

Interface down from boot

If you wish to disable a network interface permanently, avoiding NETWORK DOWN errors in the error report:

# chdev -l en0 -a state=down -P
This command will permanently bring down the en0 interface (permanently means after reboot).

Topics: AIX, Backup & restore, System Admin

Restoring a mksysb of a mirrored rootvg to a non-mirrored rootvg

If you've created a mksysb of a mirrored rootvg and you wish to restore it to a system with only 1 disk in the rootvg, you can go about it as follows:

Create a new /image.data file, run:

# mkszfile -m
Change the image.data file:
# vi /image.data
In each lv_data stanza of this file, change the values of the COPIES= line by one-half (i.e. copies = 2, change to copies = 1). Also change the PPs to match the LPs as well.

Create a new mksysb, utilizing the /image.data file:
# mksysb /dev/rmt0
(Do not use smit and do not run with the -i flag, both will generate a new image.data file).

Use this mksysb to restore your system on another box without mirroring.

Topics: AIX, System Admin

Copying a logical volume

For copying a logical volume, the cplv command can be used. Using the -v flag, you can enter the name of the volume group you wish to copy to.

Once the logical volume has been copied, the trick is to get the file system in it back online:

Copy the stanza of the file system in the logical volume you copied to a new stanza in /etc/filesystems. Modify this new stanza; enter the correct jfs log, mount point and logical volume name. After this, do a fsck of your new mount point. Make sure your new mount point exists. After the fsck, you can mount the file system.

Topics: AIX, HMC, System Admin

HMC Access & Security Issues

As of Hardware Management Console (HMC) Release 3, Version 2.3, the rexec command is no longer available on the HMC. Use ssh command instead. From Version 2.5, users are required to enter a valid HMC user id/password when downloading the WebSM client from the HMC. The URL for the WebSM client is: http://[HMC fully qualified domain name]/remote_client.html.

Standard users receive the restriced shell via a set -r in .mysshrc when logging in. Comment the set -r command in /opt/hsc/data/ssh/hmcsshrc to get rid of the restricted shell for your users (it gets copied to $HOME/.mysshrc). For more information on commands that can be used in restriced shell on the HMC, go to HMC Power 4 Hints & Tips.

A special hscpe user ID can be created which has unrestricted shell access via the pesh command. Use lshmc -v to determine the serial number of the HMC (after *SE). Then call IBM support and request for the password of the hscpe user for the pesh command. IBM is able to generate a password for the hscpe user for one day.

Topics: AIX, System Admin

Creating graphs from NMON

Here's how: (This has been tested this with Nmon version 9f, which you can download here):

  • Run nmon -f for a while. This will create nmon output files *.nmon in your current directory.
  • Make sure you've downloaded rrdtool.
  • Install rrdtool by unpacking it in /usr/local/bin.
  • Make sure directory /usr/local/bin is in your $PATH:
    # export PATH="$PATH:/usr/local/bin"
  • Create a directory for the output of the graphs:
    # mkdir output
  • Run the nmon2rrdv9 tool (found in the nmon download):
    # ./nmon2rrdv9 -f [nmon output file] -d ./output -x
  • In directory output an index.html and several gif files will be created. By accessing index.html in a web browser, you can view the graphs. For a sample, click here. Tip: use nweb as your web browser.

Topics: AIX, System Admin

Find large files

How do you find really large files in a file system:

# find . -size +1024 -xdev -exec ls -l {} \;
The -xdev flag is used to only search within the same file system, instead of traversing the full directory tree. The amount specified (1024) is in blocks of 512 bytes. Adjust this value for the size of files you're looking for.

Topics: AIX, System Admin

TCPdump/IPtrace existing files?

When you receive an error like:

Do not specify an existing file
when using iptrace or tcpdump, then this is probably caused by a kernel extension already loaded.
To resolve this, run:
# iptrace -u
After this, the kernel externsion is removed and iptrace or tcpdump will work again.

Topics: AIX, System Admin

Logical versus Physical directory using PWD

The pwd command will show you default the logical directory (pwd -L = default), which means, if any symbolic links are included in the path, that is, what will be shown. To show you the actual physical directory, use the next undocumented feature:

# pwd -P

Topics: AIX, System Admin

Searching large amounts of files

Searching with grep in directories with large amounts of files, can get the following error:

The parameter list is too long
The workaround is as follows:
# ls | xargs grep "[search string]"
E.g.
# ls | xargs grep -i "error"

Number of results found: 469.
Displaying results: 311 - 320.