comp.unix.aix faq -Part 3 of 5

原创 2004年08月03日 15:51:00
Subject: 1.606: How to configure dialup SLIP

IBM's WWW page <> can lead you to a helpful document

From: (Christian Bode)

If you don't have problems with slattach you should have PTF
bos.obj installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group

Here's another scenario:
From: (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP)
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others.
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

         ethernet IP address
         slip interface IP address

         ethernet IP address
         slip interface address

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0  up

and on local.a.b.c:

         ifconfig sl0  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
TTY type                                           tty
TTY interface                                      rs232
Description                                        Asynchronous Terminal
Parent adapter                                     sa0
PORT number                                        []                       +
BAUD rate                                          [38400]                  +
PARITY                                             [none]                   +
BITS per character                                 [8]                      +
Number of STOP BITS                                [1]                      +
TERMINAL type                                      [dumb]
STATE to be configured at boot time                [available]              +
DMA                                                on                       +
Read Trigger                                       0,1,2,3
Transmit buffer count                              [16]                      #
Name of initial program to run                     [etc/getty]

Note: The following attributes are only applicable if /etc/getty is specified
as the initial program to run.

Enable program?                                    respawn
Run level                                          2
Enable LOGIN                                       disable                  +
TIME before advancing to next port setting         [0]                      +#
STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
RUN shell activity manager                         no                       +
Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively. 
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files


   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:


   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK /pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK /pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   /pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level.
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time.

   Routing through the SLIP link is similiar to routing of any gateway.
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet): remote.a.b.c # ethernet address  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

Subject: 1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.

