Topics: HMC, System Admin

Inaccessible vterm on HMC?

It may happen that a virtual terminal (vterm) from an HMC GUI only showes a black screen, even though the Lpar is running perfectly. Here's a solution to this problem:

  • Login to the HMC using ssh as hscroot.
  • Run lssscfg -R sys to determine the machine name of your lpar on the HMC.
  • Run mkvterm -m [machine-name] -p [partition-name].
  • You can end this session by typing "~." or "~~." (don't overlook the "dot" here!).
  • Now go back to your HMC gui via WebBased System Manager and start-up a new vterm. It works again!

Topics: AIX, System Admin

Permanently change hostname

Permanently change hostname for inet0 device in the ODM by choosing one of the following:

Command line method:

# chdev -l inet0 -a hostname=[newhostname]
SMIT fastpath method:
# smitty hostname
Change the name of the node which changes the uname process by choosing one of the following:

Command line method:
# uname -S [newhostname]
Or run the following script:
# /etc/rc.net
Change the hostname on the current running system:
# hostname [newhostname]
Change the /etc/hosts file to reflect the new hostname. Change DNS name server, if applicable.

Topics: AIX, Storage, System Admin

Mounting a Windows share on an AIX system

There is a way to mount a share from a windows system as an NFS filesystem in AIX:

  1. Install the CIFS software on the AIX server (this is part of AIX itself: bos.cifs_fs).
  2. Create a folder on the windows machine, e.g. D:\share.
  3. Create a local user, e.g. "share" (user IDs from Active Directory can not be used): Settings -> Control Panel -> User Accounts -> Advanced tab -> Advanced button -> Select Users -> Right click in right window and select "New User" -> Enter User-name, password twice, deselect "User must change password at next logon" and click on create and close and ok.
  4. Make sure the folder on the D: drive (in this case "share") is shared and give the share a name (we'll use "share" again as name in this example) and give "full control" permissions to "Everyone".
  5. Create a mountpoint on the AIX machine to mount the windows share on, e.g. /mnt/share.
  6. Type on the AIX server as user root:
    # mount -v cifs -n hostname/share/password -o uid=201,fmode=750 /share /mnt/share
  7. You're done!

Topics: AIX, System Admin

Switching between 32bit and 64bit

Before switching to 64bit mode, make sure the hardware supports it.

To verify what is running and what the hardware can support, run the following as root:

# echo "Hardware:\t`bootinfo -y` bits capable"
Hardware: 64 bits capable
# echo "Running:\t`bootinfo -K` bits mode"
Running: 32 bits mode
# ls -l /unix /usr/lib/boot/unix
lrwxrwxrwx 1 root system 21 Aug 15 2006 /unix -> /usr/lib/boot/unix_mp
lrwxrwxrwx 1 root system 21 Aug 15 2006 /usr/lib/boot/unix -> /usr/lib/boot/unix_mp
To switch from 32-bit mode to 64-bit mode run the following commands, in the given order:
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -Fr
To switch from 64-bit mode to 32-bit mode run the following commands, in the given order:
# ln -sf /usr/lib/boot/unix_mp /unix
# ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -Fr

Topics: AIX, System Admin

Bootinfo vs Getconf

The command /usr/sbin/bootinfo has traditionally been used to find out information regarding system boot devices, kernel versions, and disk sizes. This command has been depricated in favor of the command /usr/bin/getconf. The bootinfo man page has been removed, and the command is only used in AIX by the booting and software installation utilities. It should not be used in customer-created shell scripts or run by hand.

The getconf command will report much of the same information that bootinfo will:

What was the device the system was last booted from?

# getconf BOOT_DEVICE
hdisk0
What size is a particular disk in the system?
# getconf DISK_SIZE /dev/hdisk0
10240
What partition size is being used on a disk in the system?
# getconf DISK_PARTITION /dev/hdisk0
16
Is the machine capable of running a 64-bit kernel?
$ getconf HARDWARE_BITMODE
64
Is the system currently running a 64-bit or 32-bit kernel?
# getconf KERNEL_BITMODE
64
How much real memory does the system have?
# getconf REAL_MEMORY
524288

Topics: PowerHA / HACMP, System Admin

Synchronizing 2 HACMP nodes

In order to keep users and all their related settings and crontab files synchronized, here's a script that you can use to do this for you:

sync.ksh

Topics: AIX, Networking, PowerHA / HACMP

Using an alternative MAC address

HACMP is capable of using an alternative MAC address in combination with its service address. So, how do you set this MAC address without HACMP, just using the command line? (Could come in handy, in case you wish to configure the service address on a system, without having to start HACMP).

# ifconfig enX down
# ifconfig enX detach
# chdev -l entX -a use_alt_addr=yes
# chdev -l entX -a alt_addr=0x00xxxxxxxxxx
# ifconfig enX xxx.xxx.xxx.xxx
# ifconfig enX up
And if you wish to remove it again:
# ifconfig enX down
# ifconfig enX detach
# chdev -l entX -a use_alt_addr=no
# chdev -l entX -a alt_addr=0x00000000000

Topics: AIX, Red Hat / Linux, System Admin

Change the PuTTY title

When you have a lot of Putty screens, or if you frequently login to a host through a jump server, it's very easy to set the title of the Putty window, for exmaple to the hostname of the server you're currently logged into. This way, you'll easily recognize each telnet screen, and avoid entering -possibly destructive- commands in the wrong window:

echo "\033]0;`hostname`\007"
For example, you can add this line to /etc/profile, and have the hostname of the PuTTY title set automatically.

Topics: AIX, Security, System Admin

Password-less SSH Login

On occasion I have the need to establish trust relationships between Unix boxes so that I can script file transfers. In short, here's how you leverage SSH to do that. Using the example of trying to connect from server "a" to get a file on "b" follow this example:

  • Connect to "a".
  • Type: ssh-keygen -t rsa
  • The default directory for keyfiles will be ~/.ssh/ (if you do not want to be prompted, leave passphrase blank).
  • Copy the contents of .ssh/id_rsa.pub (there should only be one line).
  • Place this line on "b", in ~/.ssh/authorized_keys.
That's it, you should now be able to ssh/sftp/scp from a to b without being prompted for a password!

Topics: AIX, Installation, System Admin

Creating a bootable AIX DVD

This is a short procedure how to creat an AIX DVD from a base set of 8 AIX 5.3 CD's:

  1. Copy all CD's using "cp -hRp" to a directory, start with the last CD and work towards the first one. You can do this on either an AIX or a Linux system.
  2. Check that <directory>/installp/ppc contails all install images.
  3. If not already, remove <directory>/usr/sys/inst.images. This directory also might contain all installation images.
  4. Create a link <directory>/usr/sys/inst.images pointing to <directory>/installp/ppc.
  5. Find all .toc files in the directory structure and, if necessary, change all vol%# entries to vol%1 (There should be at least 2 .toc files that need these updates). You have to change vol%2 to vol%1, vol%3 to vol%1, etcetera, up till vol%8.
  6. Create an ISO image with RockRidge extentions:
    # mkisofs -R -o  
    
Now you've created an ISO image that you can burn to a DVD.

Some specific information on burning this ISO image on AIX to a DVD-RAM:

Burning a DVD-RAM is somewhat more difficult than burning a CD. First, it depends if you have a slim-line DVD-RAM drive in a Power5 system or a regular DVD-RAM drive in Power4 systems (not slimline).

Use DLPAR to move the required SCSI controller to a LPAR, in order to be able to use the DVD-RAM drive.

After the DLPAR action of the required SCSI controller is complete, execute: cfgmgr.

After the configuration manager has run, you will end up with either 1 or 2 DVD drives (depending on the actual drives in the hardware frame):
# lsdev -Cc cdrom
cd0 Available 3F-09-00-0,0 SCSI DVD-RAM Drive
cd1 Available 3F-09-00-5,0 16 Bit LVD SCSI DVD-ROM Drive
As you can see, the first is the DVD-RAM, the second is a DVD-ROM. Therefor, we will use the first one (in this sample).

Place a DVD-RAM single sided 4.7 GB Type II disc (partnumber 19P0862) in the drive. DO NOT USE ANY OTHER TYPE OF DVD-RAM DISCS. OTHER TYPE OF DISCS ARE NOT SUPPORTED BY IBM.

In case you have a POWER4 system:

Be sure to use a use the case of the DVD-RAM in order to burn the DVD. DVD-RAM drives in Power4 systems will NOT burn if you removed the DVD-RAM from its case.

Also, be sure to have the latest firmware level on the DVD-RAM drive (see website http://www14.software.ibm.com/webapp/set2/firmware for the correct level of the firmware for your drive). Without this firmware level these DVD-RAM drives are unable to burn Type II DVD-RAM discs. Using lscfg -vl cd0 you can check the firmware level:
# lscfg -vl cd0
cd0  U1.9-P2-I1/Z2-A0  SCSI DVD-RAM Drive (4700 MB)
        Manufacturer................IBM
        Machine Type and Model......DVRM00203
        ROS Level and ID............A132
        Device Specific.(Z0)........058002028F000010
        Part Number.................04N5272
        EC Level....................F74471
        FRU Number..................04N5967
The firmware level of this DVD-RAM drive is "A132". This level is too low in order to be able to burn Type II discs. Check the website for the latest level. The description on this webpage on how to install the DVD-RAM firmware was found to be inaccurate.

Install firmware as follows:

Download the firmware file and place it in /tmp on the server. You will get a filename with a "rpm" extension. Run:
# rpm -ihv --ignoreos <filename>
Example:
# rpm -ihv --ignoreos /tmp/ibm-scsi-dvdram.dvrm00203-A151.rpm
ibm-scsi-dvdram.dvrm00203  #############################
(Beware of the double dash before "ignoreos"!!). This command will place the microcode in /etc/microcode.

Run:
# diag -d cd0 -c -T "download -s /etc/microcode -f"
This will install the firmware. Use the correct DVD-RAM drive (in this case cd0) to install the firmware!!
# diag -d cd0 -c -T "download -s /etc/microcode -f"
Installation of the microcode has completed successfully.
The current microcode for cd0 is IBM-DVRM00203.A151.
Please run diagnostics on the device to ensure that it is
functioning properly.
Use the following command to burn the DVD-RAM:
# /usr/sbin/burn_cd -d /dev/cd0 /install/aix53ml4dvd.iso
Burning a DVD-RAM can take a long time. Variable burn times from 1 to 7 hours were seen!!! A DVD-RAM made in a slim-line DVD drive on a Power5 system can be read in a regular DVD drive on a Power4 system, if the latest firmware is installed on the DVD drive.

On a Linux system you can use a tool like K3B to write the ISO image to a regular DVD+R disc.

Number of results found: 469.
Displaying results: 261 - 270.