UnixAdminsDiary

Tuesday, March 02, 2010

Switching hardware between AIX partitions

You know the problem: you have one of these black pSeries POWER-boxes running VIO as virtualisation management layer. So far, so good. But this box has only one optical drive and you have to switch it from one AIX LPAR to another. The (virtual) hardware switching with eg the VIO web interface is no problem, but how do I tell the LPARs this change?

It is done by using the device management tools.
Assume that machine A currently owns the CD drive cd0, and machine B wants to have it:
  1. umount /dev/cd0 on machine A
  2. deactivate the device on machine A: rmdev -l cd0
  3. or as alternative remove the device rmdev -dl cd0 , but be careful, because this removes also all device configurations (no problem for a CD drive, but not so good for eg a network interface card!)
  4. do the (virtual) hardware switch using VIO web interface or something similar
  5. activate the CD drive on machine B: cfgmgr (this runs the configuration manager, that automatically detects and configures the "new" hardware)
  6. now you can use the hardware on machine B - in our case we will mount the CD-ROM: mount -v cdrfs -o ro /dev/cd0 /mnt

How to change the keyboard setting under Solaris

Today I had the problem that I got my brand new Sun USB keyboard. But - it's a UK layout, and my old one was a german layout. So - how to change this?
Quite simple - the file /etc/default/kbd contains the keyboard setting that overrides the eeprom defaults during system start. The (usually last) line LAYOUT=UK-English defines the desired setting for me.

Step-by-step:
The command kbd -s lists all possible keymaps.
The command kbd -i changes the new setting to the one in /etc/default/kbd
The next reboot loads the new keymap into the kernel

As usual, man kbd tells you all the details ...

Friday, June 19, 2009

strace pendant for AIX

AIX provides an strace commando, but this has nothing to do with the strace someone may know from linux systems. But AIX also provides an commando that has similar functionality: truss

Tuesday, October 16, 2007

How to get a console during hp-ux startup

Sometimes a problem appears during the startup of hp-ux (eg network problems) and the startup process hangs (eg when trying to connect to NIS server or something else). A fix like temporary deactivation of NIS could be done easily - but how to get a login to do this?

Just press Crtl-Shift-\ (on US-keyboard, so this is: Crtl-|) and a login prompt will appear!

Monday, September 24, 2007

ssh_exchange_identification: Connection closed by remote host

This sometimes happens on my long-running RHEL4 server that has lot of ssh traffic. It happens unexpectedly, and no log entries are produced.
As mentioned in The Site With the Lamp, this seems to be a problem with too much (old?) ssh connections.

But the solution recommended there (waiting) is usually not meeting my needs, I need an immediate solution.
/etc/init.d/sshd restart does not work, but a simple
killall -9 sshd
followed by a
/etc/init.d/sshd start
saves the day!

Monday, June 05, 2006

Arg list too long on IRIX systems

A common problem: you are running a script or program on your IRIX machine, that automatically generates the command line call for another script or program - but the call fails with the following error message:

bad interpreter: Arg list too long

Ok, the cause is clear - the generated call exceeds the system's max args limit. Luckily, this can be fixed very easily on IRIX systems - as also explained at SGI Techpubs library.

First, lets have a look whats the actual limit. This can be examined using sysconf:

shell> sysconf | grep ARG_MAX
ARG_MAX 20480
...


Well, the actual (IRIX default) limit is about 20k for the max command line lenght, which is definitly not very much. Now we check whats the allowed maximum for the actual kernel. We open /var/sysgen/mtune/kernel with any ascii viewer and search for the definition of ncargs or we just use grep like this:

grep ncargs /var/sysgen/mtune/kernel
* ncargs is max # bytes of arguments passed during an exec(2)
ncargs 20480 5120 262144

There we can see that the legal range for ncargs is from 5120 to 262144, which seems to be the right value for us. IRIXs systune cat set this value during runtime:

systune -b ncargs 262144

After this (without logout, reboot or something else), the new value is active:

shell> sysconf | grep ARG_MAX
ARG_MAX 262144
...

Now our script should have plenty argument space to operate ...

Tuesday, May 02, 2006

Some X Clients work with ssh X forwarding, some not

It seems like a really strange issue: you connected to a unix machine (running opensshd) with ssh -X, you can run X clients like xterm there, but some applications fail to start with the following error message:

X11 connection rejected because of wrong authentication.
Unable to continue communications with the X display.
Please ensure that the X Server is still running, and the
connection to it is still valid.

But the solution is very simple: the client tries to connect localhost instead of the machine, for which the auth may not be set. OpenSSH has an server option to configure this behavoir. In sshd_config, change the (usually commented) line
#X11UseLocalhost yes
to
X11UseLocalhost no
and restart the sshd. Now this problem should not appear anymore.

Wednesday, June 08, 2005

What the hell are the Solaris slices

When I tried to get a dd-mirror of a complete disk running under Solaris, I had the problem how to find out how to do this with these strange solaris slices (that also always confuse me when I set up a Solaris machine). But the online Solaris documentation (docs.sun.com, very good, always worth the look) had the right answer:
slice 2:
refers to the entire disk, by convention. This slice is defined
automatically by the format utility and the Solaris installation
programs. The size of this slice should not be changed.

The meaning of all slices can also be found in the SUN online documentation

IBM AIX: cannot log in because its not the lowest login shell

Sometimes, common problems lead to very strange error messages.
Last time I got the following message when I tried to login via telnet to an IBM IntelliStation running AIX 5.1: You must "exec" login from the lowest login shell., and the login process failed.

The reason for this error is trivial: the root filesystem (/) was 100% full, so the solution was just to delete some unneded files (some old cores, in my case) and everything was fine.

NIS on SGI/IRIX

IRIX (AFAIK) has no direct support (I mean a GUI tool) to manage the use of NIS for passwd and groups - you can just turn NIS client on and configure the host resolution order.
So take care that nsswitch.conf is set up correctly (usually, it is!) and the /etc/passwd and /etc/group contains +::::: (or +:::) in the last line (or something similar ;-))
Otherwise you will have the problem that ypcat passwd delivers the expected useres, but non of these users can log in (Unknown user id).

Some pitfalls when setting up a SGI/MIPS machine

When I set up a SGI/Irix Octane 2 (with 2 MIPS R12k CPUs) the last time, I ran into two pitfalls I want to mention here:

1) On newer machines (which does not use the old-fashioned R10k-CPUs anymore, I assume) you cannot install any IRIX 6.5 version you want. On my machine, it had to be at least 6.5.10, otherwise the starting of the miniroot (Installation Tools) failed (machine hang up completely)
Although IRIX releasenote contains some information about some hardware support, I found nothing about R12k or Octane2 there :-(

2) NFS installation failed with following error:
ERROR: this software distribution is not meant to install on the version of IRIX currently running on this machine. Sorry
This happend for me when I tried to install form the ONC/NFS CD that comes with IRIX 6.5. The reason of this problem is that this CD is also suited for the use of IRIX 6.2, 6.3 and 6.4, not only 6.5, which means that the distribution is not located in /CDROM/dist (as usual), but in /CDROM/dist6.5
Changing the path in the instalaltion tools to the right distribution directory solves the problem!

SGI Irix: how to start System Manager without desktop?

Every SGI user knows the System Manager - usually to be reached from the Desktop menu. But if you just shot the desktop - as i did the last time - where the hell is the System manager located?
The easy-to-find-out (if everyting is running as it should:-) answer: /usr/sysadm/bin/sysmgr