Subject: 1.608: How do I make /var/spool/mail mountable?
From: (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

where xxx is the user node and is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.

Subject: 1.609: getty spawning too rapidly
From: (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect.

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.

Subject: 1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07
if you want more than standard SLIP.

Subject: 1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

Subject: 1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.

Subject: 1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality. 
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

Subject: 1.614: NIS security (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.

The details:
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for

How to enable this NIS security option: 
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
# for example:
# Loopback interface

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles. 
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.

Subject: 1.615: Why can't non-anonymous users login using WU-FTP?
From: (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist Wed Apr 13 15:17:18 1994
+++ ftpd.c Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

Subject: 1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double

Subject: 1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach ("
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

Subject: 1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <> "L. Mark Larsen"

  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

Subject: 1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier
AT&D2 - hangup on DTR drop

Subject: 1.620: NIS slave server config with master on different subnet?
From: (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login.
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.

Subject: 1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

Subject: 1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must
first install the AIX Shared Library Hookable Symbols/6000 Version, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without
first installing the Hookable Symbols PRPQ, you will get the following

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from

There is also an associated README.slhs file in that directory.

Subject: 1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <>.

Commercial solutions include Fusion95 from Performance Technology
<> and Syntax <>.

Subject: 1.624: Printing from AIX to WinNT/95/3.1
From: Charles J. Fisher <>

1. On your Windows system, share the printer. Assuming that you are
   running NT, make a user "root" with some password.

2. Get the Samba distribution from
   If you have a C compiler, get the source and compile it.
   If you don't have a C compiler, get a binary distribution for AIX.

3. Install Samba on AIX under /usr/local/samba. Specifically, make sure
   that /usr/local/samba/bin/smbclient is installed with execute rights
   for everyone.

4. You must also install a Samba configuration file under

   If you intend to use your AIX as a file server for windows clients,
   you should modify smb.conf to accomplish this (see the Samba

   If you will be printing only, just use the sample smb.conf.

5. Make the directory /usr/local/samba/lib/printers

6. In that directory, install the following shell script as
   file "winprint":


# This is a modification of the samba provided smbprint script
# changed to work under AIX as the backend for a queue. It does
# not read a config file.
# Variables below define the server and service. They are
# the content of the .config file when printing from
# /etc/printcap.
# Debugging log file, change to /dev/null if you like.
# Some debugging help, change the >> to > if you want to save space.
#echo "server $server, service $service" >> $logfile
#cat $1 | /usr/local/samba/bin/smbclient "////$server//$service"
$password /
#       -N -P -c 'print -' >> $logfile

# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        echo translate
        echo "print -"
        cat $*
) | /usr/local/samba/bin/smbclient "////$server//$service" $password /
-U "$user" -N -P  > /dev/null

7. The above file assumes that you are using //winserver/winprinter
   as the printer share, and that the user is "root" and the password
   is "root". If this is not the case, modify the shell variable

8. Mark the file with execute permissions with "chmod 755 winprint"

9. Test the script with the command: "./winprint /etc/passwd"
   If everything is ok, your password file should be spooled to your
   windows printer.

   If it doesn't work, remove the "> /dev/null" from the last line of
   the script and rerun it. Examine the output of smbclient for clues.

   Clue #1: The Windows printer server is on the other side of a router.
            AIX is sending broadcast packets to find the Windows machine,
            which the router will not forward. You must find the Windows
            server's IP address and specify it with the "-I" parameter
            to smbclient, i.e. "-I". DHCP makes this situation
            even more complex.

   Clue #2: You username or password is wrong. smbclient will tell you
            about this if you free its output from > /dev/null.

   Clue #3: You might be violating shell quoting rules if you use
            special characters in the server or share name, password,
            etc. Don't use $, ", ', etc., or escape them properly.
            A password of ";rm -rf /" could be catastrophic.

10. Once the script can print files, it must be defined as a printer in
    the /etc/qconfig file. Add the following lines to the end of your

        device = dwinprint
        up = TRUE
        discipline = sjn
        backend = /usr/local/samba/lib/printers/winprint

11. Test the printer with the following command:
    "lp -d winprint /etc/passwd"
    (Your password file should be printed again.)

12. You might examine the queue with the command "lpq -P winprint"
    or "lpstat -t"

Subject: 1.625: How do I get NFS mounting with Linux to work?

Linux by default requires any NFS mount to use a so called reserved port
below 1024 and AIX 4.3 does by default use ports above 1024. You can use
the nfso command to restrict AIX to the reserved port range as follows:

nfso -o nfs_use_reserved_ports=1

Subject: 1.626: Telnet takes a 45 seconds to produce a prompt.

This is in nearly all cases a DNS configuration problem, the AIX machine
can not resolve the IP address of the node initiating the telnet
connection. You can check the DNS reverse mapping by using the nslookup
command on the IP number in question, this will probably timeout as
well. Make sure that the nameserver lines in the /etc/resolv.conf file
point to valid name servers. Some folks have reported that putting the
following in /etc/netsvc.conf can help as well (see also Subject:


Getting a correct DNS Server configuration is the real answer.

Subject: 1.627: Ethernet frame type - en0 vs. et0
From: Michael Wojcik <>

The "en" and "et" prefixes for AIX Ethernet network interfaces
indicate the type of "framing" that surrounds higher-level protocol
data on the Ethernet medium ("wire").  The Ethernet frame is the
envelope that surrounds IP packets and equivalent messages in other

There are two kinds of Ethernet framing in common use today.  The
"official" standard is IEEE 802.3 framing, but TCP/IP traffic on
Ethernet is usually carried in DIX (Digital / Intel / Xerox) type
II (usually written "DIX II" or just "DIX") frames.  Other
transport-independent protocols, may use 802.3.  On AIX, SNA is
probably the most common 802.3-framed protocol.

The two frame types can coexist on the wire.

Most TCP/IP stacks only support DIX framing.  AIX is unusual in
supporting both DIX and 802.3 framing for TCP/IP, but there's little
point in using 802.3 for TCP/IP.  The en0 interface uses DIX; the
et0 interface uses 802.3 (and so on for en1/et1, etc., if you have
multiple NICs).

You can configure TCP/IP for both en0 (DIX) and et0 (802.3), in
which case you're creating a multihomed host with only one physical
network connection.  Unless you know you need TCP/IP over 802.3,
don't bother.

You don't need to configure TCP/IP on 802.3 to use other protocols
(eg. SNA) on 802.3.

Subject: 1.700: Free LVM lecture slides.

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March

mail -s "" < /dev/null
mail -s "" < /dev/null
mail -s "" < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <>.]

Subject: 1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting


1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

2) shutdown to maintenance mode

        shutdown -Fm

3) export LANG=C

4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN

   where NNN is the number of 4 meg partitions

6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

9) Sync and reboot the system; you now have a smaller /usr filesystem


0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94. 
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

1) Remove any unneeded files from /usr.

2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

5) chdev -l rmt0 -a block=512 -T

6) Unmount all filesystems that are NOT in the root volume group.

7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

8) Export the user-defined volume groups, if any

        exportvg VGname

9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

12) Varyon your user-defined volume groups

         varyonvg VGname

The reduction of the filesystems is now complete.

