home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / aix-faq / part2 < prev    next >
Encoding:
Internet Message Format  |  2000-11-03  |  59.4 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!howland.erols.net!newsfeed.skycache.com!Cidera!nntp-out.teleweb.pt!news.teleweb.pt!not-for-mail
  2. From: bofh@mail.teleweb.pt
  3. Newsgroups: comp.unix.aix,comp.answers,news.answers
  4. Subject: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
  5. Supersedes: <aix-faq-2-973024721@mail.teleweb.pt>
  6. Followup-To: comp.unix.aix
  7. Date: 2 Nov 2000 15:34:51 +0100
  8. Organization: What ?
  9. Lines: 1513
  10. Approved: news-answers-request@mit.edu
  11. Distribution: world
  12. Expires: 07 Dec 2000 15:25:21
  13. Message-ID: <aix-faq-2-973175121@mail.teleweb.pt>
  14. References: <aix-faq-1-973175121@mail.teleweb.pt>
  15. Reply-To: bofh@mail.teleweb.pt (Jose Pina Coelho)
  16. NNTP-Posting-Host: p140a55.teleweb.pt
  17. X-Trace: srvlis16.teleweb.pt 973176237 1144 212.16.140.55 (2 Nov 2000 14:43:57 GMT)
  18. X-Complaints-To: abuse@teleweb.pt
  19. NNTP-Posting-Date: 2 Nov 2000 14:43:57 GMT
  20. Summary: This posting contains AIX Frequently Asked Questions
  21.          and their answers.  AIX is IBM's version of Unix.
  22. Keywords: AIX RS/6000 questions answers
  23. Xref: senator-bedfellow.mit.edu comp.unix.aix:191689 comp.answers:42947 news.answers:195008
  24.  
  25. Posted-By: auto-faq 3.3 (Perl 5.005)
  26. Archive-name: aix-faq/part2
  27. Revision: 1.6 2000/10/10 19:59:22
  28. Posting-Frequency: monthly
  29.  
  30. ------------------------------
  31.  
  32. Subject: 1.200: Some info about tape backups
  33. From: Craig Anderson
  34.  
  35. The following supplements the information on rmt devices in
  36. InfoExplorer. It is based on my own personal experience with IBM tape
  37. drives running on AIX 3.1. No warranty is expressed or implied.
  38.  
  39. CONFIGURING THROUGH SMIT:
  40.     BLOCK size (0=variable length)        (ALL)
  41.     Sets the tape block size.  When reading, the block size must be
  42.     set to the block size set when the tape was written.  When
  43.     using some commands, tapes written with ANY block size can be
  44.     read if the block size is set to 0 (variable length) (see
  45.     "BLOCK SIZES" below).
  46.  
  47.     Use DEVICE BUFFERS during writes        (ALL)
  48.     Set to yes, the device will buffer data internally on writes.
  49.     This greatly improves performance, but under certain cases may
  50.     be undesirable since the data is not written to tape before
  51.     returning a good indication.
  52.  
  53.     Use EXTENDED file marks            (8mm only)
  54.     Extended file marks take up much more space than short (or
  55.     non-extended) file marks.  But extended file marks can be
  56.     overwritten, allowing data not at the beginning of tape to be
  57.     overwritten (see "FILE MARKS" below).
  58.  
  59.     RETENSION on tape change or reset        (1/4" only)
  60.     If set to "no" then the tape will not be retentioned
  61.     automatically when the tape is inserted.  Note that this will
  62.     take effect only after the device is used.
  63.  
  64.  
  65. FILE MARKS:
  66.      Tape devices support multiple tape files.  Tape files are the
  67.      result of a backup/cpio/tar/dd type command, where the device is
  68.      opened, written to, and closed.  Because tapes allow large
  69.      quantities of data to be written on a single tape, several backups
  70.      (that is, tape files), may be combined on one physical tape.
  71.      Between each tape file is a "tape file mark" or simply "file
  72.      mark".  These file marks are used by the device driver to indicate
  73.      where one tape file ends and another begins.
  74.  
  75.                               B       E
  76.                    <-------   O       O   ------->
  77.                               T       T
  78.               __ ___________________________ ______________
  79.      physical | \            |       |      \             |physical
  80.      beginning|  \           | tape  |       \            | end
  81.        of     |   \          | file  |        \           |  of
  82.       tape    |    \         | mark  |         \          | tape
  83.               |_____\________|_______|__________\_________|
  84.  
  85.      Note that there is a distinction between the beginning of tape
  86.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  87.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  88.      1" command will move only to the EOT side of the same file mark.
  89.  
  90.      With the 1/4" tape drive, writing can only take place
  91.      sequentially, or after blank tape has been detected.  You cannot
  92.      write over data on the tape (except at BOT).  If you wish to add
  93.      data to a tape which has been written and then rewound you should
  94.      space forward file mark until an error occurs.  Only then can
  95.      you start writing again.
  96.  
  97.      With an 8mm tape drive, writing can only take place before blank
  98.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  99.      have been made on one tape and you wish to overwrite one of the
  100.      backups, position the tape to the place you wish to start writing
  101.      and issue the following commands:
  102.     tctl bsf 1
  103.     tctl eof 1
  104.      The first command skips back to the BOT side of the same file
  105.      mark.  The second command rewrites the file mark (writing is
  106.      allowed before extended file marks).  The erase head will erase
  107.      data ahead of the write head, so that after writing the file mark
  108.      the head will be positioned before blank tape.  Only after this
  109.      may you start writing over data in the middle of the tape.  (All
  110.      data beyond where you are currently writing will be lost).  Note
  111.      that you cannot write over short file marks.  In order for this to
  112.      work, the tape must have been written with extended file marks
  113.      (use smit to change this).
  114.  
  115.      With the 9-track drive writing can take place anywhere on the
  116.      tape although overwriting single blocks of data is not supported.
  117.  
  118.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  119.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  120.      and take up to 1.5 seconds to write.
  121.  
  122. BLOCK SIZES:
  123.      When data is written to tape it is written in blocks.  The blocks
  124.      on a tape are separated by inter-record gaps.  It is important to
  125.      understand the structure of the written tape in order to
  126.      understand the problems which can occur with changing block
  127.      sizes.
  128.  
  129.      In fixed block size mode all blocks on the tape are the same
  130.      size.  They are the size of the block size set in the device
  131.      configuration.  All read()s and write()s to the tape drive must be
  132.      a multiple of the fixed block size.
  133.  
  134.      In fixed block mode a read() will return as many blocks as needed
  135.      to satisfy the read() request.  If a file mark is encountered
  136.      while reading the tape only the data up until the file mark will
  137.      be returned.
  138.  
  139.      It is not possible for the tape drive to read a tape whose block
  140.      size is not the same as the block size in the device
  141.      configuration.  (Unless the device configuration is in variable
  142.      size blocks.)
  143.  
  144.      In variable block size (0) mode, the blocks written on the tape
  145.      are the size of the read() and write() requests to the device
  146.      driver.  In this case, the actual block sizes on the tape can be
  147.      changed using the options to the backup commands (tar -C, cpio -C,
  148.      backup -C).
  149.  
  150.      In variable mode, read() requests greater than size of the block
  151.      on the tape will return only the data from the next block on the
  152.      tape.  It is this feature that allows tapes written in any block
  153.      size (fixed or variable) to read with the dd command (the output
  154.      from the dd command may be piped to restore, tar, or cpio for
  155.      example.)  Note that backup, tar, and cpio cannot read all tapes
  156.      by using a large block size because they assume there is an error
  157.      if they get a short read().
  158.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  159.  
  160.      The tape head is always positioned at an inter-record gap, file
  161.      mark, or blank tape after reading or writing.
  162.  
  163.      With the 8mm tape drive, using a fixed block size which is not a
  164.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  165.      internally in 1K blocks.  It simulates the effect of variable
  166.      block sizes, but, for example, using a fixed block size of 512
  167.      bytes (or using variable block size and write()ing 512 bytes at a
  168.      time) wastes one half of the tape capacity and gives only one half
  169.      the maximum transfer rate.
  170.  
  171.      To figure out a tape's actual block size try:
  172.  
  173.      1). Set the tape to variable block size.
  174.      2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
  175.      3). "ls -l /tmp/dummy"
  176.      4). The number of bytes in "/tmp/dummy" is the physical block size.
  177.  
  178. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  179.      Many tape drives support both variable and fixed block sizes.
  180.  
  181.      Variable block mode writes block sizes the size of the write
  182.      command issued (tar and backup specify this with the -b option). 
  183.      In fixed mode, block sizes are fixed and all writes must be a
  184.      multiple of the fixed block size.
  185.  
  186.      Unix often internally chops larger reads and writes up into
  187.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  188.      doing the actual reads and writes.  This means reads and writes of
  189.      64K bytes are often broken up into a 65535 byte record and a 1
  190.      byte record (In fixed mode the write will fail).  Block sizes >=
  191.      64K (-C128 and greater) should be avoided for this reason.  AIX
  192.      does not break up read and write requests, but be aware of the
  193.      situation on other machines.
  194.  
  195.      If the tape is written in an unknown block size then set the
  196.      device configuration in smit to use variable size blocks, use the
  197.      "dd" command with a large input block size, and pipe it to the
  198.      restore command.  For example:
  199.       chdev -l rmt0 -a block_size=0
  200.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  201.  
  202. ------------------------------
  203.  
  204. Subject: 1.201: How do I do remote backup?
  205.  
  206. There seems to be several ways of doing this.  The first approach is a
  207. one-liner to allow tar to reference another machine's device.  The
  208. second is more complete but uses a similar approach.  The latest
  209. addition to this section claims to be able to support mksysb on a
  210. remote machine.  Thanks to all the contibutors.
  211.  
  212.   tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
  213.  
  214. [Ed.: The usave.sh script has been moved to section 8.06.  I've verified
  215. this script works fine. However, it may be slow for large filesystems
  216. since it creates a temp file of filenames in /tmp.]
  217.  
  218. There are also several commercial solutions.  One is IBM's SYSBACK/6000
  219. product.  See Question 1.209 for more information.
  220.  
  221. Open Microsystems sells a product called DistribuTAPE which supports
  222. mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
  223. supports remote tape drives by placing a pseudo tape driver on the
  224. client system, and a server daemon on the server.  More information at
  225. http://www.openmic.com/
  226.  
  227. ------------------------------
  228.  
  229. Subject: 1.202: How do I backup a multi-disk volume group?
  230. From: pack@acd.ucar.edu (Daniel Packman)
  231.  
  232. [ Ed.: I have not verified this procedure. I would actually recommend
  233.   NOT to have one volume group span multiple disks unless you really
  234.   need such big logical volumes. ]
  235.  
  236.   1. If you have a set of three or more disks in a volume group
  237.      (typically 3 for 5xx machines with three internal drives;
  238.      with only two, the procedures outlined here have to be modified
  239.      to ignore the fact that you don't have a quorum in the volume group)
  240.  
  241.   2. If one drive has failed (usually only one fails at a time :-) )
  242.  
  243. It is possible to go through a service boot (the volume group is called
  244. rootvg and one of the 2 good disks on it is called hdisk0):
  245.  
  246.   importvg -y rootvg hdisk0
  247.   varyonvg -f -n -m1 rootvg
  248.  
  249. These commands will work, but give error messages. If you wish to mount
  250. a user filesystem, say /u on logical volume /dev/lv00, then
  251.  
  252.   mount -f /dev/lv00 /v
  253.  
  254. will work only if jfslog, the journaled file system log device, is not
  255. on the damaged disk. If it is, you must (and can in any case) mount the
  256. filesystem read-only:
  257.  
  258.   mount -f -r /dev/lv00 /v
  259.  
  260. This crucial and rather obvious point baffled several level 3 support
  261. personnel at Austin as well as myself for almost a week. Once the file
  262. system(s) of interest are available, they can be saved to tape for
  263. restoration later. Of course, one can expect only about two thirds of a
  264. filesystem to be recoverable if it spans all 3 physical disks. One
  265. other point to remember is that the standard boot procedure from floppy
  266. includes the restore command but does not include the backup command.
  267.  
  268. *****************************************************************************
  269. * If you do not have other RS6000 machines at your site it is imperative    * 
  270. * that you either build a bootable tape which includes either restore or    * 
  271. * tar or cpio (a bootable floppy set will not have enough space) or at the  *
  272. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
  273. * should be created with backup -ivq so that its contents can be read into  *
  274. * the memory resident system after booting.                                 *
  275. *****************************************************************************
  276.  
  277. All is not lost if tar, cpio or backup are available on an undamaged
  278. disk that can be mounted. Since tar and cpio are in /bin, they may both
  279. very well be unavailable.
  280.  
  281. It is a very good idea for those who have tape devices to build a
  282. bootable tape with their desired extra commands in it. Follow the
  283. instructions from IBM but add your desired commands to the following
  284. three files:
  285.  
  286.     /usr/lpp/bosinst/tape2
  287.     /usr/lpp/bosinst/diskette/boot2
  288.     /usr/lpp/bosinst/diskette/inslist
  289.  
  290. If you have anything other than a minimum memory configuration, you
  291. should be able to add many commands.
  292.  
  293. ------------------------------
  294.  
  295. Subject: 1.203: How do I put multiple backups on a single 8mm tape?
  296. From: kerm@mcnc.org (Cary E. Burnette)
  297.  
  298. There are two possible solutions to this, both of which use /dev/rmt0.1
  299. which is non-rewinding.
  300.  
  301. SOLUTION #1
  302. -----------
  303.  
  304. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  305. no-rewind device, using either rdump or backup (both by name & inode
  306. work). Using rdump or backup "byinode" both generate the message that
  307. the tape is rewinding but actually do not. This is an example that
  308. works on my system:
  309.  
  310. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  311. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  312. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  313.  
  314. where I am implementing the command from host.
  315. To restore a table of contents of the first I would use 
  316.  
  317. # restore -f /dev/rmt0.1 -s1 -tv
  318.  
  319. where the -s1 flag tells restore to go to the first record on the tape. 
  320. Type the exact command again to get the second record. The -s(Number)
  321. means go to Number record from this spot. It works pretty well.
  322.  
  323.  
  324. SOLUTION #2
  325. -----------
  326. Steve Knodle, Educational Resources Center, Clarkson University
  327.  
  328. I use:
  329. ------------------- Dump.sh --------------------
  330. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  331. set -x
  332. LEVEL=$1
  333. shift
  334.  
  335. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  336. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  337. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  338. tctl -f /dev/rmt0 rewind
  339.  
  340. touch /usr/local/dumps/Contents.$CONTENTSFILE
  341. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  342. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  343. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  344. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  345. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  346. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  347. tctl -f /dev/rmt0 rewind
  348.  
  349. I process the table-of-contents first by a little program that does
  350. common prefix encoding, and then compress.
  351.  
  352. This gives a table of contents file I can keep on-line until the tape
  353. is reused.
  354.  
  355.  
  356. Solution #3
  357. -----------
  358.    mount | grep jfs | cut -c27- | cut -d" " -f1 | \
  359.      xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1
  360.  
  361. ------------------------------
  362.  
  363. Subject: 1.204: How can I make an exact duplicate of a tape over the network?
  364.  
  365. The challenge here is not to have to create a temporary file (disk space
  366. limitation) and work across heterogeneous networks.
  367.  
  368. This script might work:
  369.  
  370. LOCAL=/dev/tape_dev
  371. REMOTE=/dev/tape_dev
  372. dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
  373.  
  374.  
  375. From: pack@acd.ucar.edu (Daniel Packman)
  376.  
  377. Daniel provides the following perl script to convert from the known
  378. world's function codes to AIX for compatibility.
  379.  
  380. #!/bin/perl
  381. # Wrapper to convert input rmt requests to
  382. # AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
  383. # I0 MTWEOF -> I10  STWEOF write and end-of-file record
  384. # I1 MTFSF  -> I11  STFSF  forward space file
  385. # I2 MTBSF  -> I12  STRSF  reverse space file
  386. # I3 MTFSR  -> I13  STFSR  forward space record
  387. # I4 MTBSR  -> I14  STRSR  reverse space record
  388. # I5 MTREW  -> I6   STREW  rewind
  389. # I6 MTOFFL -> I5   STOFFL rewind and unload tape
  390. # I7 MTNOP  -> I0   (no-op? should ignore following count)
  391. # I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
  392. # I9 MTERASE-> I7   STERASE erase tape, leave at load point
  393. #I10 MTEOM (position to end of media ... no ibm equivalent?)
  394. #I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
  395. @iocs = (10,11,12,13,14,6,5,0,8,7);
  396. open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
  397. select(RMT);
  398. $| = 1;
  399. while (<STDIN>) {
  400.   s/(^I)(\d$)/I$iocs[$2]/;
  401.   exit 0 if $_ =~ /^[Qq]/;
  402.   print RMT $_ ; }
  403. exit 0;
  404.  
  405. ------------------------------
  406.  
  407. Subject: 1.205: What is tape block size of 0?
  408. From: benson@odi.com (Benson I. Margulies)
  409.  
  410. Tape devices are generally split into two categories: fixed block and
  411. variable block.  1/4" tape is the fixed block, and 8mm is variable.
  412.  
  413. On a fixed block size device, the kernel always sends data to the device
  414. in suitable block size lumps, and varying the size passed to write(2)
  415. (e.g., via the bs option to dd) gives the kernel more data to stream. 
  416. On a variable block size device, the kernel writes to the device
  417. whatever passed to it. On an 8mm, it had better be a multiple of 1024
  418. to get efficient tape usage.
  419.  
  420. AIX has the World's Only Variable Block Size 1/4" tape drive. If you
  421. use SMIT to set the block size to a nonzero value, AIX treats the device
  422. as fixed block size, whether it is or not. By default, 8mm drives are
  423. set to the same size as 1/4", 512 bytes. This is wasteful, but
  424. otherwise mksysb and installp would fail.
  425.  
  426. If you set the block size to 0, the device is treated as variable block
  427. size, and the size passed to write becomes the physical block size. 
  428. Then if you use a sensible block size to dd, all should be wonderful.
  429.  
  430. ------------------------------
  431.  
  432. Subject: 1.206: Resetting a hung tape drive
  433. From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)
  434.  
  435. A process accesses the tape drive. The process stops, exits, or whatever,
  436. but still hold on to the drive. When this happens, the process cannot be
  437. killed by any signal and the tape drive cannot be used by any other
  438. process until the machine is rebooted.
  439.  
  440. The following should help:
  441.  
  442. RESET:
  443.  
  444. AIX, like most UNIX systems has no reset function for tape drives. You
  445. can however send a Bus Device Reset (a standard SCSI message) to the
  446. tape drive using the following piece of code. If the tape drive does
  447. not respond to the BDR, then a SCSI Bus Reset will be sent (and this
  448. will reset every device on the SCSI Bus). SCSI Bus resets are rather
  449. extreme so you should refrain from using this program unnecessarily. 
  450. But there are times (like after you've inserted a jammed/old/bad tape in
  451. an 8mm drive), when there's no other way to reset the device other than
  452. to shutdown and reboot (obviously you can power down and up an external
  453. drive to reset it - and this would be the better choice).
  454.  
  455. This is actually documented in info, but can be hard to find and
  456. there's no complete program.
  457.  
  458. /* taperst: resets the tape drive by sending a BDR to the drive. */
  459. #include <stdio.h>
  460. #include <fcntl.h>
  461. #include <errno.h>
  462. #include <sys/scsi.h>
  463.  
  464. int main(int argc, char **argv)
  465. {
  466.          /* This can be run only by root */
  467.  
  468.          if (argc != 2) {
  469.              fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
  470.              return 1;
  471.          }
  472.  
  473.          if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
  474.              perror(argv[0]);
  475.              return 2;
  476.          }
  477.          return 0;
  478. }
  479.  
  480. ------------------------------
  481.  
  482. Subject: 1.207: How do I restore specific files from a mksysb tape?
  483. From: Marc Pawliger (marc@sti.com)
  484.  
  485. To recover specific files from a backup made with mksysb, try
  486. $ tctl fsf 3
  487. $ tar xvf /dev/rmt0.1 ./your/file/name
  488.  
  489. From: Matt Willman (Willman.matt@cnf.com)
  490.  
  491. The procedure changed with AIX 4, which uses backup instead of tar to
  492. write the tape. For AIX 4 the procedure is as follows:
  493.  
  494. $ tctl fsf 3
  495. $ restore -xvf /dev/rmt0.1 ./your/file/name
  496.  
  497. ------------------------------
  498.  
  499. Subject: 1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
  500. Posted by: bobmet@clam.com (Robert Metcalf)
  501.  
  502. To read a 5Gbyte tape on a 2Gbyte drive, the
  503. tape needs to have been created with a density setting of 20.
  504.  
  505. The following is from IBM's electronic ASKSUPPORT repository:
  506.   
  507.    R: The 7208 011 5 GB tape drive has various density settings which are
  508.       as follows:
  509.   
  510.      +-------+--------------------------+
  511.      | DENSIT| DESCRIPTION              |
  512.      | SETTIN|                          |
  513.      +-------+--------------------------+
  514.      | 140   | Writes in 5.0GB mode and |
  515.      |       | will enable data com-    |
  516.      |       | pression; also, to do    |
  517.      |       | compression you must use |
  518.      |       | "DATA COMPRESSION = yes" |
  519.      +-------+--------------------------+
  520.      | 21    | Writes in 5.0GB mode and |
  521.      |       | will NOT do data com-    |
  522.      |       | pression                 |
  523.      +-------+--------------------------+
  524.      | 20    | Writes in 2.3GB mode and |
  525.      |       | will NOT do data com-    |
  526.      |       | pression                 |
  527.      +-------+--------------------------+
  528.      | 00    | Factory power-on default |
  529.      |       | for 5.0GB data com-      |
  530.      |       | pression mode            |
  531.      +-------+--------------------------+
  532.   
  533.      The density setting of the 7208 011 must be 20 for it to make a tape
  534.      that is readable by the 7208 001.
  535.  
  536.  
  537. ------------------------------
  538.  
  539. Subject: 1.209: What can Sysback do for me?
  540. From: johnsont@austin.ibm.com (Tony Johnson)
  541.  
  542. Sysback provides the flexibility of restoring onto the same system in
  543. the exact same manner, or onto a completely different system with
  544. differnet disk configuration, platform type, kernel, etc, while
  545. reporting any inconsistencies and allowing you to adjust to fit. For
  546. instance, you will get warnings if a particular volume group cannot be
  547. created because the original disks to not exist, or that mirroring
  548. cannot be accomplished because there is no longer enough disk space
  549. because the disks are smaller. You can then select the disks for each
  550. volume group, reduce or add space to filesystems and LVs, exclude
  551. entire VGs or filesystems, etc.  You can even add and delete mirrors,
  552. stripe or un-stripe logical volumes, etc.
  553.  
  554. In addition, all of the Sysback functions can be performed across the
  555. network, including network boot and network install, and you can
  556. perform striped backups across multipel tape drives, use sequential
  557. tape autoloaders, and perform unattended multi-volume backups with
  558. cron.
  559.  
  560. ON AIX 3.2, mksysb does not retain paging space config, disk LV
  561. placement, mirroring, etc.
  562.  
  563. On AIX 4.1, it does these on an EXACT same configuration, but does not
  564. allow any flexibility, and still does not retain non-rootvg volume
  565. groups (although you can now use additional commands to backupa nd
  566. restore these).  mksysb also does not allow you to clone onto
  567. different platforms (i.e.  rspc -> rs6k -> rs6ksmp).
  568.  
  569.  
  570. ------------------------------
  571.  
  572. Subject: 1.210: How can I get my HP 4mm DAT to work?
  573.  
  574. For HP25470/80A DDS:
  575.    MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
  576.    MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1
  577.  
  578. ------------------------------
  579.  
  580. Subject: 1.211: How do I copy DAT tapes?
  581.  
  582. If you have two drives try tcopy(1).  Otherwise the traditional UNIX
  583. approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
  584. Put that in a while loop using a non-rewinding device to do multiple
  585. files.  To use drives from two different machines either get the GNU
  586. dd (bundled with GNU tar) or use something like.
  587.  
  588.   $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b
  589.  
  590.  
  591. ------------------------------
  592.  
  593. Subject: 1.212: How do I speed up backups to DLT tapes?
  594.  
  595. DLT tapes need high data rates to stay in streaming mode. To achieve
  596. higher data rates, use a variable length block size by setting the fixed
  597. length block size to zero. Also use a buffer size of about 64KB for
  598. backup (128 blocks for tar).
  599.  
  600. ------------------------------
  601.  
  602. Subject: 1.300: Some info about the memory management system
  603. From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
  604.  
  605. 1. Does AIX use more paging space than other unix systems?
  606.  
  607. Under many scenarios, AIX requires more paging space than other unix
  608. systems. The AIX VMM implements a technique called "early allocation of
  609. paging space". When a page is allocated in RAM, and it is not a
  610. "client" (NFS) or a "persistent" (disk file) storage page, then it is
  611. considered a "working" storage page. Working storage pages are commonly
  612. an application's stack, data, and any shared memory segments. So, when
  613. a program's stack or data area is increased, and RAM is accessed, the
  614. VMM will allocate space in RAM and space on the paging device. This
  615. means that even before RAM is exhausted, paging space is used. This
  616. does not happen on many other unix systems, although they do keep track
  617. of total VM used.
  618.  
  619. Example 1: 
  620. Workstation with 64mb RAM is running only one small application that
  621. accesses a few small files. Everything fits into RAM, including all
  622. accessed data. On AIX, some paging space will already be used. On
  623. other unix systems, paging space will be 100% free. Clearly, this is an
  624. example that shows where we use more paging space than the other machines.
  625.  
  626. Example 2:
  627.  
  628. Same machine as above, except we are in an environment where many
  629. applications are running with inadequate RAM. Also, the system is
  630. running applications that are started, run, left idle, and not in
  631. constant use. A session of FRAME running in a window, for example. 
  632. What happens is that eventually (theoretically) all applications will be
  633. paged out at least once. On the AIX system and the other systems the
  634. total paging requirements will be the same (assuming similar malloc
  635. algorithm). The major difference is that the AIX system allocated the
  636. paging space pages before they were actually needed, and the other
  637. systems did not allocate them until they were needed. However, most
  638. other systems have an internal variable that gets incremented as virtual
  639. memory pages are used. AIX does not do this. This can cause the AIX
  640. system to run out of paging space (virtual memory), even though malloc()
  641. continues to return memory. This "feature" allows sparse memory
  642. segments to work, but requires that all normal users of malloc()
  643. (sbrk()) know how much virtual memory will be available (actually
  644. impossible), and to handle a paging space low condition. A big problem. 
  645. There are some pretty obvious pros and cons to both methods of doing
  646. Virtual Memory.
  647.  
  648. 2. How much paging space do I need?
  649.  
  650. Concerning the rule of thumb of having 2 times RAM for paging space:
  651. this is rather simplistic, as are most rules of thumb.  If the machine
  652. is in a "persistent storage environment", meaning that they have a few
  653. small programs, and lots of data, they may not need even as much as 1
  654. times RAM for paging space.  For example, a 1GB database server running
  655. on a 6000 with 256MB of RAM, and only running about 50MB of "working"
  656. storage does not need 512MB of paging space, or even 256MB.  They only
  657. need the amount of paging space that will allow all their working
  658. storage to be paged out to disk.  This is because the 1GB database is
  659. mostly "persistent storage", and will require little or no paging space. 
  660. Excessive paging space may simply mean wasted disk space.  However,
  661. avoid insufficient paging space.  Tip: Don't have more than one paging
  662. space per disk.  Tip: Put lots of RAM in your system - it will use it.
  663.  
  664. 3. Why does vmstat show no free RAM pages?
  665.  
  666. AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
  667. morning, that file is read into RAM, and left there.  If no other
  668. programs need that RAM, that file will be left in RAM until the machine
  669. is halted.  This means that if you need the file again, access will be
  670. quick.  If you need that RAM, the system will simply use the pages the
  671. file were using. The pages were flushed back to disk earlier.  This
  672. means that you can get a huge speedup in disk access if you have enough
  673. RAM.  For example, a 200MB database will just ease into RAM if you have
  674. a 256MB system.
  675.  
  676. 4. Since vmstat shows no free RAM pages, am I out of RAM?
  677.  
  678. Probably not. Since disk files will be "mapped" into RAM, if vmstat
  679. shows lots of RAM pages FREE, then you probably have too much RAM (not
  680. usual on a RISC System/6000)!
  681.  
  682. 5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?
  683.  
  684. No. The "avm" field tells you how much "Active Virtual Memory" AIX
  685. thinks you are using. This will closely match the amount of paging
  686. space you are using. This number has *ABSOLUTELY* nothing to do with
  687. the amount of RAM you are using, and does *NOT* include your mapped
  688. files (disk files).  The amount of RAM can be determined with
  689. /usr/sbin/bootinfo -r
  690.  
  691. 6. Why does the "fre" field from vmstat sometimes show lots of free
  692.    RAM pages?
  693.  
  694. This will happen after an application that used a lot of RAM via
  695. "working" storage (not NFS storage, and not disk file or "persistent"
  696. storage) exits. When RAM pages that were used by working storage (a
  697. program's stack and data area) are no longer needed, there is no need to
  698. leave them around. AIX completely frees these RAM pages. The time to
  699. access these pages versus a RAM page holding a "sync'd" mapped file is
  700. almost identical. Therefore, there is no need to periodically "flush" RAM.
  701.  
  702. 7. Is the vmstat "fre" field useful?
  703.  
  704. The vmstat "fre" field represents the number of free page frames.  If
  705. the number is consistently small (less than 500 pages), this is normal. 
  706. If the number is consistently large (greater than 4000 pages), then you
  707. have more memory than you need in this machine.
  708.  
  709. ------------------------------
  710.  
  711. Subject: 1.301: How much should I trust the ps memory reports?
  712. From: chukran@austin.VNET.IBM.COM
  713.  
  714. Using "ps vg" gives a per process tally of memory usage for each running
  715. process.  Several fields give memory usage in different units, but these
  716. numbers do not tell the whole story on where all the memory goes.
  717.  
  718. First of all, the man page for ps does not give an accurate description
  719. of the memory related fields.  Here is a better description:
  720.  
  721. RSS - This tells how much RAM resident memory is currently being used
  722. for the text and data segments for a particular process in units of
  723. kilobytes.  (this value will always be a multiple of 4 since memory is
  724. allocated in 4 KB pages).
  725.  
  726. %MEM - This is the fraction of RSS divided by the total size of RAM for
  727. a particular process.  Since RSS is some subset of the total resident
  728. memory usage for a process, the %MEM value will also be lower than actual.
  729.  
  730. TRS - This tells how much RAM resident memory is currently being used
  731. for the text segment for a particular process in units of kilobytes. 
  732. This will always be less than or equal to RSS.
  733.  
  734. SIZE - This tells how much paging space is allocated for this process
  735. for the text and data segments in units of kilobytes.  If the executable
  736. file is on a local filesystem, the page space usage for text is zero. 
  737. If the executable is on an NFS filesystem, the page space usage will be
  738. nonzero.  This number may be greater than RSS, or it may not, depending
  739. on how much of the process is paged in.  The reason RSS can be larger is
  740. that RSS counts text whereas SIZE does not.
  741.  
  742. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  743. and does not correlate to any of the other fields.
  744.  
  745. These fields only report on a process text and data segments.  Segment
  746. size which cannot be interrogated at this time are:
  747.  
  748.        Text portion of shared libraries (segment 13)
  749.  
  750.        Files that are in use. Open files are cached in memory as
  751.        individual segments.  The traditional kernel cache buffer
  752.        scheme is not used in AIX 3.
  753.  
  754.        Shared data segments created with shmat.
  755.  
  756.        Kernel segments such as kernel segment 0, kernel extension
  757.        segments, and virtual memory management segments.
  758.  
  759. Speaking of kernel segments, the %MEM and RSS report for process zero
  760. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  761. kernel segment zero is counted twice.  For AIX 3.2, this has been
  762. changed, but the whole story is still not known.  The RSS value for
  763. process 0 will report a very small number of the swapper private data
  764. segment.  It does not report the size of the kernel segment 0, where the
  765. swapper code lives.
  766.  
  767. In summary, ps is not a very good tool to measure system memory usage. 
  768. It can give you some idea where some of the memory goes, but it leaves
  769. too many questions unanswered about the total usage.
  770.  
  771. ------------------------------
  772.  
  773. Subject: 1.302: Which simms do RS6000's use?
  774.  
  775. This answer is under construction... I'm trying to collect details
  776. about compatable simms.
  777.  
  778. RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
  779. RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms
  780.  
  781. ------------------------------
  782.  
  783. Subject: 1.303: What is kproc?
  784.  
  785. kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
  786. idle process.
  787.  
  788. ------------------------------
  789.  
  790. Subject: 1.304: How do I create a RAM disk in AIX?
  791. From: Jeff Wang <hjiwa@nor.chevron.com>
  792.  
  793. You can't create a RAM disk in AIX.  The closest related functionality
  794. the operating system gives you is the RAM disk buffer. Read 1.300
  795. sub-section 3.
  796.  
  797. [Editor's notice: as of 4.3.3 you CAN.  See 1.914 ]
  798.  
  799. ------------------------------
  800.  
  801. Subject: 1.305: How much RAM (real memory) does my machine have?
  802. From: Michael Abel/resnova
  803.     <Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>
  804.  
  805. As     root:  bootinfo -r
  806. As any user:  lsattr -E -l sys0 -a realmem
  807.  
  808. lsdev -C -c memory
  809.  
  810. shows all memory adapters.  On MCA systems one may add up the values
  811. displayed for each memory card in order to sum up to the amount of
  812. total memory.  On PCI systems only one item (mem0) is
  813. displayed. Additional information may be displayed with
  814.  
  815. lsattr -E -lmem0
  816.  
  817. These commands were tested on various IBM systems running AIX relases
  818. 3.2.5 and 4.1.4
  819.  
  820. ------------------------------
  821.  
  822. Subject: 1.306: Why do PIDs run non-sequentially?
  823. From: Julianne F. Haugh <jfh@austin.ibm.com>
  824.  
  825. The answer (I was there, consider me an authority ...) is that the
  826. PIDs needed to be somewhat unpredictable.  This is because AIX was
  827. originally designed with a number of C2 and B1 features, and one of those
  828. is the notion of covert channel analysis.  Sequential PIDs are a covert
  829. channel (assuming the system has one PID namespace ...) since the value
  830. of the "next" PID is shared by all currently running processes.  So if I
  831. want to sneak some of my classified data out to your co-operating
  832. non-classified program, I can do it by carefully controlling the value
  833. of the "next" PID.
  834.  
  835. ------------------------------
  836.  
  837. Subject: 1.400: How do I make an informative prompt in the shell?
  838.  
  839. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  840. printed, so you can use:
  841.  
  842. $ export myhost=`hostname`
  843. $ PS1='$LOGNAME@$myhost $PWD \$ '
  844.  
  845. to get, e.g. 
  846.  
  847. bengsig@ieibm1 /u/bengsig $
  848.  
  849. In the C-shell, use:
  850.  
  851. % set myhost=`hostname`
  852. % alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  853. % cd
  854.  
  855. to get, e.g.
  856.  
  857. bengsig@dkunix9 /u/bengsig/aixfaq %
  858.  
  859. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  860.  
  861. ------------------------------
  862.  
  863. Subject: 1.401: How do I set up ksh for emacs mode command line editing?
  864.  
  865. The ksh has an undocumented way of binding the arrowkeys to the emacs
  866. line editing commands. In your .kshrc, add:
  867.  
  868. alias __A=`echo "\020"`   # up arrow = ^p = back a command
  869. alias __B=`echo "\016"`   # down arrow = ^n = down a command
  870. alias __C=`echo "\006"`   # right arrow = ^f = forward a character
  871. alias __D=`echo "\002"`   # left arrow = ^b = back a character
  872. alias __H=`echo "\001"`   # home = ^a = start of line
  873.  
  874. Type "set -o emacs" or put this line in your .profile.
  875.  
  876. Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
  877. for the problem is IX25982, which may have been superseded.
  878.  
  879. ------------------------------
  880.  
  881. Subject: 1.402: Listing files with ls causes a core dump
  882. From: Julianne F. Haugh <jfh@austin.ibm.com>
  883.  
  884. Scenario: a directory that is shared by N users (N >= 200).
  885. Run 'ls -l' in that directory.  It goes for a while, then
  886. Seg fault(coredump)!
  887.  
  888. It only occurs when the usernames are displayed (almost every file is
  889. owned by a different person).  The -g and -n options work fine; only -l
  890. and -o (which shows owner and not group) cause it. 
  891.  
  892. I believe that this problem was corrected by U407548.  If you have that
  893. many users that you are having core dump problems (it took over 200),
  894. you might also want to look into getting the PTF that fixes IX31403. 
  895. That APAR deals with large numbers of accounts and performance problems
  896. associated with looking them up.
  897.  
  898. ------------------------------
  899.  
  900. Subject: 1.403: How do I put my own text into InfoExplorer?
  901.  
  902. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  903. InfoCrafter that allows you to do that.
  904.  
  905. ------------------------------
  906.  
  907. Subject: 1.404: InfoExplorer ASCII key bindings 
  908. From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
  909.  
  910. If you just press 'Return' when it starts up, with 'Basic Screen
  911. Operations' highlighted, you'll get some help.
  912.  
  913. If you look long enough, you'll find a page named 'Using Keys and Key
  914. Sequences in the InfoExplorer ASCII Interface'.  It describes the key
  915. sequences and actions.  Here are a few to get you started.
  916.  
  917. Keys       Action
  918.  
  919. Ctrl-W     Moves between the Navigation screen and the Reading screen.
  920. If the Navigation screen is displayed, you can press Ctrl-W to display
  921. the Reading screen.  If the Reading screen is displayed, you can press
  922. Ctrl-W to display the Navigation screen.
  923.  
  924. Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
  925. located in the text area of the screen, you can press Ctrl-O to make the
  926. menu bar active.  If the menu bar is already active, you can press
  927. Ctrl-O to make it inactive, which moves the text cursor to the text area.
  928.  
  929. Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
  930. menu is not displayed and you press the Right Arrow key, the next menu
  931. bar option is displayed in reverse video.
  932.  
  933. ------------------------------
  934.  
  935. Subject: 1.405: How can I add new man pages to the system?
  936. From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
  937.  
  938. Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
  939. man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
  940. the makewhatis-database /usr/man/whatis so apropos and whatis know about
  941. the added manpages.  /usr/lib/makewhatis should be available on all 3.2
  942. versions.
  943.  
  944. For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
  945. /usr/lib/makewhatis is still there.
  946.  
  947. ------------------------------
  948.  
  949. Subject: 1.406: Why can't I read man pages?  Where is nroff?
  950.  
  951. Nroff and troff aren't in the base installation.  It is shipped as
  952. part of AIX 3.2.5 but may not be installed.  Use smit to install a
  953. software package called txtfmt.tfs.obj from your 3.2.5 distribution
  954. media.
  955.  
  956. In AIX 4.x, you need bos.txt.tfs.
  957.  
  958. ------------------------------
  959.  
  960. Subject: 1.407: Why is my environment only loaded once?
  961.  
  962. The .profile file is only loaded once (for your login shell) subsequent
  963. shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).
  964.  
  965. Bash users can use $HOME/.bash_profile for the login shell environment
  966. and $HOME/.bashrc.
  967.  
  968. ------------------------------
  969.  
  970. Subject: 1.408: Where is the 'nawk' command on my AIX system?
  971. From: Jeff Wang <hjiwa@nor.chevron.com>
  972.  
  973. The /bin/nawk that exists on many UNIX flavors is a superset of the
  974. 'awk' command, revised by the same original authors to include added
  975. functionality.  All the extra options normally associated with 'nawk'
  976. on other UNIXes have been incorporated into the AIX version of 'awk';
  977. the AIX 'awk' InfoExplorer or man pages include nawk-specific features
  978. such as the "-v" command line option and atan2(), rand(), srand(),
  979. match(), sub(), gsub(), system(), close(), getline functions.
  980.  
  981. If your AIX version is missing /bin/nawk (as are most AIX 3.x
  982. versions), the simplest way to get around this and maintain script
  983. portability between UNIX platforms is to make a /bin/nawk link to
  984. /bin/awk (as root, of course).  If you do not have root privilege or
  985. do not want to create a /bin/nawk link, to make the script work on
  986. different UNIXes, you may have to test `uname` first and set all
  987. 'nawk' references on AIX runs to /bin/awk.  If your script is to only
  988. run on AIX systems, you can just change all references of 'nawk' to
  989. 'awk' and everything should still work okay...but check the AIX awk
  990. script on test data prior to making actual runs.
  991.  
  992. [Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
  993. to /usr/bin/awk.]
  994.  
  995. ------------------------------
  996.  
  997. 1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
  998. From: David Alexander <unilink@online.rednet.co.uk>
  999.  
  1000. [Editor's note: While this is documented in one of the AIX manuals
  1001. and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
  1002. enough I thought I would include it here.]
  1003.  
  1004. Not all the Info databases are required, so do not copy them all unless the 
  1005. customer specifically requests them, or has asked for the software they 
  1006. refer to.  These instructions assume you have enough space on /usr.
  1007.  
  1008.     Install and mount the InfoExplorer CD-ROM as for use of Info 
  1009.     from CD-ROM.
  1010.  
  1011.     Log in as Root
  1012.     umount /usr/lpp/info/lib/$LANG
  1013.     mkdir /mnt/$LANG
  1014.     mount -v cdrfs -r /dev/cd0 /mnt/$LANG
  1015.  
  1016.     cd /
  1017.     cd /mnt/$LANG
  1018.     cp -r aix /usr/lpp/info/lib/$LANG
  1019.     cp -r aix2 /usr/lpp/info/lib/$LANG
  1020.     cp -r compnav /usr/lpp/info/lib/$LANG
  1021.     cp -r hardware /usr/lpp/info/lib/$LANG
  1022.     cp -r nav /usr/lpp/info/lib/$LANG
  1023.     cp -r prog /usr/lpp/info/lib/$LANG
  1024.     cp -r uiprog /usr/lpp/info/lib/$LANG
  1025.  
  1026.     Other sections can be copied if required:
  1027.     Section                        Size
  1028.     cp -r ada /usr/lpp/info/lib/$LANG        7.2  Mb
  1029.     cp -r assemb /usr/lpp/info/lib/$LANG        5.23 Mb
  1030.     cp -r cxx /usr/lpp/info/lib/$LANG        6.52 Mb
  1031.     cp -r dce /usr/lpp/info/lib/$LANG        3.8  Mb
  1032.     cp -r encina /usr/lpp/info/lib/$LANG        2.67 Mb
  1033.     cp -r fortran /usr/lpp/info/lib/$LANG        6.85 Mb
  1034.     cp -r graph /usr/lpp/info/lib/$LANG        9.75 Mb
  1035.     cp -r graph2 /usr/lpp/info/lib/$LANG        4.1  Mb
  1036.     cp -r pascal /usr/lpp/info/lib/$LANG        3.23 Mb
  1037.  
  1038.     umount /mnt/$LANG
  1039.     eject the CD-ROM
  1040.  
  1041. ------------------------------
  1042.  
  1043. Subject: 1.410: Why can't I set my default shell to one we've just installed?
  1044.  
  1045. When adding new shells to the system, add them to the "shells=" line
  1046. in /etc/security/login.cfg so they can be used during ftp and rlogin
  1047. by users who use them as their default shell.
  1048.  
  1049. ------------------------------
  1050.  
  1051. Subject: 1.411: Why do I get the "Unable to connect socket: 3"
  1052.                 starting Info-Explorer?
  1053.  
  1054. It's a bug in the way infod sets the initial permission on the            
  1055. /tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
  1056. message will go away. (Charlie McGuire, mcguire@cs.umt.edu)
  1057.  
  1058. This problem was fixed by APAR IX43230, PTF U432315
  1059. (Paul Sitz, psitz@empros.com)
  1060.  
  1061. ------------------------------
  1062.  
  1063. Subject: 1.412: Why can't I write a setuid shell script?
  1064. From: mww@microfocus.com (Michael Wojcik)
  1065.  
  1066. AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
  1067. (It ignores the SUID and SGID bits on scripts.)  They're a huge security
  1068. hole.
  1069.  
  1070. If you really want to run a script SUID, you can create a small C program
  1071. that does a setuid(0) and then system()'s your script.  (Actually, the
  1072. setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
  1073. but YYMV.)  Make the program SUID.  Be very careful.
  1074.  
  1075. There are other similar solutions.  You might also want to look into
  1076. sudo, which handles this sort of thing in a somewhat more controlled
  1077. manner
  1078.  
  1079. * Julianne Frances Haugh (jfh@tab.com) writes:
  1080.  
  1081. I raised an objection to set-ID shell scripts before AIX 3.1 was
  1082. golden.  ... it was finally done in the 3009 PTF for AIX 3.1.
  1083.  
  1084. ------------------------------
  1085.  
  1086. Subject: 1.500  Which release of X11 do I have?
  1087.  
  1088. AIX 4.x includes X11 R5 and Motif 1.2.
  1089.  
  1090. On AIX 3, Run 'lslpp -h X11rte.obj'.
  1091. If your output has a line similar to:
  1092.  
  1093.             01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root
  1094.  
  1095. you have X11 R4. If your output has a line similar to:
  1096.  
  1097.     U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root
  1098.  
  1099. you have X11 R5. Some people also call these AIXwindows 1.2.0 and
  1100. 1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
  1101. running Motif 1.2.
  1102.  
  1103. From: Jan Just Keijser <KeijserJJ@logica.com> 
  1104.  
  1105. AIX 4.1 and AIX 4.2 come with X11R5 and Motif 1.2.4
  1106.  
  1107. AIX 4.3.1 (and perhaps 4.3.0) comes with X11R6.1 and Motif 2.1
  1108.  
  1109. Some executables which run fine using the X11R5 libraries may not run
  1110. when using the X11R6.1 libraries; you can specify which X11 libraries to
  1111. use by setting
  1112.   LIBPATH=/usr/lpp/X11/lib/R5:/usr/lib:...
  1113. for X11R5 and
  1114.   LIBPATH=/usr/lpp/X11/lib/R6:/usr/lib:...
  1115. for X11R6.1; by default,
  1116.     /usr/lib/libX11.a -> /usr/lpp/X11/lib/R6/libX11.a
  1117. and also for the other libraries on AIX 4.3.1.
  1118.  
  1119. On most of the AIX 4.1.x and 4.2.1 boxes I have seen the default is
  1120.   /usr/lib/libX11.a -> /usr/lpp/X11/lib/R4/libX11.a
  1121. ie the default libraries are the X11R4 libraries and _NOT_ the R5
  1122. libraries; this may also be due to the setup at my site.
  1123.  
  1124. ------------------------------
  1125.  
  1126. Subject: 1.501: How to prevent ctrl-alt-backspace from killing the X session
  1127.  
  1128. Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.
  1129.  
  1130. ------------------------------
  1131.  
  1132. Subject: 1.502: Who has a termcap/terminfo source for the HFT console?
  1133.  
  1134. The console used on the RISC System/6000, PS/2 and RT can be used as a
  1135. terminal on another system with the termcap below.  You can find this
  1136. and other termcaps in /lib/libtermcap/termcap.src, including IBM
  1137. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  1138. This termcap can also be used from an aixterm window.
  1139.  
  1140. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  1141.     :co#80:li#25:am:ht:\
  1142.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  1143.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  1144.     :bs:sf=\E[S:ec=\E[%dX:\
  1145.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  1146.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  1147.     :im=\E[4h:ei=\E[4l:mi:\
  1148.     :dm=\E[4h:ed=\E[4l:\
  1149.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  1150.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  1151.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  1152.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  1153.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  1154.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  1155.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  1156.  
  1157. ------------------------------
  1158.  
  1159. 1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
  1160. From: Marc Pawliger <marc@sti.com>
  1161.  
  1162. showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
  1163. Very nice PS file previewer from Adobe.  Replaces xpsview which came
  1164. with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps
  1165.  
  1166. From: VRBASS@ATLVMIC1 (Vance R. Bass)
  1167.  
  1168. You can look at PostScript files using either "xpreview" (in the
  1169. optionally installable text formatting services) or you can get
  1170. Ghostscript and Ghostview from a comp.sources.x server and build it
  1171. yourself.
  1172.  
  1173. >From the "xpreview" man page:
  1174. The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
  1175. application that displays output from the troff command on an AIXwindows
  1176. display.  The troff command output file must be prepared for any one of
  1177. the devX100, devX100K or devpsc devices.  The xpreview command also
  1178. displays PostScript language files that begin with %!.
  1179.  
  1180. "dpsexec" is NOT intended to be a full-service document browser, but
  1181. rather a simple DPS code debugger.  If you insist on using it, you can
  1182. edit your PS code to remove the "showpage" (which will reset dpsexec
  1183. and clear the window) to view single-page files.  It does not handle
  1184. multi-page files gracefully.
  1185.  
  1186. ------------------------------
  1187.  
  1188. Subject: 1.504: unix:0 vs `hostname`:0
  1189.  
  1190. 1.) Is there any way to get the machine to check its local host table
  1191.     first without renaming resolv.conf?
  1192.  
  1193. [AIX 3.2 only]
  1194. PTF U412845 implements an environment variable to set the resolver
  1195. time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
  1196. of seconds before it times out, a failing a DNS query the machine will
  1197. consult /etc/hosts.  
  1198.  
  1199. 2.) How do you tell X applications where you are if the console display 
  1200.     is unix:0?
  1201.  
  1202. From: David L. Crow <crow@waterloo.austin.ibm.com>
  1203.  
  1204.   I would suggest that if you have R5, use ":<display>.<screen>".  I do
  1205.   not believe that R4 clients will understand :0, so I would suggest
  1206.   unix:0 for them.
  1207.  
  1208.   Without specifying unix or the hostname, you will get the fastest
  1209.   transport mechanism.  While currently there are only two transport
  1210.   methods in the AIXwindows X server (Unix sockets and TCP sockets),
  1211.   many vendors are looking at using shared memory as a transport method. 
  1212.   If you use :0 (or :0.0 or :1, etc.), then you should get the best
  1213.   performance regardless of the available transport methods.
  1214.  
  1215. From: Marc Pawliger <marc@sti.com>
  1216.  
  1217.   Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
  1218. (SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
  1219. a penalty vs. using ":0" See /usr/lpp/X11/README.SMT
  1220.  
  1221. 3.) Is there a significant performance penalty incurred by using
  1222.     `hostname`:0 as DISPLAY?
  1223.  
  1224.   Yes! Using unix:0, you are using Unix sockets.  These are much faster
  1225.   than their TCP socket counterparts.
  1226.  
  1227. ------------------------------
  1228.  
  1229. Subject: 1.505: VT100 key bindings for aixterm
  1230. From: haedener@iac.unibe.ch <Konrad Haedener>
  1231.  
  1232. Add this to your .Xdefaults file and start your VAX session with
  1233. 'aixterm -v -name vt100 -e telnet MYVAXHOST'
  1234.  
  1235. -----
  1236. vt100.vt102: true
  1237. vt100.fullcursor: false
  1238. vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
  1239.                        <Key>F2: string(0x1b) string("OQ") \n\
  1240.                        <Key>F3: string(0x1b) string("OR") \n\
  1241.                        <Key>F4: string(0x1b) string("OS") \n\
  1242.                        <Key>KP_0: string(0x1b) string("Op") \n\
  1243.                        <Key>KP_1: string(0x1b) string("Oq") \n\
  1244.                        <Key>KP_2: string(0x1b) string("Or") \n\
  1245.                        <Key>KP_3: string(0x1b) string("Os") \n\
  1246.                        <Key>KP_4: string(0x1b) string("Ot") \n\
  1247.                        <Key>KP_5: string(0x1b) string("Ou") \n\
  1248.                        <Key>KP_6: string(0x1b) string("Ov") \n\
  1249.                        <Key>KP_7: string(0x1b) string("Ow") \n\
  1250.                        <Key>KP_8: string(0x1b) string("Ox") \n\
  1251.                        <Key>KP_9: string(0x1b) string("Oy") \n\
  1252.                        <Key>KP_Divide: string(0x1b) string("OQ") \n\
  1253.                        <Key>KP_Multiply: string(0x1b) string("OR") \n\
  1254.                        <Key>KP_Subtract: string(0x1b) string("OS") \n\
  1255.                        <Key>KP_Add: string(0x1b) string("Om") \n\
  1256.                        <Key>KP_Enter: string(0x1b) string("OM") \n\
  1257.                        <Key>KP_Decimal: string(0x1b) string("On") \n\
  1258.                        <Key>Next: string(0x1b) string("Ol") \n\
  1259.                        <Key>Left: string(0x1b) string("OD") \n\
  1260.                        <Key>Up: string(0x1b) string("OA") \n\
  1261.                        <Key>Right: string(0x1b) string("OC") \n\
  1262.                        <Key>BackSpace : string(0x7f) \n\
  1263.                        <Key>Down: string(0x1b) string("OB")
  1264.  
  1265. You should also add
  1266.  
  1267. XENVIRONMENT=$HOME/.Xdefaults
  1268. export XENVIRONMENT
  1269.  
  1270. to your .profile.
  1271.  
  1272. ------------------------------
  1273.  
  1274. Subject: 1.506: Is there a screen saver that does not use excessive CPU?
  1275. From: Don Buchholz <buchholz@ese.ogi.edu>
  1276.  
  1277. Try using xlock with these options:
  1278.  
  1279.     xlock -mode life -count 1500 -nice 20 -root
  1280.  
  1281.  
  1282. From: pranav@evolving.com (Pranav Vakil)
  1283.  
  1284. Use mlock -hide to hide the background. You can also modify the mlock
  1285. (/usr/local/tools/mlock) code to allow the standard X screen saver to
  1286. take effect. The timeout value is originally set to 0 which means the
  1287. screen saver is off. Modify this to be 120 (2 minutes) and set the
  1288. interval time to be 60 (1 minute). Using these intervals, I have found
  1289. that over a 24 hour period, it uses only .3 cpu minutes.
  1290.  
  1291. ------------------------------
  1292.  
  1293. Subject: 1.507: Where are the colors, available for an X session, listed.
  1294.  
  1295. /usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
  1296. /usr/lpp/X11/lib/X11/rgb.txt
  1297.  
  1298. ------------------------------
  1299.  
  1300. Subject: 1.508: Why does my app hang the X server but not an X station?
  1301. From: Bjorn P. Brox <brox@corena.no>
  1302.  
  1303. /usr/lpp/X11/README.SMT X client/server communication uses a 64k
  1304. buffer by default.  The size of this buffer is controled by the
  1305. X_SHM_SIZE environment variable increasing the size of the buffer has
  1306. been used to prevent some applications from hanging the X server :)
  1307.  
  1308. ------------------------------
  1309.  
  1310. Subject: 1.509: How do I switch the control and caps lock key bindings?
  1311.  
  1312. If you are running the X window system, you can put the following into
  1313. .xmodmaprc
  1314.  
  1315.   remove Lock = Caps_Lock
  1316.   remove Control = Control_L
  1317.   keysym Control_L = Caps_Lock
  1318.   keysym Caps_Lock = Control_L
  1319.   add Lock = Caps_Lock
  1320.   add Control = Control_L
  1321.  
  1322. Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
  1323. lefty friendly.
  1324.  
  1325. ------------------------------
  1326.  
  1327. Subject: 1.510: Missing fonts?
  1328.  
  1329. If your Xserver supports X11R5 try running a font server (edit
  1330. /usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
  1331. Xserver instructions on how to include a font server in your font
  1332. path.
  1333.  
  1334. ------------------------------
  1335.  
  1336. Subject: 1.511: What's the termcap entry for an IBM 3151 look like?
  1337.  
  1338. #
  1339. # Written by Aleksandar Milivojevic, alex@srce.hr
  1340. # 24.09.1994
  1341. #
  1342. I2|ibm3151|3151|IBM 3151 terminal:\
  1343.     :am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
  1344.     :cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
  1345.     :me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
  1346.     :us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
  1347.     :k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
  1348.     :k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
  1349.     :ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:
  1350.  
  1351. ------------------------------
  1352.  
  1353. Subject: 1.512: Errors starting X11 application binaries from aixpdslib.
  1354. From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>
  1355.  
  1356. We have been aware of the problem people have with dynamic links
  1357. when running the prebuilt of X-stuffs from this library.
  1358.  
  1359. The typical error messages will be:
  1360.  
  1361.     Could not load program [program_name]
  1362.     Member shr4.o not found or file not an archive
  1363.     Member shr4.o not found or file not an archive
  1364.     Could not load library libXt.a[shr4.o]
  1365.     Error was: No such file or directory
  1366.  
  1367. It's because that we built the programs using X11 libraries of MIT
  1368. which are not compatible with those of IBM.  If this is the case,
  1369. then please get the compressed tarred file of the source code instead,
  1370. and recompile them on your system using your libraries.
  1371.  
  1372. ------------------------------
  1373. Subject: 1.513: .XShm*, .sm* (Shared memory) Link errors building 
  1374.                  Xwindows applications.
  1375.  
  1376. Link errors that refer to .XShm* often times are a result of compiling
  1377. applications to take advantage of the Shared Memory extension of the X
  1378. server.  You may either compile without shared memory or load the
  1379. shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
  1380. script for rebuilding your X server with the shared memory can be found
  1381. in /usr/lpp/X11/Xamples/server.
  1382.  
  1383. ------------------------------
  1384.  
  1385. Subject: 1.514: How do I set my DISPLAY when I login to another machine?
  1386.  
  1387. Though this is not a question specific to AIX, it appears often enough
  1388. to warrant an answer here.  There are lots of approaches, some of which
  1389. are described in the X Windows FAQ.  Most involve a little login shell
  1390. programing to parse the output of `who` or `who am i`.
  1391. <URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
  1392. e-siebert@uchicago.edu will help if you are willing/able to install it
  1393. suid.  See the X Windows FAQ and newsgroup for more information.
  1394.  
  1395. Hostwhence is also availabile in the "lsof" smit-installable package on
  1396. www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
  1397. read /dev/kmem without being set-uid-root.
  1398.  
  1399. ------------------------------
  1400.  
  1401. Subject: 1.515:  Why doesn't Netscape work?
  1402. From: "Gary R. Hook" <hook@austin.ibm.com>
  1403.  
  1404. The problem is that Netscape has statically linked libc into 
  1405. Mozilla.  When the AIX 3 libc code (setlocale()) tries to
  1406. load an AIX 4 locale, the two are incompatible and a core
  1407. dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
  1408. Using LANG=C causes a lot of locale code to be bypassed, allowing
  1409. the application to avoid loading a non-C locale, and to continue
  1410. execution.
  1411.  
  1412. >From: Colin <apollo@randomc.com>
  1413. Here is a shell script that works around Netscape's problems by
  1414. setting the LANG and CLASSPATH environment variables.
  1415.  
  1416. #!/bin/sh
  1417. LANG=C
  1418. CLASSPATH=/path/to/java_30
  1419. export LANG CLASSPATH
  1420. if [ $# -eq 0 ]; then
  1421.    /path/to/netscape http://your.home.page &
  1422. else
  1423.    /path/to/netscape $* &
  1424. fi
  1425.  
  1426. ------------------------------
  1427.  
  1428. Subject: 1.600: My named dies frequently, why?
  1429. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  1430.  
  1431. Running on 3.2, named dies frequently on network's primary name server.
  1432.  
  1433.  
  1434. Try the following:
  1435.  
  1436.      stopsrc -s named        # stop running named
  1437.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  1438.      /etc/named ...        # don't use smit to start named
  1439.  
  1440. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  1441. the same effect, but I'm not sure.
  1442.  
  1443. [According to John, the problem is malloc() in the named code. He
  1444.  also suggests using Berkeley's bind, which he has ported and can be
  1445.  ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]
  1446.  
  1447. Two ptfs should fix this problem. Get U412332 and U414752.
  1448.  
  1449. Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
  1450. that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.
  1451.  
  1452. ------------------------------
  1453.  
  1454. Subject: 1.601: How do I trace ethernet packets on an AIX system?
  1455. From: afx@muc.ibm.de (Andreas Siegert)
  1456.  
  1457. Do the following:
  1458.  
  1459.      iptrace -i en0 /tmp/ipt
  1460.  
  1461. The iptrace backgrounds.  Find its process id and kill it when you are
  1462. ready.  Then run
  1463.  
  1464.      ipreport -rns /tmp/ipt >/tmp/ipr
  1465.  
  1466. and look at the output.  The current version of Info does not document
  1467. the r, n and s options but they are quite useful for layering the output.
  1468.  
  1469. ------------------------------
  1470.  
  1471. Subject: 1.602 What is the authorized way of starting automount at boot time?
  1472. From: curt@ekhadafi.austin.ibm.com (Curt Finch)
  1473.  
  1474. I put this in my /etc/inittab:
  1475.  
  1476. automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
  1477.  
  1478. I hereby dub it authorized.
  1479.  
  1480. Jim Salter <jsalter@netscape.com> writes: You can also use the command:
  1481. 'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.
  1482.  
  1483. ------------------------------
  1484.  
  1485. Subject: 1.603: How do I set a tty port for both dial-in and dial-out?
  1486.  
  1487. Set the mode of the tty to be either 'shared' or 'delayed'. 
  1488.  
  1489. ------------------------------
  1490.  
  1491. Subject: 1.604: How to move or copy whole directory trees across a network
  1492.  
  1493. The following command will move an entire directory tree across a network 
  1494. while preserving permissions, uids and gids.
  1495.  
  1496.       $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
  1497.  
  1498. Explanation:
  1499.  
  1500. The tar-create is rsh'd to the remote system and is written to
  1501. stdout (the pipe).
  1502.  
  1503. The local system is extracting the tar that is being read from
  1504. stdin (the pipe).
  1505.  
  1506. From: abeloni <abeloni@hstern.com.br>
  1507.  
  1508. Another method is:
  1509.  
  1510.     rcp -rp host1:/dir host2:/dir
  1511.  
  1512. ------------------------------
  1513.  
  1514. Subject: 1.605: How can I send mail to hosts that cannot be pinged?
  1515. From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)
  1516.  
  1517. AIX 3.2 as shipped is configured to only send mail to mail addresses
  1518. which include a host name.  Many organizations use a mail address whose
  1519. "host name" part is not a host name (technically an MX name).  To change
  1520. the configuration of the AIX mailer, login as root.  Then edit the file
  1521. /etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
  1522. the line which reads:
  1523.     # OK MX
  1524.  
  1525. Now rebuild the machine readable form of the configuration with
  1526.     sendmail -bz
  1527.  
  1528. and finally restart signal sendmail to load the new configuration by one
  1529. of the following:
  1530.      reboot
  1531. or
  1532.      stopsrc -s sendmail
  1533.      startsrc -s sendmail
  1534. or 
  1535.      kill -1 `cat /etc/sendmail.pid`
  1536.  
  1537.