home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / Documents / FAQ / AIX-faq / part2 < prev    next >
Encoding:
Internet Message Format  |  1993-08-17  |  53.8 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!spool.mu.edu!sdd.hp.com!swrinde!cs.utexas.edu!mavrick!basto@cactus.org
  2. From: basto@cactus.org (Luis Basto)
  3. Newsgroups: comp.unix.aix,news.answers,comp.answers
  4. Subject: AIX Frequently Asked Questions (Part 2 of 3)
  5. Summary: This posting contains a list of Frequently Asked Questions 
  6.          and their answers about AIX, IBM's version of Unix.
  7. Keywords: AIX RS/6000 questions answers
  8. Message-ID: <1452@mavrick.UUCP>
  9. Date: 16 Aug 93 05:11:10 GMT
  10. Expires: 15 Sep 93 01:23:45 GMT
  11. Sender: luis@mavrick.UUCP
  12. Reply-To: basto@cactus.org (Luis Basto)
  13. Followup-To: comp.unix.aix
  14. Lines: 1325
  15. Approved: news-answers-request@MIT.Edu
  16. Supersedes: <1442@mavrick.UUCP>
  17. Xref: senator-bedfellow.mit.edu comp.unix.aix:28917 news.answers:11418 comp.answers:1613
  18.  
  19. Archive-name: aix-faq/part2
  20. Last-modified: August 15, 1993
  21. Version: 2.40
  22.  
  23.  
  24. Version: $Id: aix.faq,v 2.40 93/08/15 basto $
  25.  
  26. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  27. _____________________________________________________
  28.  
  29. 1.200: Some info about tape backups
  30. From: Craig Anderson
  31.  
  32. The following supplements the information on rmt devices in
  33. InfoExplorer.  It is based on my own personal experience with IBM tape
  34. drives running on AIX 3.1.  No warranty is expressed or implied.
  35.  
  36. CONFIGURING THROUGH SMIT:
  37.     BLOCK size (0=variable length)        (ALL)
  38.     Sets the tape block size.  When reading, the block size must be
  39.     set to the block size set when the tape was written.  When
  40.     using some commands, tapes written with ANY block size can be
  41.     read if the block size is set to 0 (variable length) (see
  42.     "BLOCK SIZES" below).
  43.  
  44.     Use DEVICE BUFFERS during writes        (ALL)
  45.     Set to yes, the device will buffer data internally on writes.
  46.     This greatly improves performance, but under certain cases may
  47.     be undesirable since the data is not written to tape before
  48.     returning a good indication.
  49.  
  50.     Use EXTENDED file marks            (8mm only)
  51.     Extended file marks take up much more space than short (or
  52.     non-extended) file marks.  But extended file marks can be
  53.     overwritten, allowing data not at the beginning of tape to be
  54.     overwritten (see "FILE MARKS" below).
  55.  
  56.     RETENSION on tape change or reset        (1/4" only)
  57.     If set to "no" then the tape will not be retentioned
  58.     automatically when the tape is inserted.  Note that this will
  59.     take effect only after the device is used.
  60.  
  61.  
  62. FILE MARKS:
  63.      Tape devices support multiple tape files.  Tape files are the
  64.      result of a backup/cpio/tar/dd type command, where the device is
  65.      opened, written to, and closed.  Because tapes allow large
  66.      quantities of data to be written on a single tape, several backups
  67.      (that is, tape files), may be combined on one physical tape.
  68.      Between each tape file is a "tape file mark" or simply "file
  69.      mark".  These file marks are used by the device driver to indicate
  70.      where one tape file ends and another begins.
  71.  
  72.                               B       E
  73.                    <-------   O       O   ------->
  74.                               T       T
  75.               __ ____________________________ _______________
  76.      physical | \            |       |      \             |physical
  77.      beginning|  \           | tape  |       \            | end
  78.        of     |   \          | file  |        \           |  of
  79.       tape    |    \         | mark  |         \          | tape
  80.               |_____\________|_______|__________\_________|
  81.  
  82.      Note that there is a distinction between the beginning of tape
  83.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  84.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  85.      1" command will move only to the EOT side of the same file mark.
  86.  
  87.      With the 1/4" tape drive, writing can only take place
  88.      sequentially, or after blank tape has been detected.  You cannot
  89.      write over data on the tape (except at BOT).  If you wish to add
  90.      data to a tape which has been written and then rewound you should
  91.      space forward file mark until an error occurs.  Only then can
  92.      you start writing again.
  93.  
  94.      With an 8mm tape drive, writing can only take place before blank
  95.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  96.      have been made on one tape and you wish to overwrite one of the
  97.      backups, position the tape to the place you wish to start writing
  98.      and issue the following commands:
  99.     tctl bsf 1
  100.     tctl eof 1
  101.      The first command skips back to the BOT side of the same file
  102.      mark.  The second command rewrites the file mark (writing is
  103.      allowed before extended file marks).  The erase head will erase
  104.      data ahead of the write head, so that after writing the file mark
  105.      the head will be positioned before blank tape.  Only after this
  106.      may you start writing over data in the middle of the tape.  (All
  107.      data beyond where you are currently writing will be lost).  Note
  108.      that you cannot write over short file marks.  In order for this to
  109.      work, the tape must have been written with extended file marks
  110.      (use smit to change this).
  111.  
  112.      With the 9-track drive writing can take place anywhere on the
  113.      tape although overwriting single blocks of data is not supported.
  114.  
  115.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  116.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  117.      and take up to 1.5 seconds to write.
  118.  
  119. BLOCK SIZES:
  120.      When data is written to tape it is written in blocks.  The blocks
  121.      on a tape are separated by inter-record gaps.  It is important to
  122.      understand the structure of the written tape in order to
  123.      understand the problems which can occur with changing block
  124.      sizes.
  125.  
  126.      In fixed block size mode all blocks on the tape are the same
  127.      size.  They are the size of the block size set in the device
  128.      configuration.  All read()s and write()s to the tape drive must be
  129.      a multiple of the fixed block size.
  130.  
  131.      In fixed block mode a read() will return as many blocks as needed
  132.      to satisfy the read() request.  If a file mark is encountered
  133.      while reading the tape only the data up until the file mark will
  134.      be returned.
  135.  
  136.      It is not possible for the tape drive to read a tape whose block
  137.      size is not the same as the block size in the device
  138.      configuration.  (Unless the device configuration is in variable
  139.      size blocks.)
  140.  
  141.      In variable block size (0) mode, the blocks written on the tape
  142.      are the size of the read() and write() requests to the device
  143.      driver.  In this case, the actual block sizes on the tape can be
  144.      changed using the options to the backup commands (tar -C, cpio -C,
  145.      backup -C).
  146.  
  147.      In variable mode, read() requests greater than size of the block
  148.      on the tape will return only the data from the next block on the
  149.      tape.  It is this feature that allows tapes written in any block
  150.      size (fixed or variable) to read with the dd command (the output
  151.      from the dd command may be piped to restore, tar, or cpio for
  152.      example.)  Note that backup, tar, and cpio cannot read all tapes
  153.      by using a large block size because they assume there is an error
  154.      if they get a short read().
  155.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  156.  
  157.      The tape head is always positioned at an inter-record gap, file
  158.      mark, or blank tape after reading or writing.
  159.  
  160.      With the 8mm tape drive, using a fixed block size which is not a
  161.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  162.      internally in 1K blocks.  It simulates the effect of variable
  163.      block sizes, but, for example, using a fixed block size of 512
  164.      bytes (or using variable block size and write()ing 512 bytes at a
  165.      time) wastes one half of the tape capacity and gives only one half
  166.      the maximum transfer rate.
  167.  
  168.  
  169. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  170.      Many tape drives support both variable and fixed block sizes.
  171.  
  172.      Variable block mode writes block sizes the size of the write
  173.      command issued (tar and backup specify this with the -b option). 
  174.      In fixed mode, block sizes are fixed and all writes must be a
  175.      multiple of the fixed block size.
  176.  
  177.      Unix often internally chops larger reads and writes up into
  178.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  179.      doing the actual reads and writes.  This means reads and writes of
  180.      64K bytes are often broken up into a 65535 byte record and a 1
  181.      byte record (In fixed mode the write will fail).  Block sizes >=
  182.      64K (-C128 and greater) should be avoided for this reason.  AIX
  183.      does not break up read and write requests, but be aware of the
  184.      situation on other machines.
  185.  
  186.      If the tape is written in an unknown block size then set the
  187.      device configuration in smit to use variable size blocks, use the
  188.      "dd" command with a large input block size, and pipe it to the
  189.      restore command.  For example:
  190.       chdev -l rmt0 -a block_size=0
  191.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  192.  
  193.  
  194. 1.201: How do I do remote backup?
  195.  
  196. There seems to be several ways of doing this. I found the following works:
  197.  
  198.   tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
  199.  
  200.  
  201. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  202.  
  203. mksysb will not back up to remote tape devices. Frank provided the
  204. following script to do remote backups.
  205.  
  206. [Editor's note: I've verified this script works fine. However, it may be slow
  207.  for large filesystems since it creates a temp file of filenames in /tmp.]
  208.  
  209. #!/bin/ksh
  210. # @(#) Create a backup tape of the private user data.
  211. #=================================================================#
  212. #   Script :  usave.sh                                            #
  213. #   Author :  F. Kraemer                                          #
  214. #   Date   :  92/02/19                                            #
  215. #   Update :  92/10/29                                            #
  216. #   Info   :  the ultimative backup script                        #
  217. #   Example:  usave.sh /dev/rmt0      -  save to local tape       #
  218. #             usave.sh /save/save.me  -  save to local file       #
  219. #             usave.sh /tmp/pipe      -  save to remote tape      #
  220. #-----------------------------------------------------------------#
  221. PS4="(+) "
  222. #set -x
  223. PROG=$(basename $0)
  224. HOST=$(hostname)
  225. TODAY=$(date +%H:%M:%S)
  226. #-----------------------------------------------------------------#
  227. # cleanup                                                         #
  228. #-----------------------------------------------------------------#
  229. cleanup ()
  230. {
  231. ec=$1
  232. error=$2
  233. case "$ec"
  234. in
  235.    "$USAGE_EC")    # usage error
  236.      error="Usage:\t$PROG DeviceName\n" 1>&2
  237.     ;;
  238.    "$NOTAP_EC")    # Tape error
  239.      error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
  240.     ;;
  241.    "$LISTE_EC")    # list error
  242.      error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
  243.     ;;
  244.    "$NOTAR_EC")    # tar command error
  245.      error="error:\t$PROG: tar command failed.\n" 1>&2
  246.     ;;
  247.    "$PIPEP_EC")    # pipe error
  248.      error="error:\t$PROG: mknod command failed.\n" 1>&2
  249.     ;;
  250.    "$NORSH_EC")    # rsh error
  251.      error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
  252.     ;;
  253.    "$RHOST_EC")    # remote host error
  254.      error="error:\t$PROG: Remote Host unknown.\n" 1>&2
  255.     ;;
  256.    *)
  257.    ;;
  258. esac
  259. case "$DEVICE"
  260. in
  261.     #
  262.     # Fix the block size if $DEVICE is a tape device
  263.     #
  264.     /dev/rmt[0-9]*)
  265.         echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
  266.         tctl -f $DEVICE rewind 2>/dev/null
  267.         ;;
  268.     *) ;;
  269. esac
  270. rm -f ${LIST} ${PIPE} 2>/dev/null
  271. [ -n "$error" ] && echo "\n${error}\n"
  272. trap '' 0 1 2 15
  273. exit "$ec"
  274. }
  275. #-----------------------------------------------------------------#
  276. # Variables.                                                      #
  277. #-----------------------------------------------------------------#
  278. USAGE_EC=1                         # exit code for usage error
  279. NOMNT_EC=2                         # exit code wrong device name
  280. NOTAP_EC=3                         # exit code no tape available
  281. LISTE_EC=4                         # exit code backup list error
  282. NOTAR_EC=5                         # exit code for wrong tar
  283. TRAPP_EC=6                         # exit code for trap
  284. PIPEP_EC=7                         # exit code for pipe
  285. RHOST_EC=8                         # exit code for bad ping
  286. NORSH_EC=9                         # exit code for bad rsh
  287. DEVICE="$1"                        # device to tar into
  288. LIST="/tmp/.tar.$LOGNAME.$$"       #
  289. REMOTEH=""                         # Remote host for backup
  290. REMOTET=""                         # Remote tape for backup
  291. tapedev=                           #
  292. PIPE="/tmp/pipe"                   # Pipe for remote backup
  293. #-----------------------------------------------------------------#
  294. # main()                                                          #
  295. #-----------------------------------------------------------------#
  296. tput clear
  297. echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
  298. rm -f $LIST 2>/dev/null
  299. #-----------------------------------------------------------------#
  300. # Trap on exit/interrupt/break to clean up                        #
  301. #-----------------------------------------------------------------#
  302. trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
  303. #-----------------------------------------------------------------#
  304. # Check command options                                           #
  305. #-----------------------------------------------------------------#
  306. [ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
  307. #-----------------------------------------------------------------#
  308. # Check device name                                               #
  309. #-----------------------------------------------------------------#
  310. [ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
  311.         "$PROG: Backup device or file name must start with a '/'."
  312. #-----------------------------------------------------------------#
  313. # Check tape device.                                              #
  314. #-----------------------------------------------------------------#
  315. case "$DEVICE"
  316. in
  317.     #
  318.     # Fix the block size if $DEVICE is a tape device
  319.     #
  320.     /dev/rmt[0-9]*)
  321.         #
  322.         echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
  323.         #
  324.         # see if a low or high density tape device was specified
  325.         # (eg rmt0.1)
  326.         density="`expr $DEVICE : \
  327.                 "/dev/rmt[0-9]*\.\([0-9]*\)"`"
  328.         #
  329.         # strip /dev/ from device name and
  330.         # get the base name (eg translate:
  331.         # /dev/rmt0.2 to rmt0)
  332.         #
  333.         tapedev="`expr $DEVICE : \
  334.                 "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
  335.         #
  336.         # Check if the tape is defined in the system.
  337.         lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
  338.         rc=$?
  339.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  340.         #
  341.         # Restore old tape name.
  342.         #
  343.         [ "${density:-1}" -lt 4 ] && density=1 || density=5
  344.         DEVICE="/dev/${tapedev}.${density}"
  345.         echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
  346.         read TEMP
  347.         echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
  348.         tctl -f $DEVICE rewind 2>/dev/null
  349.         ;;
  350.     #
  351.     # Backup is done on remote host. The remote shell facility
  352.     # must be set up and running.
  353.     #
  354.     ${PIPE}*)
  355.         #
  356.         echo "\n\t$PROG: Assuming remote backup via network.\n"
  357.         echo "\t$PROG: Enter name of Remote Host   ===> \c"
  358.         read REMOTEH
  359.         echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
  360.         ping ${REMOTEH} 1 1 >/dev/null 2>&1
  361.         rc=$?                                    # give up unknown host
  362.         [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
  363.         JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
  364.         rc=$?                                    # give up rsh failed
  365.         [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
  366.         echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
  367.         echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
  368.         read REMOTET
  369.         echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(press enter)"
  370.         read TEMP
  371.         echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
  372.         rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
  373.         rc=$?                                    # give up rsh failed
  374.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  375.         rm -f ${PIPE} 2>/dev/null
  376.         mknod ${PIPE} p
  377.         rc=$?                                    # give up mknod failed
  378.         [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
  379.         cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
  380.         ;;
  381.     *)  ;;
  382. esac
  383. #-----------------------------------------------------------------#
  384. # Prepare the list.                                               #
  385. #-----------------------------------------------------------------#
  386. echo "\n\t$PROG: Create list of files to be saved...."
  387. find $HOME -print > $LIST
  388. rc=$?
  389. [ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
  390. #-----------------------------------------------------------------#
  391. # tar the files.                                                  #
  392. #-----------------------------------------------------------------#
  393. echo "\n\t$PROG: Changing current directory to (/)...."
  394. cd / > /dev/null 2>&1
  395. echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
  396. tar -cvf "$DEVICE" -L "$LIST"
  397. rc="$?"
  398. [ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
  399. #-----------------------------------------------------------------#
  400. # Backup completed                                                #
  401. #-----------------------------------------------------------------#
  402. TODAY=$(date +%H:%M:%S)
  403. echo "\n\t$PROG ended at $TODAY............................\n\n"
  404. cleanup 0
  405. #-----------------------------------------------------------------#
  406. # EOF                                                             #
  407. #-----------------------------------------------------------------#
  408.  
  409.  
  410. 1.202: How do I backup a multi-disk volume group?
  411. From: pack@acd.ucar.edu (Daniel Packman)
  412.  
  413. [ Editor's note: I have not verified this procedure.  I would actually
  414.   recommend NOT to have one volume group span multiple disks unless you
  415.   really need such big logical volumes. ]
  416.  
  417.   1. If you have a set of three or more disks in a volume group.
  418.      (typically 3 for 5xx machines with three internal drives;
  419.      with only two, the procedures outlined here have to be modified
  420.      to ignore the fact that you don't have a quorum in the volume group)
  421.  
  422.   2. If one drive has failed (usually only one fails at a time :-) )
  423.  
  424. It is possible to go through a service boot and (if we say the volume
  425. group is called rootvg and one of the 2 good disks on it is called hdisk0):
  426.  
  427.   importvg -y rootvg hdisk0
  428.   varyonvg -f -n -m1 rootvg
  429.  
  430. These commands will work, but give error messages.  If you wish to mount
  431. a user filesystem, say /u on logical volume /dev/lv00, then
  432.  
  433.   mount -f /dev/lv00 /v
  434.  
  435. will work only if the jfslog, the journaled file system log device, is not
  436. on the damaged disk.  If it is, you must (and can in any case) mount the
  437. filesystem read-only:
  438.  
  439.   mount -f -r /dev/lv00 /v
  440.  
  441. This crucial and rather obvious point baffled several level 3 support
  442. personnel at Austin as well as myself for almost a week.  Once the file
  443. system(s) of interest are available, then they can be saved to tape for
  444. restoration later.  Of course, one can expect only about two thirds of a
  445. filesystem to be recoverable if it spans all 3 physical disks.  One
  446. other point to remember is that the standard boot procedure from floppy
  447. includes the restore command but does not include the backup command. 
  448.  
  449. *****************************************************************************
  450. * If you do not have other RS6000 machines at your site is is imperative    * 
  451. * that you either build a bootable tape which includes either restore or    * 
  452. * tar or cpio (a bootable floppy set will not have enough space) or at the  *
  453. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
  454. * should be created with backup -ivq so that its contents can be read into  *
  455. * the memory resident system after booting.                                 *
  456. *****************************************************************************
  457.  
  458. All is not lost if tar, cpio or backup are available on an undamaged
  459. disk that can be mounted.  Since tar and cpio are in /bin, they may both
  460. very well be unavailable.
  461.  
  462. It is a very good idea for those who have tape devices to build a
  463. bootable tape with their desired extra commands in it.  Follow the
  464. instructions from IBM but add your desired commands to the following
  465. three files:
  466.  
  467.     /usr/lpp/bosinst/tape2
  468.     /usr/lpp/bosinst/diskette/boot2
  469.     /usr/lpp/bosinst/diskette/inslist
  470.  
  471. If you have anything other than a minimum memory configuration, you
  472. should be able to add many commands.
  473.  
  474.  
  475. 1.203: How do I put multiple backups on a single 8mm tape?
  476. From: kerm@mcnc.org (Cary E. Burnette)
  477.  
  478. There are two possible solutions to this, which both use the /dev/rmt0.1
  479. device which is non-rewinding.
  480.  
  481. SOLUTION #1
  482. -----------
  483.  
  484. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  485. no-rewind device, using either rdump or backup (both by name & inode
  486. work).  Using rdump or backup "byinode" both generate the message that
  487. the tape is rewinding but actually do not.  This is an example that
  488. would work on my system:
  489.  
  490. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  491. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  492. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  493.  
  494. where I am implementing the command from host.
  495. To restore a table of contents of the first I would use 
  496.  
  497. # restore -f /dev/rmt0.1 -s1 -tv
  498.  
  499. where the -s1 flag tells restore to go to the first record it comes
  500. across on the tape.  To get the second type in exactly the same once
  501. again.  Basically -s(Number) stands for - go to Number record from this
  502. spot.  It works pretty well.
  503.  
  504.  
  505. SOLUTION #2
  506. -----------
  507.  
  508. Steve Knodle
  509. Educational Resources Center
  510. Clarkson University
  511.  
  512. I use:
  513. ------------------- Dump.sh --------------------
  514. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  515. set -x
  516. LEVEL=$1
  517. shift
  518.  
  519. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  520. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  521. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  522. tctl -f /dev/rmt0 rewind
  523.  
  524. touch /usr/local/dumps/Contents.$CONTENTSFILE
  525. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  526. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  527. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  528. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  529. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  530. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  531. tctl -f /dev/rmt0 rewind
  532.  
  533. I process the table-of-contents first by a little program that does
  534. common prefix encoding, and then compress.
  535.  
  536. This gives a table of contents file I can keep on-line until the tape
  537. is reused.
  538.  
  539.  
  540. 1.204: How can I make an exact duplicate of a tape over the network?
  541.  
  542. The challenge here is not to have to create a temporary file (disk space
  543. limitation) and work across heterogeneous networks.
  544.  
  545. This script might work:
  546.  
  547. LOCAL=/dev/tape_dev
  548. REMOTE=/dev/tape_dev
  549. dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
  550.  
  551.  
  552. From: pack@acd.ucar.edu (Daniel Packman)
  553.  
  554. Daniel provides the following perl script to convert from the known
  555. world's function codes to AIX for compatibility.
  556.  
  557. #!/bin/perl
  558. # Wrapper to convert input rmt requests to
  559. # AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
  560. # I0 MTWEOF -> I10  STWEOF write and end-of-file record
  561. # I1 MTFSF  -> I11  STFSF  forward space file
  562. # I2 MTBSF  -> I12  STRSF  reverse space file
  563. # I3 MTFSR  -> I13  STFSR  forward space record
  564. # I4 MTBSR  -> I14  STRSR  reverse space record
  565. # I5 MTREW  -> I6   STREW  rewind
  566. # I6 MTOFFL -> I5   STOFFL rewind and unload tape
  567. # I7 MTNOP  -> I0   (no-op? should ignore following count)
  568. # I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
  569. # I9 MTERASE-> I7   STERASE erase tape, leave at load point
  570. #I10 MTEOM (position to end of media ... no ibm equivalent?)
  571. #I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
  572. @iocs = (10,11,12,13,14,6,5,0,8,7);
  573. open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
  574. select(RMT);
  575. $| = 1;
  576. while (<STDIN>) {
  577.   s/(^I)(\d$)/I$iocs[$2]/;
  578.   exit 0 if $_ =~ /^[Qq]/;
  579.   print RMT $_ ; }
  580. exit 0;
  581.  
  582. ______________________________________________________________________________
  583. 1.300: Some info about the memory management system
  584. From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
  585.  
  586.   The following questions are answered in this document:
  587.   1. Does AIX use more paging space than other unix systems?
  588.   2. How much paging space do I need?
  589.   3. Why does vmstat show no free RAM pages?
  590.   4. Since vmstat shows no free RAM pages, am I out of RAM?
  591.   5. Shouldn't the "avm" and the "fre" fields from vmstat add up to
  592.      something?
  593.   6. Why does the "fre" field from vmstat sometimes show lots of free
  594.      RAM pages?
  595.   7. Is the vmstat "fre" field useful?
  596.  
  597.  
  598. 1. Does AIX use more paging space than other unix systems?
  599.  
  600. Under many scenarios, AIX requires more paging space than other unix
  601. systems.  The AIX VMM implements a technique called "early allocation of
  602. paging space".  When a page is allocated in RAM, and it is not a
  603. "client" (NFS) or a "persistent" (disk file) storage page, then it is
  604. considered a "working" storage page.  Working storage pages are commonly
  605. an application's stack, data, and any shared memory segments.  So, when
  606. a program's stack or data area is increased, and RAM is accessed, the
  607. VMM will allocate space in RAM and space on the paging device.  This
  608. means that even before RAM is exhausted, paging space is used.  This
  609. does not happen on many other unix systems, although they do keep track
  610. of total VM used.
  611.  
  612. Example 1:
  613. Workstation with 64mb RAM is running only one small application that
  614. accesses only a few small files.  Everything fits into RAM, including
  615. all accessed data.  On AIX, some paging space will already be used.  On
  616. other unix systems, paging space will be 100 percent free.  Clearly,
  617. this is an example that shows where we use more paging space than the
  618. other machines.
  619.  
  620. Example 2:
  621. Same machine as above, except we are running in an environment where
  622. many applications are running, and RAM is "overcommitted" (there is not
  623. enough RAM).  Also, in this environment, the system is running
  624. applications that are started, run, left idle, and not in constant use. 
  625. A session of FRAME running in a window, for example.  What happens is
  626. that eventually (theoretically) all applications will be paged out at
  627. least once.  On the AIX system and the other systems the total paging
  628. requirements will be the same (assuming similar malloc algorithm).  The
  629. major difference is that the AIX system allocated the paging space pages
  630. before they were actually needed, and the other systems did not allocate
  631. them until they were needed.  However, most other systems have an
  632. internal variable that gets incremented as virtual memory pages are
  633. used.  AIX does not do this.  This can cause the AIX system to run out
  634. of paging space (virtual memory), even though malloc() continues to
  635. return memory.  This "feature" allows sparse memory segments to work,
  636. but requires that all normal users of malloc() (sbrk()) know how much
  637. virtual memory will be available (actually impossible), and to handle a
  638. paging space low condition.  A big problem.  There are some pretty
  639. obvious pros and cons to both methods of doing Virtual Memory.
  640.  
  641. 2. How much paging space do I need?
  642.  
  643. Concerning the rule of thumb of having 2 times RAM for paging space:
  644. this is rather simplistic, as are most "rules of thumb".  If the machine
  645. is in a "persistent storage environment", meaning that they have a few
  646. small programs, and lots of data, they may not need even as much as 1
  647. times RAM for paging space.  For example, a 1GB database server running
  648. on a RISC System/6000 with 256MB of RAM, and only running about 50MB of
  649. "working" storage does not need 512MB of paging space, or even 256MB of
  650. paging space.  They only need the amount of paging space that will allow
  651. all their working storage to be paged out to disk.  This is because the
  652. 1GB database is mostly "persistent storage", and will require little or
  653. no paging space.  Excessive paging space may simply mean wasted disk
  654. space.  However, avoid insufficient paging space.  Tip: Don't have more
  655. than one paging space per disk.  Tip: Put lots of RAM in your System -
  656. it will use it.
  657.  
  658. 3. Why does vmstat show no free RAM pages?
  659.  
  660. AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
  661. morning, that file is read into RAM, and left there.  If no other
  662. programs need that RAM, that file will be left in RAM until the machine
  663. is halted.  This means that if you need the file again, access will be
  664. quick.  If you need that RAM, the system will simply use the pages the
  665. file was using.  The pages were flushed back to disk earlier.  This
  666. means that you can get a huge speedup in disk access if you have enough
  667. RAM.  For example, a 200MB database will just ease into RAM if you have
  668. a 256MB system.
  669.  
  670. 4. Since vmstat shows no free RAM pages, am I out of RAM?
  671.  
  672. Probably not.  Since disk files will be "mapped" into RAM, if vmstat
  673. shows lots of RAM pages FREE, then you probably have too much RAM (not
  674. usual on a RISC System/6000)!
  675.  
  676. 5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?
  677.  
  678. No.  The "avm" field tells you how much "Active Virtual Memory" AIX
  679. thinks you are using.  This will closely match the amount of paging
  680. space you are using.  This number has *ABSOLUTELY* nothing to do with
  681. the amount of RAM you are using, and does *NOT* include your mapped
  682. files (disk files). 
  683.  
  684. 6. Why does the "fre" field from vmstat sometimes show lots of free
  685.    RAM pages?
  686.  
  687. This will happen after an application that used a lot of RAM via "working"
  688. storage (not NFS storage, and not disk file or "persistent" storage) exits.
  689. When RAM pages that were used by working storage (a program's stack and
  690. data area) are no longer needed, there is no need to leave them around. 
  691. AIX completely frees these RAM pages.  The time to access these pages
  692. versus a RAM page holding a "sync'd" mapped file is almost identical. 
  693. Therefore, there is no need to periodically "flush" RAM.
  694.  
  695. 7. Is the vmstat "fre" field useful?
  696.  
  697. The vmstat "fre" field represents the number of free page frames.  If
  698. the number is consistently small (less than 500 pages), this is normal. 
  699. If the number is consistently large (greater than 4000 pages), then you
  700. have more memory than you need in this machine.
  701.  
  702.  
  703. 1.301: How much should I trust the ps memory reports?
  704. From: chukran@austin.VNET.IBM.COM
  705.  
  706. Using "ps vg" gives a per process tally of memory usage for each running
  707. process.  Several fields give memory usage in different units, but these
  708. numbers do not tell the whole story on where all the memory goes.
  709.  
  710. First of all, the man page for ps does not give an accurate description
  711. of the memory related fields.  Here is a better description:
  712.  
  713. RSS - This tells how much RAM resident memory is currently being used
  714. for the text and data segments for a particular process in units of
  715. kilobytes.  (this value will always be a multiple of 4 since memory is
  716. allocated in 4 KB pages).
  717.  
  718. %MEM - This is the fraction of RSS divided by the total size of RAM for
  719. a particular process.  Since RSS is some subset of the total resident
  720. memory usage for a process, the %MEM value will also be lower than actual.
  721.  
  722. TRS - This tells how much RAM resident memory is currently being used
  723. for the text segment for a particular process in units of kilobytes. 
  724. This will always be less than or equal to RSS.
  725.  
  726. SIZE - This tells how much paging space is allocated for this process
  727. for the text and data segments in units of kilobytes.  If the executable
  728. file is on a local filesystem, the page space usage for text is zero. 
  729. If the executable is on an NFS filesystem, the page space usage will be
  730. nonzero.  This number may be greater than RSS, or it may not, depending
  731. on how much of the process is paged in.  The reason RSS can be larger is
  732. that RSS counts text whereas SIZE does not.
  733.  
  734. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  735. and does not correlate to any of the other fields.
  736.  
  737. These fields only report on a process text and data segments.  Segment
  738. size which cannot be interrogated at this time are:
  739.  
  740.        Text portion of shared libraries (segment 13)
  741.  
  742.        Files that are in use. Open files are cached in memory as
  743.        individual segments.  The traditional kernel cache buffer
  744.        scheme is not used in AIX 3.
  745.  
  746.        Shared data segments created with shmat.
  747.  
  748.        Kernel segments such as kernel segment 0, kernel extension
  749.        segments, and virtual memory management segments.
  750.  
  751. Speaking of kernel segments, the %MEM and RSS report for process zero
  752. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  753. kernel segment zero is counted twice.  For AIX 3.2, this has been
  754. changed, but the whole story is still not known.  The RSS value for
  755. process 0 will report a very small number of the swapper private data
  756. segment.  It does not report the size of the kernel segment 0, where the
  757. swapper code lives.
  758.  
  759. In summary, ps is not a very good tool to measure system memory usage. 
  760. It can give you some idea where some of the memory goes, but it leaves
  761. too many questions unanswered about the total usage.
  762.  
  763. ______________________________________________________________________________
  764. 1.400: How do I make an informative prompt in the shell?
  765.  
  766. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  767. printed, so you can use:
  768.  
  769. $ myhost=`hostname`
  770. $ PS1='$LOGNAME@$myhost $PWD \$ '
  771.  
  772. to get, e.g. 
  773.  
  774. bengsig@ieibm1 /u/bengsig $
  775.  
  776. In the C-shell, use:
  777.  
  778. % set myhost=`hostname`
  779. % alias cd 'chdir \!*' > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  780. % cd
  781.  
  782. to get, e.g.
  783.  
  784. bengsig@dkunix9 /u/bengsig/aixfaq %
  785.  
  786. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  787.  
  788.  
  789. 1.401: How do I set up ksh for emacs mode command line editing?
  790. From: scotte@cdsac.uucp (L. Scott Emmons)
  791.  
  792. The ksh has an undocumented way of binding the arrowkeys to the emacs
  793. line editing commands. In your .kshrc, add:
  794.  
  795. alias __A=^P
  796. alias __B=^N
  797. alias __C=^F
  798. alias __D=^B
  799. alias __H=^A
  800.  
  801. Note that "^P" (et al) must be the actual control sequence.
  802.  
  803. Type "set -o emacs" or put this line in your .profile.
  804.  
  805. Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
  806. for the problem is IX25982, which may have been superceded.
  807.  
  808.  
  809. 1.402: Listing files with ls causes a core dump
  810. From: John F Haugh II
  811.  
  812. Scenario: a directory that is shared by N users (N >= 200).
  813. Run 'ls -l' in that directory.  It goes for a while, then
  814. Seg fault(coredump)!
  815. It only occurs when the usernames are displayed (almost every file 
  816. is owned by a different person).  The -g and -n options work fine;
  817. only -l and -o (which shows owner and not group) cause it.
  818.  
  819. I believe that this problem was corrected by U407548.
  820. If you have that many users that you are having core dump problems (it
  821. took over 200 ...), you might also want to look into getting the PTF
  822. that fixes IX31403.  That APAR deals with large numbers of accounts and
  823. performance problems associated with looking them up.
  824.  
  825.  
  826. 1.403: How do I put my own text into InfoExplorer?
  827.  
  828. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  829. InfoCrafter that allows you to do that.
  830.  
  831.  
  832. 1.404: InfoExplorer ASCII key bindings 
  833. From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
  834.  
  835. If you just press 'Return' when it starts up, with 'Basic Screen
  836. Operations' highlighted, you'll get some help.
  837.  
  838. If you look long enough, you'll find a page named 'Using Keys and Key
  839. Sequences in the InfoExplorer ASCII Interface'.  It describes the key
  840. sequences and actions.  Here are a few to get you started.
  841.  
  842. Keys       Action
  843.  
  844. Ctrl-W     Moves between the Navigation screen and the Reading screen.
  845. If the Navigation screen is displayed, you can press Ctrl-W to display
  846. the Reading screen.  If the Reading screen is displayed, you can press
  847. Ctrl-W to display the Navigation screen.
  848.  
  849. Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
  850. located in the text area of the screen, you can press Ctrl-O to make the
  851. menu bar active.  If the menu bar is already active, you can press
  852. Ctrl-O to make it inactive, which moves the text cursor to the text area.
  853.  
  854. Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
  855. menu is not displayed and you press the Right Arrow key, the next menu
  856. bar option is displayed in reverse video.
  857.  
  858.  
  859. 1.405: How can I add new man pages to the system?
  860. From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
  861.  
  862. Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
  863. man page.  Unter AIX 3.1.10, /usr/lib/makewhatis can be used to update
  864. the makewhatis-database /usr/man/whatis so apropos and whatis know about
  865. the added manpages.  /usr/lib/makewhatis should be available on all 3.2
  866. versions.
  867.  
  868. ______________________________________________________________________________
  869. 1.500  Which release of X11 do I have?
  870.  
  871. Run 'lslpp -h X11rte.obj'.
  872. If your output has a line similar to:
  873.  
  874.             01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root
  875.  
  876. you have X11 R4.  If your output has a line similar to:
  877.  
  878.     U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root
  879.  
  880. you have X11 R5.
  881. Some people also call these AIXwindows 1.2.0 and 1.2.3.
  882.  
  883.  
  884. 1.501: How to prevent ctrl-alt-backspace from killing the X session
  885.  
  886. Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.
  887.  
  888.  
  889. 1.502: Who has a termcap/terminfo source for the HFT console?
  890.  
  891. The console used on the RISC System/6000, PS/2 and RT can be used as a
  892. terminal on another system with the termcap below.  You can find this
  893. and other termcaps in /lib/libtermcap/termcap.src, including IBM
  894. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  895. This termcap can also be used from an aixterm window.
  896.  
  897. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  898.     :co#80:li#25:am:ht:\
  899.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  900.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  901.     :bs:sf=\E[S:ec=\E[%dX:\
  902.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  903.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  904.     :im=\E[4h:ei=\E[4l:mi:\
  905.     :dm=\E[4h:ed=\E[4l:\
  906.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  907.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  908.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  909.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  910.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  911.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  912.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  913.  
  914.  
  915. 1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
  916. From: VRBASS@ATLVMIC1 (Vance R. Bass)
  917.  
  918. You can look at PostScript files using either "xpreview" (which
  919. comes with the operating system in the optionally installable text
  920. formatting services) or you can get Ghostscript and Ghostview from a
  921. comp.sources.x server and build it yourself.
  922.  
  923. >From the "xpreview" man page:
  924. The xpreview command is an AIXwindows 1.2- and Motif 1.1-based application
  925. that displays output from the troff command on an AIXwindows display. The
  926. The troff command output file must be prepared for any one of the devX100,
  927. devX100K or devpsc devices. The xpreview command also displays PostScript
  928. language files that begin with %! (percent sign and exclamation mark).
  929.  
  930. "dpsexec" is NOT intended to be a full-service document browser, but
  931. rather a simple DPS code debugger.  If you insist on using it, you can
  932. edit your PS code to remove the "showpage" (which will reset dpsexec
  933. and clear the window) to view single-page files.  It does not handle
  934. multi-page files gracefully.
  935.  
  936.  
  937. 1.504: unix:0 vs `hostname`:0
  938.  
  939. 1.) Is there any way to get the machine to check its local host table
  940.     first without renaming resolv.conf?
  941.  
  942. From: mcguire@selway.umt.edu (Charles J McGuire)
  943.  
  944.   Not that I know of.  Under SunOS and Ultrix you can specify, check
  945.   /etc/hosts, then NIS, then DNS.  On our AIX machines, I have a cron job
  946.   that checks the integrity of both the primary and secondary
  947.   nameservers every 5 minutes.  If they're gone, the cron pgm renames
  948.   resolv.conf.  The pgm continues to check the servers.  When they're
  949.   back, it moves resolv.conf back.  Even with this arrangement, I need
  950.   to configure two resolv.conf files that switch the order of the
  951.   primary and secondary servers if the primary goes away.  If the
  952.   primary is unavailable, queries can still take a while to time out on
  953.   the primary, before querying the secondary.  This method is not very
  954.   elegant, but it does the job.  Things are a little unstable during the
  955.   transitions depending on when the servers go away relative to when the
  956.   cron pgm runs - not to mention slight differences in clock times.
  957.  
  958. 2.) How do you tell X applications where you are if the console display 
  959.     is unix:0?
  960.  
  961. From: crow@waterloo.austin.ibm.com (David L. Crow)
  962.  
  963.   I would suggest that if you have R5, use ":<display>.<screen>".  I do
  964.   not believe that R4 clients will understand :0, so I would suggest
  965.   unix:0 for them.
  966.  
  967.   Without specifying unix or the hostname, you will get the fastest
  968.   transport mechanism.  While currently there are only two transport
  969.   methods in the AIXwindows X server (Unix sockets and TCP sockets),
  970.   many vendors are looking at using shared memory as a transport method. 
  971.   If you use :0 (or :0.0 or :1, etc.), then you should get the best
  972.   performance regardless of the available transport methods.
  973.  
  974. 3.) Is there a significant performance penalty incurred by
  975. using `hostname`:0 as DISPLAY?
  976.  
  977.   Yes! Using unix:0, you are using Unix sockets.  These are much faster
  978.   than their TCP socket counterparts.
  979.  
  980.  
  981. 1.505: VT100 key bindings for aixterm
  982. From: haedener@iac.unibe.ch (Konrad Haedener)
  983.  
  984. Add this to your .Xdefaults file and start your VAX session with
  985. 'aixterm -v -name vt100 -e telnet MYVAXHOST'
  986.  
  987. -----
  988. vt100.foreground: Wheat
  989. vt100.background: MidnightBlue
  990. vt100.font: Rom14.500
  991. vt100.geometry: 80x25+0+0
  992. vt100.vt102: true
  993. vt100.fullcursor: false
  994. vt100.pointerColor: coral
  995. vt100.cursorColor: gray100
  996. vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
  997.                        <Key>F2: string(0x1b) string("OQ") \n\
  998.                        <Key>F3: string(0x1b) string("OR") \n\
  999.                        <Key>F4: string(0x1b) string("OS") \n\
  1000.                        <Key>KP_0: string(0x1b) string("Op") \n\
  1001.                        <Key>KP_1: string(0x1b) string("Oq") \n\
  1002.                        <Key>KP_2: string(0x1b) string("Or") \n\
  1003.                        <Key>KP_3: string(0x1b) string("Os") \n\
  1004.                        <Key>KP_4: string(0x1b) string("Ot") \n\
  1005.                        <Key>KP_5: string(0x1b) string("Ou") \n\
  1006.                        <Key>KP_6: string(0x1b) string("Ov") \n\
  1007.                        <Key>KP_7: string(0x1b) string("Ow") \n\
  1008.                        <Key>KP_8: string(0x1b) string("Ox") \n\
  1009.                        <Key>KP_9: string(0x1b) string("Oy") \n\
  1010.                        <Key>KP_Divide: string(0x1b) string("OQ") \n\
  1011.                        <Key>KP_Multiply: string(0x1b) string("OR") \n\
  1012.                        <Key>KP_Subtract: string(0x1b) string("OS") \n\
  1013.                        <Key>KP_Add: string(0x1b) string("Om") \n\
  1014.                        <Key>KP_Enter: string(0x1b) string("OM") \n\
  1015.                        <Key>KP_Decimal: string(0x1b) string("On") \n\
  1016.                        <Key>Next: string(0x1b) string("Ol") \n\
  1017.                        <Key>Left: string(0x1b) string("OD") \n\
  1018.                        <Key>Up: string(0x1b) string("OA") \n\
  1019.                        <Key>Right: string(0x1b) string("OC") \n\
  1020.                        <Key>BackSpace : string(0x7f) \n\
  1021.                        <Key>Down: string(0x1b) string("OB")
  1022.  
  1023. You should also add
  1024.  
  1025. XENVIRONMENT=$HOME/.Xdefaults
  1026. export XENVIRONMENT
  1027.  
  1028. to your .profile.
  1029.  
  1030. ______________________________________________________________________________
  1031. 1.600: My named dies frequently, why?
  1032.  
  1033. Running on 3.2, named dies frequently on network's primary name server.
  1034.  
  1035. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  1036.  
  1037. Try the following:
  1038.  
  1039.      stopsrc -s named        # stop running named
  1040.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  1041.      /etc/named ...        # don't use smit to start named
  1042.  
  1043. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  1044. the same effect, but I'm not sure.
  1045.  
  1046. [According to John, the problem is malloc() in the named code. He
  1047.  also suggests using Berkeley's bind, which he has ported and can be
  1048.  ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
  1049.  
  1050. Two ptfs should fix this problem. Get U412332 and U414752.
  1051.  
  1052.  
  1053. 1.601: How do I trace ethernet packets on an AIX system?
  1054. From: afx@muc.ibm.de (Andreas Siegert)
  1055.  
  1056. Do the following:
  1057.  
  1058.      iptrace -i en0 /tmp/ipt
  1059.  
  1060. The iptrace backgrounds.  Find its process id and kill it when you are
  1061. ready.  Then run
  1062.  
  1063.      ipreport -rns /tmp/ipt >/tmp/ipr
  1064.  
  1065. and look at the output.  The current version of Info does not document
  1066. the r, n and s options but they are quite useful for layering the output.
  1067.  
  1068.  
  1069. 1.602 What is the authorized way of starting automount at boot time?
  1070. From: curt@ekhadafi.austin.ibm.com (Curt Finch)
  1071.  
  1072. I put this in my /etc/inittab:
  1073.  
  1074. automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
  1075.  
  1076. I hereby dub it authorized.
  1077.  
  1078.  
  1079. 1.603: How do I set a tty port for both dial-in and dial-out?
  1080.  
  1081. Set the mode of the tty to be either 'shared' or 'delayed'. 
  1082.  
  1083.  
  1084. 1.604: How to move or copy whole directory trees across a network
  1085.  
  1086. The following command will move an entire directory tree across a network 
  1087. while preserving permissions, uids and gids.
  1088.  
  1089.       $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
  1090.  
  1091. Explanation:
  1092.  
  1093. The tar-create is rsh'd to the remote system and is written to
  1094. stdout (the pipe).
  1095.  
  1096. The local system is extracting the tar that is being read from
  1097. stdin (the pipe).
  1098.  
  1099.  
  1100. 1.605: How can I send mail to hosts that cannot be pinged?
  1101. From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)
  1102.  
  1103. AIX 3.2 as shipped is configured to only send mail to mail addresses
  1104. which include a host name.  Many organizations use a mail address whose
  1105. "host name" part is not a host name (technically an MX name).  To change
  1106. the configuration of the AIX mailer, login as root.  Then edit the file
  1107. /etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
  1108. the line which reads:
  1109.     # OK MX
  1110.  
  1111. Now rebuild the machine readable form of the configuration with
  1112.     sendmail -bz
  1113.  
  1114. and finally restart signal sendmail to load the new configuration by one
  1115. of the following:
  1116.      reboot
  1117. or
  1118.      stopsrc -s sendmail
  1119.      startsrc -s sendmail
  1120. or 
  1121.      kill -1 `cat /etc/sendmail.pid`
  1122.  
  1123.  
  1124. 1.606: How to setup dialup SLIP
  1125. From: marvin@tornado.oche.de (Christian Bode)
  1126.  
  1127. If you don't have problems with slattach you should have PTF 
  1128. bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
  1129. ifconfig commands to setup your slip-device (for example sl0).
  1130.  
  1131. 1. Create a group called slip.
  1132.  
  1133. 2. Create a user slip with smit like this:
  1134.                                                      [Entry Fields]
  1135. * User NAME                                          [slip]
  1136.   ADMINISTRATIVE User?                                true
  1137.   User ID                                            []
  1138.   LOGIN user?                                         true
  1139.   PRIMARY group                                      [slip]
  1140.   Group SET                                          [slip]
  1141.   ADMINISTRATIVE groups                              [system]
  1142.   SU groups                                          [slip]
  1143.   HOME directory                                     [/home/slip]
  1144.   Initial PROGRAM                                    [/bin/sh]
  1145.   User INFORMATION                                   [SLIP-Dialup]
  1146.   Another user can SU to user?                        false
  1147.   User can RLOGIN?                                    true
  1148.   TRUSTED PATH?                                       nosak
  1149.   Valid TTYs                                         [/dev/tty1]
  1150.   AUDIT classes                                      []
  1151.   PRIMARY authentication method                      [SYSTEM]
  1152.   SECONDARY authentication method                    [NONE]
  1153.   Max FILE size                                      [2097151]
  1154.   Max CPU time                                       [-1]
  1155.   Max DATA segment                                   [262144]
  1156.   Max STACK size                                     [65536]
  1157.   Max CORE file size                                 [2048]
  1158.   Max physical MEMORY                                [65536]
  1159.   File creation UMASK                                [022]
  1160.   EXPIRATION date (MMDDhhmmyy)                       [0]
  1161.  
  1162. 3. Create a tty with getty on it:
  1163.                                    Add a TTY
  1164.                                                [Entry Fields]
  1165.   TTY type                                     tty
  1166.   TTY interface                                rs232
  1167.   Description                                  Asynchronous Terminal
  1168.   Parent adapter                               sa0
  1169. * PORT number                                  [s1]
  1170.   BAUD rate                                    [38400]
  1171.   PARITY                                       [none]
  1172.   BITS per character                           [8]
  1173.   Number of STOP BITS                          [1]
  1174.   TERMINAL type                                [dumb]
  1175.   STATE to be configured at boot time          [available]
  1176.   DMA                                          on
  1177.   Read Trigger                                 0,1,2,3
  1178.   Transmit buffer count                        [16]
  1179.   Name of initial program to run               [/etc/getty]
  1180.  
  1181.   Note: The following attributes are only applicable if /etc/getty is
  1182.         specified as the initial program to run.
  1183.  
  1184.   Enable program?                              respawn
  1185.   Run level                                    2
  1186.   Enable LOGIN                                 share
  1187.   TIME before advancing to next port setting   [0]
  1188.   STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  1189.   STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  1190.   RUN shell activity manager                   no
  1191.   Optional LOGGER name                         []
  1192.  
  1193. 4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
  1194.  
  1195. 5. Here is the the .profile for User slip to manage dialups
  1196.  
  1197. PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/local/bin:.
  1198.  
  1199. ENV=$HOME/.kshrc
  1200. HISTSIZE=128
  1201.  
  1202. export PATH ENV HISTSIZE
  1203. #
  1204. # Search for a LCK-File for our tty if there is one
  1205. #
  1206.  
  1207. if test -f /etc/locks/LCK..tty1
  1208. then
  1209.   SHPID=`cat /etc/locks/LCK..tty1`
  1210. else
  1211.  echo `date` " No LCK-File !!!" >>slip.log
  1212.  exit 64
  1213. fi
  1214.  
  1215. #
  1216. # Search for our own Shell to get the PID for checking against LCK-File
  1217. #
  1218.  
  1219. SH2PID=`ps -aef |
  1220.         sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-sh *$/\1/p`
  1221.  
  1222. #
  1223. # Is it the the same PID as in the LCK File so that we can start working ??
  1224. #
  1225.  
  1226. if test $SHPID = $SH2PID
  1227. then
  1228. #  remove the LCK-File because slattach does not like it.
  1229.    rm -rf /etc/locks/LCK..tty1
  1230. #  Add RTS/CTS Handshakeing to our own tty
  1231.    stty add rts
  1232. #  Startup slattach. Slattach has to have mode 4755 to be started up !!!
  1233.    /usr/sbin/slattach tty1
  1234. #  Just say that we are up.
  1235.    echo `date` " Starting up slip-daemon " >>slip.log
  1236. #  leave slattach enough time to startup
  1237.    sleep 4
  1238. else
  1239. # Something must be wrong with the LCK-File
  1240.   SH3PID=`ps -aef | awk ' {print $2}' | grep $SHPID`
  1241.  
  1242.   if test ."$SH3PID" = .""
  1243.   then
  1244.     SH3PID="NO_SUCH_PROCESS"
  1245.   fi
  1246.  
  1247.   if test $SHPID = $SH3PID
  1248.     then
  1249. #  There is a living process which owns the LCK-File !!
  1250.        echo `date` " Can't remove LCK-File, not owner !!!" >>slip.log
  1251.        exit 64
  1252.     else
  1253. #   Who the hell didn't remove the LCK-File (should never happen)
  1254.        echo `date` " LCK-File with no owner found !!!" >>slip.log
  1255.        exit 64
  1256.     fi
  1257. fi
  1258.  
  1259. # Get the pid of slattch so that we can kill him later on.
  1260. SLPID=`ps -aef |
  1261.  sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-.*\/usr\/sbin\/slattach tty1 *$/\1/p`
  1262.  
  1263. # Kill slattach if we get a signal 1 (Carrier Lost ? / Otherside-slattach
  1264.   terminated )
  1265. trap "kill $SLPID; exit 0" 1
  1266.  
  1267. # We  will have a nice sleep and nice dreamings
  1268. while sleep 256
  1269. do
  1270. :
  1271. done
  1272.  
  1273. ______________________________________________________________________________
  1274. 1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?
  1275. From: drr
  1276.  
  1277. A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
  1278.     config will provide SCSI-1 performance.
  1279.  
  1280. B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
  1281.     config will provide SCSI-1 performance.
  1282.  
  1283. C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
  1284.     adapter.  All devices will have SCSI-1 performance.
  1285.  
  1286. D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
  1287.     adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
  1288.     and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).
  1289.  
  1290.  
  1291. 1.901: How to get your keyboard back after unplugging it from the 6000
  1292. From: Mickey Coggins and Anne Serre
  1293.  
  1294. When you unplug your keyboard from a running system, and plug it back
  1295. in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
  1296. don't work as designed.
  1297.  
  1298. Solution: Type at the command line
  1299.  
  1300.         /usr/lpp/diagnostics/da/dkbd
  1301.  
  1302. Your screen goes black, you hear a few beeps, and your keyboard is reset.
  1303. It works with any environment, Xwindows, hft, NLS...
  1304.  
  1305.  
  1306. 1.902: How do I set up pcsim, the DOS emulator?
  1307.  
  1308. You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
  1309. 4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
  1310. but I have no problems with it. Just don't try to be fancy with the UMB 
  1311. and memory manager stuff.
  1312.  
  1313. With a bootable DOS disk in the drive, do:
  1314. $touch /u/dosdrive (this is the AIX file for DOS emulation)
  1315. $pcsim -Adiskette 3 -Cdrive /u/dosdrive
  1316. You would now get an A prompt. Type:
  1317. A> fdisk
  1318. Create the virtual C drive of whatever size you choose. Make it large 
  1319. enough for your needs since you cannot enlarge it later.
  1320. A> format c: /s (to format the virtual C drive)
  1321. Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).
  1322.  
  1323. Now create a simprof file. Following is a starter:
  1324.  
  1325. Adiskette   : 3
  1326. Cdrive      :/u/dosdrive
  1327. lpt1        : name of printer queue
  1328. refresh     : 50
  1329. dmode       : V
  1330. mouse       : com1
  1331.  
  1332. You can now start pcsim anytime by typing pcsim. Make sure no floppies
  1333. are in the drive. For further information, refer to publication
  1334. SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
  1335.        
  1336.  
  1337. 1.903: How do I transfer files between AIX and DOS disks?
  1338.  
  1339. In one of the bos extensions are commands for transferring files between
  1340. DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
  1341. and dosformat. Many users have mentioned that the mtools package from
  1342. prep.ai.mit.edu is better than the native AIX programs.
  1343.  
  1344.