There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at

Subject: 1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

Subject: 1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM. (Johnny Shieh) has kindly provided the following

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

1) Extend a logical volume
2) Create mirrored copies of a logical volume
3) Remove the logical volume
4) Create a journaled filesystem with which to mount
the logical volume (note that this will destroy any
data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.

Subject: 1.704: What's the limit on Physical Partitions Per Volume Group?
From: (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.

* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

Subject: 1.705: Why am I having trouble adding another disk to my VG?
From: (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will

Not enough descriptor space left in this volume group.
Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

Subject: 1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

File jfs-Filesystem
3.2.5 2GB 2GB
4.1.x 2GB 64GB
4.2 64GB 128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.

Subject: 1.707:  Hints for Segate 9 GB and other disks larger than 4 GB?

[read 1.704]

Subject: 1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

Subject: 1.709: How do I remove a volume group with no disks?
From: (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just
exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply

reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

Subject: 1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <>

  LVM Limits within AIX (my perception)
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB (1024MB for AIX 4.3).
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016
  x 256MB PPs), you can install 32 of these in a single VG giving you
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so
  you could (in theory) create the maximum addressable AIX storage area
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This
  is based on the current limitations of AIX V4.1.
  The limits for file and filesystem sizes are:

[Editor's note: the original values in this mail appeared to
be slightly wrong, I have corrected that to the values as per
my interpretation of the AIX manual.]
  AIX V3.2  Max filesystem size:  2,147,483,647 bytes (2 GB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  AIX V4.1  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  AIX V4.2  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

  AIX V4.3  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

The 1TB maximum file system size is given by the rule that each
fragment must be addressable by an 28 bit number, with the largest
fragment size being 4096 bytes (4096*2^28).

Subject: 1.800: How do I control how hostnames are resolved?
From: <> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

[Editor's notice: As of AIX 4.3 you also have bind4 & bind8 (for IPv4 & IPv6)]


Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change

CDE configuration files are kept in /usr/dt/config

Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

From: Olaf Meeuwissen <>

The problem is in /usr/dt/bin/Xsession.  This script only recognizes
the following login shells: sh, ksh and csh (as of $Revision: 1.12 $).
All other shells are considered non-standard.

The fix is to have your sys-admin add any other login shells in the
right places in the script (twice in the "Start the session" part).
Look for "case ${SHELL##*/} in" and add shells in the patterns.

Note that this script will be overwritten unconditionally by system
updates :-( and, unlike much other stuff in /usr/dt/, copying it to
/etc/dt/ does not work.

For which shells to add, you may want to:

   $ grep shells /etc/security/login.cfg

Subject: 1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <>.  <>
is another source.

Subject: 1.803:  Why doesn't Netscape work?

See question 1.515.

Subject: 1.900: SCSI-1 and SCSI-2 "interoperability" got you confused? 

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

Subject: 1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line


Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

[Editor's note: By unplugging & plugging a keyboard/mouse on a live
system you may/will damage/zap/fry/destroy the motherboard]

Subject: 1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3,
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.

Subject: 1.903: How do I transfer files between AIX and DOS disks?

In the AIX package bos.dosutils are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from is better than the native AIX programs.

Subject: 1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted to conform to U.S. law regarding export of missile,
ammunitions, nuclear and cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

France is such a place.

If anyone has a better answer to this question (like places where crypto
devices are illegal/severely restricted),  feel free to contribute it.

Subject: 1.905: How do I play audio CDs?
From: (Ronald S. Woan)

Get xmcd by anonymous FTP from in /contrib/applications/xmcd/

Subject: 1.906: How can I get the mouse back after unplugging it?


[Editor's note: By unplugging & plugging a keyboard/mouse on a live
system you may/will damage/zap/fry/destroy the motherboard]

Subject: 1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<> and

Subject: 1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at

Subject: 1.909: Will there be date rollover problems in the year 2000?
From: (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

Subject: 1.910: How can I build an "installp format" file?

Jim Abbey <> has a tool called "lppbuild".
It is now available from ""
in either of


Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <>.

Subject: 1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <>

Yes. Matthew Jacob ( has written a generic SCSI driver
for AIX 4.1.  It can be found at <>.

Subject: 1.912: Viruses or virus scanning on AIX?
From: (Michael Wojcik)

FWIW, AIX comes with a virus-scanning utility (/usr/bin/virscan),
though IIRC the original version had an empty signature file (in
/usr/lib/security/scan/virsig.lst) and even the later populated
signature file only contains PC viruses.  Quoth the man page, "at
this time [virsig.lst] contains no known AIX virus signatures".
Apparently we are to infer that there *were* no known AIX virus

I note that my 4.2.1 AIX system still has the 1991 signature file.

Even a DOS-only virus list could potentially be useful on a Unix
file server, though.  Provided, of course, that it had a recent
signature list (and preferably mutant-detection and similar
heuristics), which virscan probably does not.

And to be fair there are plenty of Unix vulnerabilities, and even
viruses potentially among them.  David Harley, keeper of the
alt.comp.virus FAQ, mentioned some "lab" Unix viruses when this
thread appeared in October '87, and I recall a discussion of using
crypto hashes to validate major system commands on some Unix group
not that long ago - which is essentially virus-scanning technology,
though not necessarily for the same purpose it generally serves
on PCs.

That said, viruses are not the problem for Unix systems that they
are for PCs.  Network security, guessable usernames and passwords,
and the like should generally be a higher priority.

Subject: 1.913: How do I determine the clock frequency of a RS/6000 by
software ?
From: Franz Pestenhofer <>

The answer seems to be "There is no way to find
out the clock frequency with a piece of software".

[Editor's notice: on CHRP machines there is information on the open firmware]

Subject: 1.914: How do I create a ramdisk ?
From: Mark Grubbs <>

# mkramdisk SIZE
# mkfs -V jfs /dev/ramdiskxx
# mount -V jfs -o nointegrity /dev/ramdiskxx /whatever

[Editor's notice: This function is new in 4.3.3 ]
[Editor's notice: This function is UNSUPPORTED  ]

Subject: 1.915: Can I run Linux on an RS/6000 ?

Some distributions can be installed on some RS/6000's.
They only support a subset of the available cards.

For more information see:

Subject: 2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

Subject: 2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

Subject: 2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

Subject: 2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o # make prog
  $ cc -c prog2.c # recompile prog2.c
  $ cc -o prog2.o prog # make from prog
# by replacing prog2.o
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline ( claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

Subject: 2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT

【UNET自学日志】Part3 变得更有效率一点

  • sinat_24994943
  • sinat_24994943
  • 2016年04月16日 12:36
  • 1108

3*3卷积核 5*5卷积核到底有多大区别

为了比较3*3卷积核 和 5*5卷积核在性能上到底有多大区别设计了两个网络去进行对比, 1.两个3*3的卷积核,2个池化层,2个全连接层 2.两个5*5的卷积核,2个池化层,2个全连接层 两个网...
  • georgesale
  • georgesale
  • 2017年12月12日 13:38
  • 358

Netflix公布个性化和推荐系统架构 Netflix的推荐和个性化功能向来精准,前不久,他们公布了自己在这...
  • haizhiguang
  • haizhiguang
  • 2015年05月25日 15:04
  • 840


原文地址: 作者:hjimce 卷积神经网络算法是n年前就有的算法,只是近年来因为深...
  • u011534057
  • u011534057
  • 2016年04月22日 22:19
  • 1889


Subsequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11224   A...
  • a88770202
  • a88770202
  • 2016年05月12日 16:44
  • 161 题目:将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。

//【程序4】 题目:将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。 程序分析:对n进行分解质因数, //应先找到一个最小的质数k,然后按下述步骤完成: ...
  • u014657292
  • u014657292
  • 2014年04月11日 18:36
  • 1491

51nod 1284:2 3 5 7的倍数 容斥原理

1284 2 3 5 7的倍数 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题  收藏  关注 给出一个数N,求1...
  • u010885899
  • u010885899
  • 2015年08月27日 09:59
  • 1275


【1998普及】高精度计算Description 用高精度计算出S=1!+2!+3!+...n!)(n
  • codingdd
  • codingdd
  • 2017年03月10日 09:13
  • 117


package com.hello; import java.util.HashSet; import java.util.Set; /* * @author 张春蕾 * 输出1,2,2,3,...
  • u012142423
  • u012142423
  • 2013年10月28日 15:22
  • 1274


一、基本语法 1、raw_input()取的内容永远以字符串的形式返回 2、“”和’'的一个区别是      “This’s a test!” √      ’This’s a test!’ ×   ...
  • sfh366958228
  • sfh366958228
  • 2015年02月03日 14:38
  • 1369
您举报文章:comp.unix.aix faq -Part 3 of 5