============================================================================== 97.001 Tree command ============================================================================== Is there an equivalent in Unix of the Dos tree command? ------------------------------------------------------------------------------ You might want to tweak the following which provides what you are asking for at our installation(s): #!/usr/bin/ksh # [ xtree ] # directory tree command # Financial DataCorp - 1996 # USAGE="Usage: $0 [directory]" case $# in 0) dir=`pwd` ;; 1) if [ ! -d $1 ]; then echo "$1: not a directory" echo $USAGE exit 1 fi dir=$1 ;; *) echo $USAGE exit 1 ;; esac echo " " cd $dir cdir=`pwd` if [ $cdir = "/" ] ; then find . \( -type d ! -name "*.SLM" \) -print | sort | awk -F/ 'NR == 1 { print "/"} NR >1 { for (count = 1; count < NF-1; count++) printf" " print " |----> "$NF }' else find . \( -type d ! -name "*.SLM" \) -print | sort | awk -F/ 'NR == 1 { print "'`basename $cdir`'" } NR > 1 { for (count = 1; count < NF-1; count++) printf" " print " |----> "$NF }' fi echo " " ------------------------------------------------------------------------------ Here is another Korn shell script which works too: #!/bin/ksh # # Name: dirtree # Programmer: # Hemant T. Shah # Life Insurance Data Processing # July 12 1994 # # Description: # Print directory tree structure as follows: # |___Mail # |___scheduler # |___cics_scripts # |___tar_msdos # |___awk # |___attributes # |___tmp # |___News # |___dosscsi # |___FAQ_xterminal # |___shell_history.Z # |___FAQ_AIX # |___aix_ftp_site # |___hp_software # |___dnload # |___telnet.h # |___msdos # |___tnetd.tar.Z # |___aix # |___hp # |___xkey.c # ProgramName=`basename $0` Path="." ShowAll=1 ShowDir=0 ExpandDirectory() { typeset object # Local variable cd $1 for object in $PWD/.??* $PWD/* do if [[ -d $object ]]; # It is a directory then print "${indent}|___`basename ${object}`/" indent="${indent}! " # Add to indentation if [[ -x $object ]]; then ExpandDirectory $object fi indent=${indent%????} # Remove from indentation elif [[ -a $object ]]; then if (( ShowAll == 1 )); then print "${indent}|___`basename ${object}`" fi fi done } if [[ $# > 0 ]]; then while [ $# -gt 0 ]; do case $1 in -f) ShowAll=1 shift ;; -d) ShowDir=1 ShowAll=0 shift ;; -*) print "Usage: $ProgramName [-h] [-f] [-d] [path] " print -- "\t-h ... display this help message." print -- "\t-f path ... shows all files and directories below \ path (default)." print -- "\t-d path ... shows all directories only below path." exit ;; *) Path=$1 shift ;; esac done fi if [[ ! -d $Path ]]; then print "Error: Specified path is not a directory." exit fi print "!$Path/" ExpandDirectory $Path ============================================================================== 97.002 Copying bootable 8mm 2.3 GB tape ============================================================================== Does someone know how to copy a bootable 8mm tape (2.3 Gb) to another tape with only one tape drive, but enough hard disk space? ------------------------------------------------------------------------------ 1. Use the tcopy command and have lots and lots of patience 2. Bootable tapes are actually multi-archive tapes with 7 or 8 volumes on them; you can copy them one by one to disk using the "dd" command and then copy them back to tape using the "dd" command again: dd if=/dev/rmt0.1 of=part1.dd bs=1024 dd if=/dev/rmt0.1 of=part2.dd bs=1024 dd if=/dev/rmt0.1 of=part3.dd bs=1024 etc. and then dd if=part1.dd of=/dev/rmt0.1 bs=1024 dd if=part2.dd of=/dev/rmt0.1 bs=1024 dd if=part3.dd of=/dev/rmt0.1 bs=1024 etc. ============================================================================== 97.003 Shutting down ============================================================================== The Solaris OS kill its process/daemons automatically when you shut down the system by running the K* scripts in the rc0-3 directory. I heard that AIX has the same possibilities but up to now I couldn't figure out where. ------------------------------------------------------------------------------ In AIX the shutdown command looks for the existence of a script called /etc/rc.shutdown and if it exists runs it. This is about the first step in the shutdown process. Please be aware that this capability first appeared with bos.rte.control at 4.1.5.4 and is also available on AIX 4.2. It is not available on any release of AIX before 4.1.5. For all AIX installations earlier than these levels you must modify /usr/sbin/shutdown yourself and SAVE A COPY so that when installed service replaces /usr/sbin/shutdown you can modify the new shutdown script to include your changes. I agree that the purer SYSV approach, with S* and K* scripts in rcN.d directories, would be the better approach but IBM for some reason won't go that way. ============================================================================== 97.004 Unix devices, volumes, and disk space ============================================================================== I'm trying to figure out the correct command to see how much space is left on our systems. ------------------------------------------------------------------------------ df seems to give what I am asking for. It breaks it down by filesystems. Are there other commands to break down the space used and space available for volumes, and hard drives? lsvg -o will give us the logical volumes. lsvg -o | lsvg -i -l will expand these to a finer level of detail getlovodm -c will list all physical volumes on the system. Also, "lspv" will show physical volumes. lsdev -C | sort -d -f will display devices in the system, and their characteristics. I use "lsdev -C -s scsi" to see SCSI devices. Attached is a lovely Perl script that was posted to comp.unix.aix four years ago or so. This script (called "dv") will answer all your questions as to how much space is available in filesystems, logical volumes, and physical volumes. As you can see from the script below, lsvg with the right options shows you the number of free partitions in a physical volume. Of course, you then have to use "lsvg" without any options to figure out what size the partitions are, since they're not always the same size. -----------------cut here-------------- #!/usr/local/bin/perl # # dv - display AIX volume group & logical volume info # $ENV{'PATH'} = '/etc:/bin:/usr/bin'; $Unit = 1e6; # some may prefer 1024*1024 for megabyte system("hostname;date"); printf("%-16s %-6s %-6s %-30s\n", 'Vg|Lv-----------', 'MBytes', 'Free--', 'Pv/Mount/Type----------'); open(LsPv, "lspv |"); while() { chop; ($pv, $id, $vg) = split; $Pv{$vg} = ($Pv{$vg}) ? "$Pv{$vg},$pv" : $pv; } for $vg(keys(%Pv)) { open(LsVg, "lsvg $vg|"); while() { if (/\sPP SIZE:\s*(\d+)\s/) { $Sz{$vg} = $1*1024*1024; } elsif (/\s+TOTAL PPs:\s*(\d+)\s/) { $Total{$vg} = $1 * $Sz{$vg}; $TotalMB += $Total{$vg}; } elsif (/\s+FREE PPs:\s*(\d+)\s/) { $Free{$vg} = $1 * $Sz{$vg}; $TotalFree += $Free{$vg}; } } } open(Df, "df 2>/dev/null |"); while() { next unless m|^/|; chop; ($fs, $total, $free, $pctu, $iused, $pctiu, $mount) = split; ($x,$x,$lv) = split(m|/|, $fs); $Free{$lv} = $free * 1024; $TotalFree += $Free{$lv}; } for $vg(keys(%Pv)) { open(LsVg, "lsvg -l $vg|"); undef(@lvs); ; ; while() { chop; ($lv,$type,$lp,$pp,$pv,$state,$mount) = split; push(@lvs, $lv); $Vg{$lv} = $vg; $Mount{$lv} = ($type eq 'jfs') ? $mount : $type; $Mb{$lv} = $pp * $Sz{$vg}; } $Lvs{$vg} = join(' ',@lvs); } for $vg(sort(keys(%Pv))) { printf("%-16s %6.0f %6.0f %-30s\n", $vg, $Total{$vg}/$Unit, $Free{$vg}/$Unit, "<$Pv{$vg}>"); for $lv(sort(split(/\s/, $Lvs{$vg}))) { printf(" |%-13s %6.0f %6.0f %-30s\n", $lv, $Mb{$lv}/$Unit, $Free{$lv}/$Unit, $Mount{$lv}); } printf("%s\n", '_'x79); } printf("%-16s %6.0f %6.0f\n", 'Total', $TotalMB/$Unit, $TotalFree/$Unit); ============================================================================== 97.005 Undelete ============================================================================== I've got a machine where someone accidentally deleted an entire partition. Is there anything that can help me retrieve the data? Dumping the entire partition to a disk file and scanning it for useful data is very time consuming, but that's the approach I'm taking right now. ------------------------------------------------------------------------------ The data is still there, of course. You just need to recreate the LV using the same partitions in the same order. Once that has completed, you can manually create an /etc/filesystems entry and mount the filesystem. This is where saving the output of "lslv -m LVname" is a good thing, as you generate a quick mapfile for mklv from that output. If you don't have it, that's where you have to figure out where the LV starts, etc... ============================================================================== 97.006 LVM 4 GB hard drive ============================================================================== My RS/6000 server has 4.2 preloaded. The most space I can use is 2 GB for any of the file systems combined. What it seems to me is that the PP size should have been created with 8 or 16 MB. From what I have tried it looks like I will have to reinstall the system from scratch. ------------------------------------------------------------------------------ By the time you'v gotten this far, the PP size is not an issue! This point has been mentioned several times in this thread... That, and a file system (or really, a logical volume) is not limited to 256 partitions. Ultimately, this information needs to be provided: 1. lsvg -l VGname 2. lsvg VGname 3. lsvg -p VGname 4. The errors he gets when he tries to increase the LVs. 5. lslv LVname (for the LVs in question) ============================================================================== 97.007 What's on port 1025? ============================================================================== netstat -a shows that port tcp/blackjack (i.e. tcp/1025) is listening on all our AIX machines (except the firewall). lsof shows that it is inetd which is listening on 1025. The rpc tools do not indicate any relation between port 1025 and any RPC or NFS servers. I cannot find any line in /etc/inetd.conf which corresponds to port 1025. /etc/services defines 1025 as "blackjack", but I found no document about "blackjack" and no file which is likely to correspond to it I can connect to port 1025 with telnet. The connection accepts data (and remains open also after \n, ^D, "exit", ...), but does not... Questions: * What service is listening on port 1025? * Where is it configured? * How can I turn it off, and what are the consequences? * Is it common that something listens on port 1025 on AIX and/or other Unix flavors? This is on AIX 4.1.4 and 4.1.5. ------------------------------------------------------------------------------ If you've got root permissions you might try a brute force approach. Comment out entries one at a time in /etc/inetd.conf, and have inetd reconfigure each time, until the port becomes free, then you'll know what's got it. Are you sure this isn't ttdbserver? rpcinfo -p on my AIX 4.1 box gives me this: program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100001 1 udp 1029 rstatd 100001 2 udp 1029 rstatd 100001 3 udp 1029 rstatd 100002 1 udp 1031 rusersd 100002 2 udp 1031 rusersd 100008 1 udp 1033 walld 100012 1 udp 1035 sprayd 150001 1 udp 1037 pcnfsd 100083 1 tcp 1025 ttdbserver 100068 2 udp 1039 cmsd 100068 3 udp 1039 cmsd 100068 4 udp 1039 cmsd 100068 5 udp 1039 cmsd 100003 2 udp 2049 nfs 100005 1 udp 917 mountd 100005 1 tcp 919 mountd 536872022 2 udp 1011 536872022 2 tcp 1013 ------------------------------------------------------------------------------ I believe that you'll find that lsof simply indicates that 1025 is in use by inetd. 1025 is the first "non-privileged" port under tcp/ip. That is numbers less that 1024 are considered to require some privilege to bind to. Above that number is a free-for-all, meaning that if a port is needed your package just gets one, which may or may not be 1025, 1026... The blackjack bit is a red herring - it just means that the /etc/services file has port 1025 known as "blackjack" - meaning that some blackjack service somewhere typically uses port 1025 as its port. What's connected to the other side? Who knows - turn on inetd debugging and see what that tells you (inetd -d). Doing a stopsrc -d inetd should, if you're correct, make this port free up (give or take a couple of minutes). I've had X and rsh applications using these ports before - it could be something, could be nothing. Why inetd has it instead of something else is a bit strange admittedly. Perhaps you should say "What service is OPENING port 1025?" ------------------------------------------------------------------------------ It is likely that, while inetd has issued a listen() call on its file descriptor bound to port 1025, it has no accept() call pending. Hence, your attempts to exchange data with it won't succeed. The server process is inetd, as lsof has already told you. Lsof only reports on open files associated with a particular TCP address, so it's pretty clear that only inetd has an open file with a TCP association with port 1025. On my AIX 4.1.4 test system and on others, if follow-up postings are any indication, port 1025 is normally registered via portmap to ttdbserver, and rpcinfo says that. Your /etc/inetd.conf file may be subtly different, causing a different set of port allocations to occur when inetd starts. If you're running ttdbserver (a line in /etc/inetd.conf will tell you that), its port is probably 1025 plus a small increment. In the sense you mean, there probably isn't a process listening on port 1025. Stated more correctly, it's certain that inetd is listening, but probably not true that it is accepting connections. The assignment of port 1025 to TCP is probably an artifact of a bind() call in inetd's initialization. You probably can't turn it off. I don't think you need to worry about it, either. If you're really concerned, you should probably run tcp wrapper and block outside access to port 1025. I think it's more common for port 1025 to be allocated to ttdbserver. On my AIX 4.1.4 test system port 1024 exhibits the same symptoms you observe, probably for the same reason I have already mentioned; it's an artifact of inetd initialization. What is probably happening is that inetd calls socket() and bind() to get a non-reserved port, may use that socket for communicating with something, but never releases it. Considerably less likely is that the port is used for communication between the kernel and inetd. I've never heard of an inetd implementation where that is done, but I do know that it's common for kernels to allocate UDP ports for communicating with automount daemons. While netstat will show that those UDP ports are in use, lsof can't find any open files associated with them, because there are none. ============================================================================== 97.008 Customizing SMIT ============================================================================== I have searched a number of posts concerning how to customize SMIT, but have never seen any examples posted. Does anybody have any good examples, or could some kind soul email me the sample stanza's from the 4.2 General Programming Concepts? ------------------------------------------------------------------------------ SMIT is buried in the OS, there isn't some single directory which contain the menu screens as ASCII files. Some people might be tempted to build a slimmer SMIT from scratch rather than mess with the current one. The other problem is that 2 versions of SMIT exist: One for X and one for ASCII. They use the same ODM definitions, just with a different interface. If you change one, you've changed them both. Not only was there a very good article published about hacking SMIT (I can't remember the magazine, off-hand), I think it is actually talked about in an IBM "red book" somewhere. RS/Magazine, October 1994 had an article by Aeleen Frisch about customizing SMIT. It is also covered in the IBM Advanced AIX Administration course (or it was when I took it a couple of years ago, at least). Pretty much everything in SMIT (if not 100%) is in ODM databases. You can copy them, modify them, and use them from another directory and make all kinds of parallel menu systems... I would say that SMIT is designed to be extended (most LPP's do it). I think the "Applications" menu item exists as a place to put customized SMIT entries. Just make sure you save your ODM stanzas so you can reinstall your SMIT screens if you should happen to wipe them out during an OS upgrade. I'm not sure I would alter any existing SMIT screens, but I would have no qualms about creating new ones. I had posted some basic steps about customizing SMIT some months ago. You may still be able to find it on DejaNews. Here is a "cut-and-paste" from that article: I don't know if "nasty" is the right description. In my opinion it is not particularly obvious or intuitive, but once you get a feel for what the mechanism is it is fairly straightforward. There's just that initial hurdle to get over. There was an article in the October 1994 issue of RS/Magazine that goes into some detail on how this is done. If you don't have that issue handy, I would recommend you experiment on a non-critical machine: 1) Make a temporary copy of the SMIT database in a temporary working directory: cp /etc/objrepos/sm* /some/temp/directory 2) Use the odmget command to make ASCII text copies of the SMIT ODM databases: odmget sm_cmd_hdr > sm_cmd_hdr.ascii odmget sm_cmd_opt > sm_cmd_opt.ascii odmget sm_menu_opt > sm_menu_opt.ascii odmget sm_name_hdr > sm_name_hdr.ascii 3) Study these four files and look for the patterns and how they fit together and interrelate. 4) Find a SMIT menu that does something similar to what you are trying to accomplish and duplicate it's stanzas in a new ASCII file, changing whatever parts are necessary. 5) When you're ready, add your new menu to the TEMPORARY SMIT directory (probably under the "Applications" heading): cd /some/temp/directory export ODMDIR=. odmadd your_file_name 6) Test the new version of SMIT: smitty -o /some/temp/directory 7) When you have things as you want them, make another (backup) copy of the original SMIT database (see step 1), then copy the modified files from your temp directory to the /etc/objrepos directory. The modified files are now "official". If problems subsequently develop, you can copy the saved backup files back to /etc/objrepos and start again. This should be enough to get you started. The most important thing is to ALWAYS have a good backup of the ODM files before you commit anything. Just keep testing away with the temporary database you created until you get it right, THEN copy it permanently. ============================================================================== 97.009 Setting password ============================================================================== How can I set a password (I'm using expect like: passwd $uname $password) without giving first the root's password or the old password of the user? ------------------------------------------------------------------------------ Here's a C program that I've been using on both 3.2.5 and 4.1.4. Just compile and run it to see the syntax. I use this in scripts when adding many users at once. /* * Set's a users password from the command line * * To compile, run * * $ cc -o setpwd setpwd.c -ls * * * History * * 6 Oct 93 Overwrite the argv[] entries for passwords to stop * 'ps' snoopers * 7 Oct 93 Add call to set the seed */ #include #include #include #include #include #include #include /* * Variables required by getopt */ extern int optind; extern char optopt; extern int opterr; extern char *optarg; int getopt(int argc, char **argv, char *option); /* * Encryption algorithm declarations */ extern char *crypt(char *,char *); /* * Possible characters for the salt */ #define SALT "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXRZ0123456789" #define SALT_LENGTH (2) /* * ETC_PASSWD_FILE is the actual password database */ #define ETC_PASSWD_FILE "/etc/passwd" /* * Choose a random character from a string */ static char random_char(char *ch_list) { int no_of_chars; int index; no_of_chars = strlen(ch_list); index = rand()%no_of_chars; return ch_list[index]; } /* * Generate a salt of SALT_LENGTH characters returned as a null terminated * string. The return code is overwritten on each call so save if required */ char *generate_salt() { int loop; static char salt[SALT_LENGTH+1]; for (loop = 0 ; loop < SALT_LENGTH ; loop++) { salt[loop] = random_char(SALT); } salt[SALT_LENGTH]='\0'; return salt; } /* * Initialise the random number generated based on the current time as * a seed */ void initialise_generate_password() { time_t ltime; time(<ime); srand(ltime); } /* * Encrypt a password using the salt. */ char *encrypt_password(password, salt) char *password; char *salt; { char *pwd; pwd=crypt(password,salt); return pwd; } /* * Print a usage message and exit */ void usage() { fprintf(stderr,"setpwd: Usage setpwd -u userid -p password [-a][-e]\n"); fprintf(stderr," -a User not prompted for new password on first login\n"); fprintf(stderr," If password is -, password read from stdin\n"); fprintf(stderr," -e Password already encypted\n"); exit(1); } /* * Set the users password */ int main(int argc, char **argv) { int arg; char *user=NULL; char *password=NULL; struct userpw newpw; struct userpw *oldpw; char *salt; char *pwd; struct passwd *etcpasswd; FILE *passwdfp; char buffer[BUFSIZ]; int noadmchg=FALSE; /* Force user to change when logs in */ int pwdencrypt=TRUE; char *etc_passwd_entry="!"; initialise_generate_password(); /* Set the seed */ while (arg!=EOF) { arg=getopt(argc, argv, "u:p:ae"); switch(arg) { default: case '?': usage(); break; case 'u': user=strdup(optarg); /* Set the user */ memset(argv[optind-1],'\0',strlen(argv[optind-1])); break; case 'p': password=optarg; /* Set the password text */ if (strcmp(password,"-")==0) /* Password from stdin ? */ { fgets(buffer,sizeof(buffer)-1,stdin); if (strlen(buffer)!=0) buffer[strlen(buffer)-1]='\0'; password=buffer; } else { password=strdup(password); memset(argv[optind-1],'\0',strlen(argv[optind-1])); } break; case 'a': noadmchg=TRUE; break; case 'e': pwdencrypt=FALSE; break; case EOF: break; } } if (user==NULL && password==NULL) usage(); /* * Check that both a user and a password are supplied */ if (user==NULL) { fprintf(stderr,"setpwd: you must supply a user id using the -u parameter\n"); exit(2); } if (password==NULL) { fprintf(stderr,"setpwd: you must supply a password using the -p parameter\n"); exit(3); } /* * Now create the entry to update the password. An empty password * encrypts to the empty string. */ if (!pwdencrypt) { etc_passwd_entry=pwd=password; } else if (*password!='\0') { salt=generate_salt(); pwd=encrypt_password(password,salt); /* Encrypted password */ } else { pwd=""; } strcpy(newpw.upw_name,user); newpw.upw_passwd=pwd; time(&newpw.upw_lastupdate); /* Update time */ if (noadmchg) newpw.upw_flags=0; else newpw.upw_flags=PW_ADMCHG; /* Force user to change when next login */ if (putuserpw(&newpw)!=0) /* Enter the password */ { perror("putuserpw"); fprintf(stderr,"setpwd: cannot set password information for %s\n", user); exit(errno); } /* * For a new user, the password entry in /etc/passwd is set to '*' * This means password not set. This must be changed to a '!' to * mean 'look in /etc/security/passwd' */ if (setuserdb (S_WRITE)) { perror("setuserdb"); fprintf(stderr,"setpwd: cannot open password database for writing\n"); exit(errno); } if (putuserattr (newpw.upw_name, S_PWD, etc_passwd_entry, SEC_CHAR)) { perror("putuserattr"); fprintf(stderr,"setpwd: cannot change password entry to %s\n",etc_passwd_entry); exit(errno); } if (putuserattr (newpw.upw_name, NULL, NULL, SEC_COMMIT)) { perror("putuserattr"); fprintf(stderr,"setpwd: cannot commit changed to password database\n"); exit(errno); } if (enduserdb()) { perror("enduserdb"); fprintf(stderr,"setpwd: cannot close password database\n"); exit(errno); } return 0; /* All o.k. */ } ============================================================================== 97.010 Stripping across 3 disks (RAID 0) ============================================================================== Can anyone tell me how can I make use of LVM to form a logical Volume which stripes across three disks? How can I control the block size to form such RAID 0 logical volume? ------------------------------------------------------------------------------ Here's the procedure (use SMIT) 1. Create a volume group to contain the three disks that you want to stripe across. 2. Add a logical volume to the volume group. The very last parameter is the stripe size. You can select: Not Striped, 4K, 8K, 16K, 32K, 64K, 128K This will also allow you to control the block size as you wanted. Important note: DO NOT mix striped and non-striped logical volumes in the same volume group or you will lose the performance advantage of striping. ============================================================================== 97.011 Netscape Server ============================================================================== I have just installed the Netscape FastTrack Server V2 on AIX 4.2, but I can't find a way to get it to boot up at start time. ------------------------------------------------------------------------------ mkitab "httpd:2:wait:/etc/rc.httpd >/dev/console 2>&1" Now add a file something like the following for /etc/rc.httpd: #!/bin/sh SERVERLOCATION=/some/directory $SERVERLOCATION/start ============================================================================== 97.012 4.2.1 NFS bug ============================================================================== We have a machine running AIX 4.2.1. From a Solaris machine we mount /home/bob. On the AIX machine if /home/bob/foo is created with the shell redirect (">") it gets its timestamp from the remote machine. If /home/bob/foo is created by xlc or touch (and presumably other programs) it gets the local machine's timestamp. ------------------------------------------------------------------------------ A file gets different modification times depending on how it was created. This plays hell with make files. ------------------------------------------------------------------------------ IBM has reproduced this and seems to agree that it is a problem. When I know more I'll follow up. It is my understanding that files mounted over NFS always take their timestamps from their file server (the remote machine). I assume this is all hidden inside of the open() call. Why would the shell behave differently? A number of people have pointed out to me that this is the proper behavior of touch. Our real problem had to do with our clock skew. ============================================================================== 97.013 AIX PPP problem ============================================================================== I've been connecting Win95 PC's for home users to our RS6k using PPP. I'm running AIX 4.1.4 and I've got bos.net.ppp 4.1.4.10 (the latest I could find). Some users are having trouble connecting. I'm starting pppattachd from the .profile - no CHAP or anything. The problem is sometimes users have a terrible time logging in successfully. I turned on my syslog to debug and got some interesting errors, such as: May 7 15:09:45 ihq pppattachd[102082]: Failure to push encapsulation module : May 7 21:11:36 ihq pppattachd[5038]: ctl msg badebe07 May 7 21:13:36 ihq last message repeated 494 times I sent mail to IBM about this a good while ago but never got a response. Looking at a 4.2 system, it looks like file /usr/lib/nls/msg/en_US/ppp.cat (from bos.msg.en_US.rte) is there, but is missing on a 4.1.4 system. I thought that was the problem. I don't think there's a version of bos.msg.en_US.rte.4.1.* available which has this file. I tried just copying over this file from 4.2 to 4.1.4, but that didn't fly very well. There isn't much help in Infoexplorer or man pages concerning syslog messages. Does anyone know: 1) what do these messages mean? 2) what overpriced IBM publication has info about PPP's syslog messages? ------------------------------------------------------------------------------ Sometimes you can get it by context. Upgrading to 4.2 looks like the only reasonable solution, though. (May I recommend the freely-available pppd? It works wonderfully on all 4.* versions of AIX -- you don't need 4.1.4 -- and it's about 10 times more flexible and easier to set up than bos.net.ppp.) ============================================================================== 97.014 tput cup not working ============================================================================== I am trying to place the cursor to a particular spot using tput cup. All documentation and some programming examples I have say that doing a "tput cup $row $col" should place the cursor at the defined $row and $col. I have tried more than several variations including putting the output from tput cup into a variable, echoing that out with $row $col and still can not get it to work. ------------------------------------------------------------------------------ tput cup does work in 4.2 not in 3.2.5. The following code can be used to fake it out in 3.2.5, I put a different program in tput's place to see if cup is being called. If it is.. it runs this.. if not.. it runs the original tput. Not the best solution, but I need portability to other platforms. Just an FYI: cvvis (cursor very visible), civis (cursor invisible), cnorm (cursor norm) isn't supported by tput either. Here's the "fake tput cup" routine. /*********************************************************************/ /* tputcup.c: */ /* */ /* This program positions the cursor at the row and column specified */ /* on the command line. */ /* */ /* To compile, use the following command: */ /* */ /* cc -o tputcup tputcup.c -lcurses */ /* */ /* Examples: */ /* */ /* 1. tputcup 1 1 */ /* */ /* Positions the cursor at the top left corner: row 1, column 1 */ /* */ /* 2. tputcup 12 40 */ /* */ /* Positions the cursor at row 12 column 40 */ /* */ /* NOTE: Top left position is 1,1 and not 0,0. */ /* */ /*********************************************************************/ #include #include #include main(int argc, char **argv) { if (argc != 3) { fprintf(stderr, "Usage: tputcup row column"); exit(1); } setupterm(0,1,0); if (atoi(argv[1]) < 1 || atoi(argv[1]) > tgetnum("li")+1) { fprintf(stderr, "Row not valid"); exit(1); } if (atoi(argv[2]) < 1 || atoi(argv[2]) > tgetnum("co")+1) { fprintf(stderr, "Column not valid"); exit(1); } putp(tparm(cursor_address, atoi(argv[1])-1, atoi(argv[2])-1)); } ============================================================================== 97.015 Memory usage in AIX 4.2 ============================================================================== I have a RS/6000 model 595 with 1GB memory. Do I have to do something special when compiling/linking a program to use a large memory space? I tried a code that should not be too large and it said there was not enough memory to run the program now. No other user processes were going at the time. How can I tell how much free memory I have at any given time, or who is using memory at the time? ------------------------------------------------------------------------------ Remember to use the bmaxdata option on the linker or your program will be limited to 256 meg. At least this is the case on AIX 4.1.x. - -bmaxdata:0x80000000 will allow a program to use up 2GB. Check the size of maxdata with the command dump -o ============================================================================== 97.016 System information on RS6000 running AIX ============================================================================== Is there a command to display system information such as processor speed and type (601, 604, etc.), as well as how much ram the machine has, and the total size of the hard disk? ------------------------------------------------------------------------------ Well, not all in one "convenient" place. Try this for starters: lsattr -E -l sys0 -a realmem lsattr -E -l proc0 -a type lscfg | grep hdisk ============================================================================== 97.017 Saving startup/shutdown console output ============================================================================== I would like to be able to save the console output from both system startup and shutdown for troubleshooting purposes. Does AIX automatically do this? Is there a setting somewhere that turns this on and off or is this something that you have to manually script? I have checked through my documentation and can't find mention of it. I also know there are errlog files but these don't seem to catch everything I would like to save. ------------------------------------------------------------------------------ Please look in /var/adm/ras/bootlog. While booting, messages is written here about all commands executed. If you have put something into /etc/rc.local or /etc/rc.shutdown, You can edit these files and add something like: hname=`hostname` DATE=`date +"%y.%m.%d.%H.%M"` TFILE=/tmp/system/rc.local.out.$DATE number=1 export number mkdir /tmp/system > /dev/null 2>&1 /bin/echo "CHECK $TFILE FOR THE PROGRESS OF /etc/rc.local" /bin/echo "FOR A FINAL REPORT SEE $OPFILE" # # /bin/echo "$0 Started on "`date` > $TFILE /bin/echo "$0 Started on "`date` /bin/echo "($number)START CLEANING /etc/rmtab" /bin/echo "($number)START CLEANING /etc/rmtab" >$TFILE /bin/rm /etc/rmtab >> $TFILE 2>&1 /bin/touch /etc/rmtab >>$TFILE 2>&1 /bin/echo "($number)FINISHED CLEANING /etc/rmtab" >> $TFILE /bin/echo "($number)FINISHED CLEANING /etc/rmtab" number=`/usr/bin/expr $number + 1` >>$TFILE 2>&1 and so on. This will capture all output from all commands executed from these scripts. ============================================================================== 97.018 syscall tracing ============================================================================== I use AIX at work, and I want to do traces of programs occasionally, to see where something is being held up. For example, I'm looking for a utility, like truss/trace/strace, which exists in other versions of unix. Does a program like this exist? ------------------------------------------------------------------------------ There is a nice commercial utility named sctrace from www.tkg.com, it works pretty much like trace/truss on Solaris. AIX contains an excellent built-in trace facility (the trace and trcrpt commands), but just for tracing system calls this produces too much detail. You can use the shell script at to filter out much of the low level events not interesting for system call trace. ============================================================================== 97.019 Help in starting the DCE client ============================================================================== I have a RS/6000 590 that runs AIX 4.2. I recently installed the DCE client from the AIX 4.2 media. After I configure the DCE it tries to start the dce client service in port 135 and failed: Configuring RPC Endpoint Mapper (rpc)... Cannot start dced, port 135 is already in use. ------------------------------------------------------------------------------ Make sure that llbd is not being started by /etc/rc.ncs. llbd also uses port 135. The DCE process that gets started instead will do all the same things that llbd does. ============================================================================== 97.020 Calculating date ============================================================================== How can I do some simple calculations with dates (For example, calculating the number of days between two dates)? How can I determine the day when I know the date (For example, will it be Wednesday or Thursday on July 2nd 1998)? Are there easy ways to do these things in a shell script? ------------------------------------------------------------------------------ /* DISCLAIMER * * THIS PROGRAM IS SUPPLIED FREE WITH NO SUCH WARRANTIES ATTACHED. USE IS * ENTIRELY AT YOUR OWN RISK. THIS PROGRAM MAY BE REDISTRIBUTED AS YOU SEE * FIT PROVIDING THAT ALL HEADER FILES REMAIN INTACT. * * ANY QUERIES REGARDING THIS PROGRAM MAY BE SENT TO terry@weavel.demon.co.uk. * * PLEASE FEEL FREE TO MAKE ANY MODIFICATIONS OR PORTS TO OTHER OPERATING * SYSTEMS. ALL THAT I REQUEST IS THAT YOU SUPPLY YOUR CHANGES SO THAT THEY * MAY BE INCLUDED IN A LATER RELEASE. * * * (C) TERRY MURRAY - Eclisplse Consulting Limited */ #include #include #include /* * Program : cnvdate * * Purpose : convert date to unix seconds and vice versa * * Author : (c) Terry Murray @ Eclispse Consulting Limited 7/12/95 * * Usage : * * cnvdate dd/mm/yyyy [hh:mm[:ss]] * or * cnvdate unix_time * or * cnvdate calcstr ... * * where calcstr is numtype * * num - positive numeric value * type - (s) second * (m) minute * (h) hour * (d) day * (w) week * * Returns : returns 0 - ok, 1 - error * * Notes : * THIS PROGRAM IS PROVIDED FREE AND MAY BE REDISTRUBUTED * PROVIDING THIS HEADER REMAINS INTACT. ANY QUERIES REGARDING * ITS USE MAY BE MADE TO terry@weavel.demon.co.uk. * * * * compile as cc -O cnvdate.c -o /usr/local/bin/cnvdate * chmod 755 /usr/local/bin/cnvdate */ char *pgmname; void usage(void); main(int argc, char *argv[]) { int day=0,month=0,year=0; int hour=0, min=0, sec=0; time_t unix_time; int err; int colons, nd, conv_type; int n; char c; register int i; register long secs; struct tm tms, *ptms; /* get the program name we are running as */ if ((pgmname = strrchr(argv[0],'/')) != NULL) pgmname = ++pgmname; else pgmname = argv[0]; /* we require one parameter at least */ if (argc < 2) usage(); /* what are we doing ? */ if (strchr(argv[1], '/') !=NULL) conv_type = 0; /* coverting date */ else { /* count no digits */ for(nd=0, i=0; i < strlen(argv[1]) ; i++) if (argv[1][i] < '0' || argv[1][i] > '9') nd++; if (nd == 0) conv_type = 1; /* converting date */ else conv_type = 2; /* converting calcstr */ } switch(conv_type) { case 0: /* convert date */ err=0; if (sscanf(argv[1],"%2d/%2d/%4d",&day,&month,&year) != 3) err++; if ( day < 1 || day > 31) err++; if ( month < 1 || month > 12) err++; if ( year < 1970 || year > 9999) err++; if (err) { fprintf(stderr,"Error : Invalid date specified\n"); exit(1); } /* validate optional time */ if (argc == 3) { err = 0; /* count colons */ for (colons=0, i=0; i < strlen(argv[2]); i++) if (argv[2][i] == ':') colons++; switch(colons) { case 1: if (sscanf(argv[2],"%2d:%2d",&hour,&min) != 2) err++; break; case 2: if (sscanf(argv[2],"%2d:%2d:%2d",&hour,&min,&sec) != 3) err++; break; default: err++; } if ( hour < 0 || hour > 23) err++; if ( min < 0 || min > 59) err++; if ( sec < 0 || sec > 59) err++; if (err) { fprintf(stderr,"Error : Invalid time specified\n"); exit(1); } } /* load structure and convert */ tms.tm_sec = sec; tms.tm_min = min; tms.tm_hour = hour; tms.tm_mday = day; tms.tm_mon = month-1; tms.tm_year = year-1900; tms.tm_isdst = -1; unix_time = mktime(&tms); if (unix_time == -1 ) { fprintf(stderr,"Error : Unable to convert\n"); exit(1); } /* print it */ printf("%ld\n", unix_time); break; case 1: /* converting to date */ if (argc != 2 ) usage(); /* check we have a numeric string only */ err=0; for(i=0; i < strlen(argv[1]) ; i++) if (argv[1][i] < '0' || argv[1][i] > '9') err++; if (!err) { /* convert to real date */ sscanf(argv[1],"%ld\n",&unix_time); if ((ptms = localtime(&unix_time)) == NULL) err++; } if (err) { fprintf(stderr,"Error : Invalid unix_time\n"); exit(1); } /* display date */ printf("%02d/%02d/%04d %02d:%02d:%02d\n", ptms->tm_mday, ptms->tm_mon+1, ptms->tm_year+1900, ptms->tm_hour, ptms->tm_min, ptms->tm_sec); break; case 2: /* converting calcstr */ err=0; secs=0; for(i=1; i< argc; i++) { if (sscanf(argv[i],"%d%c",&n,&c) != 2) err++; if (!err) { switch(c){ case 's': secs += n; break; case 'm': secs += n * 60; break; case 'h': secs += n * 3600; break; case 'd': secs += n * 86400; break; case 'w': secs += n * 604800; break; default: err++; break; } } if (err) { fprintf(stderr,"Error : Inavlid calc string\n"); exit(1); } } printf("%ld\n",secs); break; } /* exit ok */ exit(0); } void usage(void) { fprintf(stderr,"\nTerry Murray @ Bass Brewers 7/12/95 ver 1.00\n\n"); fprintf(stderr,"Usage : %s dd/mm/yyyy [hh:mm[:ss]]\n",pgmname); fprintf(stderr,"\t\tor\n"); fprintf(stderr," %s unix_time\n",pgmname); fprintf(stderr,"\t\tor\n"); fprintf(stderr," %s calcstr ... \n",pgmname); fprintf(stderr,"\n\twhere calcstr is numtype\n\n"); fprintf(stderr,"\t\tnum - positive numeric value\n"); fprintf(stderr,"\t\ttype - (s) second\n"); fprintf(stderr,"\t\t (m) minute\n"); fprintf(stderr,"\t\t (h) hour\n"); fprintf(stderr,"\t\t (d) day\n"); fprintf(stderr,"\t\t (w) week\n\n"); exit(1); } ============================================================================== 97.021 PPP server working fine but... ============================================================================== I have configured AIX's PPP server on my 43P at work so that I can dial in and connect from home. At home I have a PC running Linux/Win95. Everything works fine but when I dial in AIX assigns me an IP address from a range of addresses I have allocated it. This is ok at the moment as I am the only person dialing in. However, in the near future more people will want to dial in. What I want to do is for the PPP server to assign an IP address dependant on the user name. I'm starting the PPP session by connecting as a user (pppuser) and then exec'ing the pppattachd. The last 2 lines in the .profile read... echo "Hello" exec /usr/sbin/pppattachd server inactive 900 2>/dev/null The chat script at the client end just waits for the "Hello". So what I am after is say username IP always = pppuser1 192.168.3.1 pppuser2 192.168.3.2 pppuser3 192.168.3.2 regardlesss of what order the ppp users connect in. I know this should be possible as when I connect to the internet through my ISP I am always given the same IP address, which is obviously determined by my login name. ------------------------------------------------------------------------------ You may want to use DEMAND interfaces instead of server interfaces... In each PPP user's .profile you could do: export PPP_DEMAND_NET=[some_number] exec /usr/sbin/pppattachd demand 2>/dev/null The PPP_DEMAND_NET environment variable will cause this user to be assigned the IP address for the interface of pp#... eg, if you export PPP_DEMAND_NET=3, then this user will be assigned the IP address associated with the PPP interface pp3. Note. If you change the PPP interface definitions (adding or removing demand interfaces) you change the index value. The correct way to correlate an interface number (ppX) to a network connection is using the file /etc/ppp/if_link.map which contains the interface number, its type and the correct index value. ============================================================================== 97.022 Process that cannot be killed by 'kill -9' ============================================================================== The parent process was xdm which was somehow being messed up by a user using the console. I killed the parent xdm process but the machine did not clean up its children whose PPID becomes 1. I could not reestablish xdm because of this dead process. I would like to avoid rebooting the machine because there are some queued jobs running. Using 'ps -ef' shows that root 13956 1 0 Jun 05 hft/1 26:32 /usr/bin/X11/X -T -force -auth /usr/lib/X11/xdm/A:0-M4IHe7 ------------------------------------------------------------------------------ Two things to try: 1. Make sure you're running as root when you try to kill this process. 2. Try the following little program: ----------- cut here ---------- #include #include #include int main( int argc, char *argv[] ) { if (argc!=2) { fputs("syntax: revoke tty-path\n", stderr); return EXIT_FAILURE; } if (revoke(argv[1]) != 0) perror("revoke failed"); return EXIT_SUCCESS; } ----------- cut here ---------- Call it "revoke.c" and compile it to "revoke". Then, as root, run: revoke /dev/hft/1 (/dev/hft/1 is the TTY from "ps -ef" with the "/dev/" added). That may help. Then again, it may not. If kill -9 (as root) doesn't work, there's usually not much you can do. The process is stuck in kernel mode. ============================================================================== 97.023 Large programs under AIX 4.2.0.0 ============================================================================== I have a problem with programs using large data memory space. To create a program allowing large data spaces it must be complied/loaded with the loader option -bmaxdata:0xY0000000, where 1<=Y<=8 tells how many data segments of 256 MB should be available. This works well for machines running AIX 3.2.5 and AIX 4.1.4. Under AIX 4.2.0 I'm not able to get more than 5 data segments (~1.2 GB) with exactly the same program. As a help I add a small program (not very elegant) to show the effects. /*------------------------------------------------------------*/ # include # include # define PAGE 0x00001000 /* 4 kByte */ # define MEGA 0x00100000 /* 1 MByte */ # define DATA 0x30000000 main() { while (sbrk(PAGE) != -1) ; printf("%4d 4k pages = %d Bytes\n", (sbrk(0) - DATA)/PAGE + 1, (sbrk(0) - DATA)); printf("%4d MByte %08X - %08X\n", (sbrk(0)-DATA)/MEGA, &end, sbrk(0)); } /*------------------------------------------------------------*/ Result on a AIX 3.2.5 machine: 524288 4k pages = 2147481156 Bytes 2047 MByte 30000644 - AFFFF644 Result on a AIX 4.1.4 machine 524288 4k pages = 2147481156 Bytes 2047 MByte 30000644 - AFFFF644 Result on a AIX 4.2.0 machine 327680 4k pages = 1342174788 Bytes 1279 MByte 30000644 - 7FFFF644A ^^^^^^^^^ This value suggested that there might be a problem in AIX 4.2.0 with the MSB, so that getting the beginning of the 6th segment is not available. Is there any other program developer struggled on that problem and has some fix (or maybe an explanation) for that behavior. Maybe it is a feature and not a bug? ------------------------------------------------------------------------------ Default data limit on stock systems is 128 MB. The maximum numeric value is 256 MB. Anything past that requires "unlimited", or -1. It's a bug. Get the fix for APAR IX64446. ============================================================================== 97.024 Deleting Big files don't free space (AIX 4.1.4) ============================================================================== I deleted big files of an Oracle database but AIX don't give me back the freed space until I umount/mount the filesystem. ------------------------------------------------------------------------------ If a process has that file open, then the disk space is not freed by the deletion of the file until the process is finished with it. Probably Oracle has the file opened and a refresh of the Oracle daemons would free the disk space. Using 'rm' merely unlinks that reference to the file. There could be another [hard] link to that file, or another process can have it open. If you want to remove the space used by that file while another process has it open, you can truncate it: cat /dev/null > the_file ============================================================================== 97.025 User name more than 8 characters ============================================================================== We want to go to naming convention of firstname_lastname@keller.clarke.edu for email and user name being firstname_lastname also. The directory would then be listed as /home/user/(8_character_name). However, when I use SMIT to create the user name craig_knier I get a name too long error. ------------------------------------------------------------------------------ If you have mail aliasing set up on your machine it is quite easy. Just edit the file aliases in /etc and add the line craig_knier:cknier then save and exit and run the command: newaliases ============================================================================== 97.026 What is TSM? ============================================================================== Our AIX console recently constantly receives the following messages: 3004-018 TSM was unable to execute "3" 3004-019 TSM encountered an error on terminal "/dev/tty17/0" The tty# may change, and those ttys are connected to some PC or terminal through serial cable. Do they mean there is something wrong with our RS232 serial line setup? ------------------------------------------------------------------------------ TSM is Terminal State Monitor; the noises you're getting aren't that uncommon, it usually occurs when you have an enabled tty and a device attached to a long (or poor quality) cable, and the device (PC, terminal) is switched off. You get quite a lot of electrical noise, because the cable's working as an aerial. Some of the noise gets misinterpreted as 'real' characters. The best fixes for this (IMO) are either 1) Don't switch the devices off or 2) set the tty login state to delay rather than enable. This means that TSM won't try to open the port until it's seen a carriage return, effectively desensitising things. ============================================================================== 97.027 Copying 3.5" diskette ============================================================================== Can anyone tell me how to make a copy of a 3.5" diskette? I'm running AIX 3.2.5 and want to make backups of my diagnostic diskettes. ------------------------------------------------------------------------------ dd if=/dev/rfd0 of=disk.img bs=36b count=80 Insert a formatted disk: dd of=/dev/rfd0 if=disk.img bs=36b ============================================================================== 97.028 Scroll history using arrow keys in ksh ============================================================================== How do I setup my .profile or environment so that I can scroll command history using the arrow keys? I would lke to use up and down arrow key to display history and select previous commands. I'm using vt100 emulation and ksh. ------------------------------------------------------------------------------ In .profile, make sure you export ENV=$HOME/.kshrc In .kshrc: set -o emacs alias __A="$(print '\020')" alias __B="$(print '\016')" alias __C="$(print '\006')" alias __D="$(print '\002')" ============================================================================== 97.029 System dump after crash ============================================================================== Every time after the system crashes, our server will reboot itself. But it will ask whether or not we want to perform a system dump before it actually got rebooted. Our server is located offsite and we need to get someone over there to answer this question before we can logon remotely again. How can I disable this and what is the side-effect? ------------------------------------------------------------------------------ Try "sysdumpdev -d /var/adm/ras". This (if I'm not wrong) should cause the system to attempt to copy a dump to a file in /var/adm/ras. If this copy fails, the system should continue to boot. The side effect is that if the copy fails, you lose any information the dump could have provided about the system crash. If you want to restore the default behavior (forcing a dump), try "sysdumpdev -D /var/adm/ras The other solution is to make a dedicated dump logical volume (the way AIX 3.X did dumps). You can create a logical volume big enough (use sysdumdev -e, I also use hd7 like 3.X did) for the dump and do "sysdumpdev -p /dev/hd7" to change the primary dump device. ============================================================================== 97.030 Resynching logical volume ============================================================================== I have two G40s running AIX 4.2, HACMP 4.2 & Oracle 7.3.2 with two SSA 7133 Model 600 subsystems consisting of 8 4.5 GB drives each, mirrored. My problem is that when I break the mirror, to do a cold backup of Oracle for instance, my resync of the volumes takes an inordinate amount of time. It seemingly copies over the entire volume, instead of literally synching up the disks. Is this what happens, is there a work around, or am I doing something wrong? ------------------------------------------------------------------------------ I'm sorry, but at present when you recreate the mirror after the copy, the entire lv contents get copied over. If you are running in mode 3, you'll see that the sync of the lv is a bit slower than non-HACMP cases. This is because as the vg is being sync'ed, it must coordinate with the other potential clusters that could be accessing the same drives. We have a work around for this: IX68373. This first checks to see if the sync'ing cluster is the only one that has that volume group varied on (no other node has done a varyonvg -c). If so, it drops into the mode of not checking/coordinating with other possible nodes and just does a sync. If a node goes online, then the sync will drop back into the slower sync that does coordination. This might not help you out in this specific instance, but it's good to know. ============================================================================== 97.031 RS/6000 LOAD code 538 ============================================================================== When booting the system fails with '538' on LED display. Does anyone know what this code means and are there any online resources to view a listing of what the LED numbers mean? ------------------------------------------------------------------------------ Several generalities: 1. Check out the LED prior to the LED 538. That, likely, is what is being configured. 2. Boot in service mode, import rootvg/mount file systems, and run "cfgmgr -p2 -v" to see if it craps out on a particular device. 3. Backup/zero-out /etc/rc.net and try to start the system without networking. ============================================================================== 97.032 Sendmail in AIX 3.2/4.1 ============================================================================== How can I send internet mail to another server? ------------------------------------------------------------------------------ To configure AIX 3.2/4.1 mail to relay outgoing Internet mail to another server, all you do is: (1) Make sure the AIX box has a fully qualified domain name (FQDN) (2) In a STOCK (unmodified) sendmail.cf, make the following changes: - Uncomment the OK macro (should read OK MX) - Change the DR macro to point to your mail relay host (e.g. DRrelay.domain.com) (3) Run 'sendmail -bz' followed by 'refresh -s sendmail' That should do it. Any mail not known locally should be forwarded to the Internet relay machine. ============================================================================== 97.033 Extending a volume group ============================================================================== I'm trying to add a new disk to a volume group and I get the following error: 0516-796 extendvg: Making hdisk2 a physical volume. Please wait. 0514-518 chdev: Cannot access the CuDv object class in the device configuration database. 0516-792 extendvg: Unable to extend volume group. ------------------------------------------------------------------------------ Check to see that your ODMDIR is set to /etc/objrepos. Check to see that /etc/objrepos/CuDv exists and has the right permissions. Does "odmget CuDv" fail? ============================================================================== 97.034 Firmware required to boot from SSA ============================================================================== I am trying to boot from external SSA drives on an R40. I have IBM documents that tell me I can, but I need firmware at or above 9.23. Going into diag, it tells me that the firmware level of the SSA drives has an ROSid of 8181. What does that mean? Is that 8.18.1? Or is the relevant thing the microcode level of the SSA adapters, of which I could see no means of determining the firmware level? ------------------------------------------------------------------------------ You need firmware A9.23 on the R40 itself. ROS Level and ID of 8181 is the level of microcode of the SSA disks; there is no special interpretation other than "8181". To check the adapters, run "lscfg -vl ssa#"; the "ROS Level and ID" should be 2002. You should never have multiple adapters in the loop that contains SSA drives in rootvg. ============================================================================== 97.035 Deleting nonexisting file ============================================================================== I have made a mistake when installing a software which located man page at /local/man/man1. And the file can not be removed as: drwxr-sr-x 2 root sys 512 May 29 09:19 gnuplot drwxr-sr-x 2 root sys 1536 Jul 30 1996 man1 drwxr-sr-x 2 root sys 512 Jul 24 1996 man3 drwxr-sr-x 2 root sys 512 Jul 30 1996 man5 drwxr-sr-x 2 root sys 512 Jul 30 1996 man7 -rw-r--r-- 1 root sys 1594 May 28 13:19 manl $ file man1 man1: directory $ more man1 man1 is a directory How can I remove file man1? ------------------------------------------------------------------------------ One method for removing files and directories with "goofy" names is to remove them using their inode number. This can be done with 'ls' and 'find'. WARNING: be careful when using 'rm -r' it can wipe out an entire file system and/or crash your machine. # ls -li /testdir the first column is the inode number # find /testdir -inum -exec rm -r {} \; ignore the "find: cannot chdir to..." error ============================================================================== 97.036 Logical volume mirroring ============================================================================== After a machine crash and restore I began recreating my file systems and re-mirroring them. When I reached the lv07 I received a message that lv07 already had copies. A lslv shows copies as 1. Any clues as to why and how to fix it? I'm running 4.2.0 on F30's. ------------------------------------------------------------------------------ Frequent problem at 4.2. Check your version of bos.rte.lvm ("lslpp -h bos.rte.lvm"); you probably need to upgrade it. ============================================================================== 97.037 ECC/Memory Scrubbing ============================================================================== Just recently I learned that to use ECC features on a system which has this type of memory, I need to activate 'Memory SCRUBBING' (-> smitty chgsys); by default no ECC is used. I enabled this on 3CT's, 580, even on old 320H's without problems, but on a 43P-140 this cannot be enabled, although IBM claims these models should have ECC DIMMs built in. If this is not possible, why should I pay for this exepensive memory? ------------------------------------------------------------------------------ This is NOT true, ECC mode is always used. In simple terms the extra bits in ECC memory store a checksum like code so that if the memory subsystem detects that the memory data is suspect it can be reconstructed from the ECC code. The number of extra bits stored will determine what errors can be detected and corrected. The ECC memory used in RS/6000 systems can correct single bit errors which are considered to be by far the most common memory errors. Memory scrubbing just does some extra checking when a single bit error occurs to determine if there is truly a potential problem. If you have no type of memory protection at best the system crashes, at worst the error goes unnoticed and now your data is corrupt. If you have parity checking memory, single bit errors will always be detected and usually the system dies as a result. With ECC memory single bit errors are detected and corrected on the fly and the system need not know anything has happened. If you want the details about scrubbing drop me a line and I will look it up for you, there is information about it in the RS/6000 technology book that was published when RS/6000 was announced. It seems to me that the hardware on the base memory cards was involved with the scrubbing "feature" so it would only be supported on machines that use these cards. It is still ECC memory and will protect you from single bit memory errors. ECC and memory scrubbing may just add some extra security. I suspect the feature has gone away because there is some question about how useful it really is. P.S. Not only are they ECC DIMMs but they also operate at 3.3 VDC not 5 VDC. ============================================================================== 97.038 Virtual host on AIX using ifconfig ============================================================================== I am trying to set up a virtual adapter on my AIX 4 box so that I can use virtual hosting. Does anyone know the syntax for AIX? This is what I tried... ifconfig le0:1 ip-address up # ifconfig le0:1 194.129.210.130 up 0821-515 ifconfig: error loading /usr/lib/drivers/if_le: A file or directory in... ------------------------------------------------------------------------------ I use "ifconfig en0 inet 194.47.244.20 alias" to add an alias and "ifconfig en0 inet 194.47.244.20 delete" to remove it. Put it in the rc.net startup script. ============================================================================== 97.039 AIX 3.2.5 -> 4.1.4 migration ============================================================================== I am about to go through several 3.2.5 to 4.1.4 migrations. I have heard that this migration is not as "cut and dry" as the 4.1 -> migrations. Has anyone gone through this before? If so, can you please fill me in on some of the "gotcha's" that I should be aware of? ------------------------------------------------------------------------------ You will have to reconfigure your print queues. Other than that, there was a reconfiguration of tcpip to re-enter the hostname and the addresses... I did this migration for many servers with the CDROM AIX V4.1.4 in 'migration' mode. It worked fine but as usually it is better to do a 'smitty mksysb' before and save a few directories: /etc, /var/spool, etc. Many files (/etc/rc.nfs /etc/rc.tcpip ... /var/spool/cron/crontabs/root) are changed and it is preferable to keep the old files to compare them to the new. ============================================================================== 97.040 Corrupted ODM ============================================================================== After some system trouble, I am getting the following error when listing out the LV's in particular volume groups: 0516-022 lsvg: Illegal parameter or structure value. 0516-304 lsvg: Unable to find device id 0000000000000000 in the Device Configuration Database. I made several attempts using the exportvg, importvg commands and the errors still appear. Any ideas on what to try? The volume groups that appear corrupt are not the rootvg. ------------------------------------------------------------------------------ Check your setup by looking at lspv output, the device id is the second column, the id you are seeing proabably won't appear. The ODM can be fixed with "reducevg -df vgname pvid" where the pvid in this case is 0000000000000000 Just be sure, check other ODM stuff like, lsdev -Cc disk. Any disks hanging in the DEFINED state that you know you don't have use rmdev -l device -d. You may also have a partially mirrored logical volume. For each logical volume in the volume group in question, run: lslv -m When one of them comes up with output that isn't equal (in terms of mirrors), then that's the lv giving you problems. Remove the "short" mirror with rmlvcopy and remake with mklvcopy. ------------------------------------------------------------------------------ You only get the value 000000000000000 when the system is unable to read the volume information from the physical disk. The PVID is stored on the disk and must be read by the system prior to it doing anything with the disk. If it can't get the PVID it won't know what VG it's supposed to be in. This tends to mean that: A. You have a phantom disk, say one that is dual ported and/or Scsi-Reserved by something. (In the case of a crash it's POSSIBLE that your PV can be scsi reserved by your machine. I once had a problem where the disk was reserved (I assume) by the adapter, which I had changed the software address of, then the machine died. When the system came up, it saw the disk reserved (and not by it's ID I guess) and so it was marked with PVID 00000000000.) B. Your disk is dead C. Your disk is mostly dead D. Your scsi bus is a little screwy. So, your ODM would appear to be ok (unless of course your disks are brand, spanking new, in which case they should probably show "None and None" when you do an lspv in any case, and not 000000000000.. So, check your disks & your scsi first off. ============================================================================== 97.041 F/W SCSI internal vs external ============================================================================== I have a 39H with an internal SCSI fast/wide 2GB hard disk. Currently I have nothing connected to the external SCSI port, but am thinking about connecting a old Exabyte tape drive. Since all tape devices are to my understanding single ended (or whatever the proper term is), would I then be forcing the internal SCSI drive to run in the slower single ended mode or are the internal and external SCSI adapters separate from each other? I do understand that if I were to add anything else to the external SCSI with the tape drive that the whole thing would be forced to run in single ended mode (at least I think that is the case). ------------------------------------------------------------------------------ The integrated SCSI adapter in the 39H is equivalent to a single ended F/W adapter (4-7). Both the internal and external buses are single ended but are for the most part independent of one another. There is no difference in the speed of a single ended SCSI-2 F/W bus as compared to a differential SCSI-2 F/W bus. The big difference is that the differential bus is more reliable, and because of this supports much longer cable lengths. Not all tape drives are single ended even Exabyte makes differential 8mm tape drive so check your unit carefully. Most large SCSI tape drives such as 0.5 inch cartridge units are differential so that they do not have to be located within a couple of feet of the host system, in fact when such drives are mounted in tape library unit, you would exceed the maximum cable length of single ended just getting the cables from the drives to the outside of the library! ============================================================================== 97.042 Tcpdump on AIX ============================================================================== Does anyone know if tcpdump compiles on AIX? If not, is there a utility on AIX similar to tcpdump or snoop? Anyone have any idea of a good configuration for an AIX box if I want to use it to sniff TCP packets? ------------------------------------------------------------------------------ tcpdump is included with AIX 4 in the package bos.net.tcp.server. ============================================================================== 97.043 US Robotics Modem setup ============================================================================== When I try the commands "cu -ml tty1" or "cu -ml /dev/tty1" I get the message cu: 0835-028 The connection failed. NO DEVICES AVAILABLE. I am logged on as root but getty is running on tty1. Could this be stopping me accessing the port ? ------------------------------------------------------------------------------ If you set tty1 as dial-in, then you must execute "pdisable tty1" first before doing "cu -ml tty1" command. After you set the modem with cu command, then run "penable tty1" to make it run as dial-in modem. If you set it as dial-out modem, then actually it is ok. If you choose login=enable then it is dial-in. If you choose login=disable then you choose a dial-out connection. Don't forget to add "Direct tty1 - Any direct" in the /usr/lib/uucp/Devices file. ============================================================================== 97.044 Running out of logical partitions ============================================================================== I have a 4.5 GB drive running under AIX 3.2.5. I have created one 2 GB logical volume that uses 1000 logical partitions. Whenever I try to create a new logical partition to utilize the free space on the drive I get the following error messages: 0516-404 allocp: Not enough resources available to fulfill allocation. Either not enough free partitions or not enough physical volumes to keep strictness. Try again with different allocation characteristics. 0516-822 mklv: Unable to create logical volume. How can I utilize this unused disk space? ------------------------------------------------------------------------------ You have made this lv such that it can not be extended beyond 1000 LP's. Change this value to 1016 (or whatever) and then grow it. Now for the bad news. A very good point has been brought out that this drive violates the 1016 max PP's limit. This is not really a big deal UNLESS a) you try to do mirroring or b) you move this into AIX V4 and try to do lvm actions that change the size of the lv's on the disk or try to extend the volume group with another disk. So before you move up to AIX V4, back up the data to tape of all the logical volumes on the disk, delete all the logical volumes and the volume group, recreate the volume group with a PP size of 8MB, and then recreate the lv's and filesystems. Reload from the backup tape and you're done. ============================================================================== 97.045 mkszfile errors ============================================================================== After a crash and restore on an F30 running 4.2.0 I am getting the following errors from the mkszfile -f command: 0516-022 lsvg: Illegal parameter or structure value. 0516-304 lsvg: Unable to find device id 0000000000000000 in the Device Configuration Database. This system includes 4 128 port controllers, 23 remote rans, and 350 ttys. So the ODM had to be rebuilt from backup data for ttys, sa's, and cxia's. This rebuild seemed work ok. But I'm wondering if somehow the rebuild has left bogus lv's in the ODM. ------------------------------------------------------------------------------ This isn't something in the ODM (notice the message about it not being found in the Device Configuration Database). You probably have an LV that has a hole in its map (maybe a mirrored one). Run "lsvg -l rootvg" (or whatever volume group) and look at the LV AFTER the error. Then run "lslv -m LVname". Look for missing partitions. If it's a mirror that is incomplete, you can remove/recreate/resync it. ============================================================================== 97.046 Booting to single user mode ============================================================================== A maintenance boot from CD will ignore the system's current ODM database, which is bad when you, for example, have dozens of disks. Any known way around this problem? ------------------------------------------------------------------------------ The boot image has its own ODM. It gets created during bosboot and cfgmgr. A install CD-rom won't have one to match the system. Run cfgmgr after all filesystems are mounted. You can verify the need for this by running the lsdev command ("lsdev -Cc disk") to see what drives were configured. I am not sure if this will be necessary. Another method is, from a system running in multi-user mode: shutdown -Fm where F -> fast shutdown (not required, but system does a 60 sec sleep first) m -> come down to single user mode for maintenance. ============================================================================== 97.047 Hostname changes to "localhost" on reboot ============================================================================== I have a E30 running 4.1.4 that whenever it is rebooted the hostname changes to "localhost". I go into SMIT and change the hostname back to what is supposed to be and all is fine until another reboot. Then the hostname is back to "localhost". ------------------------------------------------------------------------------ I have seen that before. It turned out (for us) the culprit was /etc/rc.net (or was it rc.tcpip??... can't remember) was not executable. A quick chmod +x /etc/rc.* seemed to fix the problem. ============================================================================== 97.048 snmp ============================================================================== How can I enable a SNMP managed node to send trap to the NMS NetView? ------------------------------------------------------------------------------ [1]What is the operating system of the "SNMP managed node"? This is also referred to as the agent. [2] NMS Netview is somewhat of a contradiction. I think. NMS in my experience refers to the Netware Management Station Software that manages Netware clients over IPX/SPX. Netview, on the other hand, typically runs on AIX machines. Unless that has been some refinement in NMS, what is your manager station? Is it Netview on and AIX/RS6000 platform or NMS running on an Netware System? Or is there actually an NMS Netview? BASIC INFORMATION This dicussion is limited to the SNMP protocol, a subset of TCP/IP. SNMP Management takes advantage of heterogenous environments (different operating systems, hardware, etc) by reducing the environment to the simple concept of network-manager and network-entity (or agent). The requirments for SNMP management is that the network entity (agent) must communicate over TCP/IP and have an SNMP agent program (on unix machines, the SNMPD daemon is the agent program). It is possible for non-TCP/IP agents to be monitored; however, a proxy machine would have to be used to monitor the agent. The proxy machine would then be responsible for communicating with the manager (over tcp/ip and its snmp agent program). You're probably aware, but just in case, that there are 2 types of conversations that take place between a manager and an agent: solicited and unsolicited: Solicited: also referred to as polling. In this type of conversation, the manager queries the agent for information. Unsolicited: also referred to as traps (which you asked about). In this type of conversation, the agent reports back the manager (typically when something is wrong). SNMP MANAGEMENT: MONITORING AN AGENT, THE EASY WAY This discussion uses an example where the Netview Manager is running on an RS6000 named THE_MAN and an agent, also an RS6000, named THE_CHILD. The procedure for monitoring an agent is usally very simple. The following steps are involved: configure the snmpd.conf file (or a similar file on the agent that authorizes the snmp conversations); start the snmpd daemon (or similar snmp agent program); configure the manager to use the appropriate community string for conversation with the agent; load the mib files into the manager (an agent should come with such a file; (when the mib file is loaded in the manager, it helps to translate the messages that come from the agent into human terms). Now suppose I wanted to monitor the disk space on machine THE_CHILD. I cannot do this with just Netview (running on the manager) and SNMPD (running on the agent). The SNMPD daemon does not provide this information. Enter TRAPGEND. This piece of software is distributed with the Netview distribution and can be loaded on the agent machine. It is called a Peer Agent to SNMPD. A Peer Agent commnicates with the SNMPD daemon using the SMUX Peer Protocol (you don't have to worry about the protocol). Working together, the TRAPGEND and SNMPD provide the ability to monitor an RS6000s disk space. Now suppose I want to monitor the queues on an RS6000. The TRAPGEND daemon does not support this. Enter System View 6000. System View 6000 provides a better Peer Agent to SNMPD for RS6000s. In fact, I like to call it the "Super SNMP Peer Agent" It can tell you everything about an RS6000. More than that, if there is something that it does not support, it provides a means--a graphic interface...it doesn't get any easier than that--for you to extend the MIB. SNMP MANAGEMENT: MONITORING AN AGENT, THE HARD WAY Suppose you are using Netview as your manager and you have an a Linux machine that you want to monitor. The Linux machine has an SNMPD daemon; however, you want to monitor disk space. Unfortunately you don't have a peer agent available, so you have to write one (or you could rewrite SNMPD...I wouldn't advise it). Aside from that, you have to write a MIB file (using the private extension). This involves a lot of work and how to do is another topic. I do have examples of doing this on an RS6000. The point here is that you want to avoid having to work this hard. SNMP Management can be simple if you know what to look for in your agents. SUMMAEY: SPECIFICALLY WHAT YOU WANT TO DO You said... >> I want put a message (type string) in this trap. This message have >> always the same format : >> >> example 1: >> " 0046 CM2 error" >> >> example 2: >> " 0140 Atlas error" >> >> Those messages are generated regularly. >> >> I don't know how to develop the program (on managed node)which send the >> trap. Sounds like you're leaning towards the hard way of having to write some code. Answer my previous questions and lets see if we can avoid this. I assume that the SNMP node is not sending this trap back to the manager, is this correct? Secondly, send me the MIB file of the agent (again what is the agent's O/S?). You may be able to query the agent (solicited conversation) instead of trappng. You said... >> >> I don't know how to develop the program (on manager NetView) which >> receive, decode and put it in a window on NetView6000 environment. You won't have to write any program if you're using Netview. You would just load the MIB file and configure whatever actions, if any, you would perform on the trap (e.g. like digital page). You said... >> >> I know the format of a PDU trap : >> >> version : OK >> Community : OK >> PDUtype : OK (trap = 4) >> Enterprise : ? >> Agent Adress : ? >> Generic Trap : ? >> Specific Trap : ? >> Time Stamp : ... >> Variable Binding List : I know it needs a OID and a value : the value is >> my message type string but the OID ? >> >> Do I need to write a private MIB just for one type of trap? If yes, what >> is the way to put this one in the NetView environment ? >> I don't know if you will have to rite a MIB, that depends upon what the agent's MIB file looks like. Again, send it to me. If you don't know what or where it is, give me the agent's O/S and the agent program if it is not SNMPD. I'll help you find it. The MIB file extensions are usually *.DEF or *.MIB or *.TBL. ============================================================================== 97.049 Resolving domain names ============================================================================== How do you force the system to search the hosts file first, before using DNS to resolve the domain names? ------------------------------------------------------------------------------ Add a file called /etc/netsvc.conf, and put the line in it "hosts = local,bind" Or you can set an environment variable: ksh: export NSORDER=local,bind csh: setenv NSORDER "local,bind" ============================================================================== 97.050 Crashed volume group ============================================================================== We recently imported an existing volume group under SMIT with "Import volume group without data". Now the old volume group isn't accessible. We can read data with dd and it seems the old files are still present. How can we recover our old volume group and data? ------------------------------------------------------------------------------ I'm not familiar with any "Import volume group without data" option in SMIT (at least at 3.2, 4.1, or 4.2). What was the SMIT path you used (I'm trying to make sure you didn't actually use mkvg, which is bad)? What do the following commands return: # lqueryvg -Atp hdisk# (using any one disk in the volume group) # lquerypv -h /dev/hdisk# 11000 10 (using the same disk) The lquerypv command is valid only at AIX 4.1 or 4.2. For 3.2, use "hdf /dev/hdisk# 11000 10". ============================================================================== 97.051 How to determine TCP window size ============================================================================== Can someone explain to me how to determine the window size for a particular TCP session connection (under AIX). Is it as simple as viewing the output from a 'netstat' command ? Or do I have to perform an IP trace ? ------------------------------------------------------------------------------ Since this parameter is dynamic with respect to a TCP connection, netstat will not tell you anything since netstat only shows system global network parameters. You will have to resort to IP trace or tcpdump. You can make some general inferences about the window by looking at the receivers tcp_recvspace (use no -a). If the program doesn't override this default, then its socket window is bound by this buffer size. If the program does not override the tcp_recvspace, I don't know how to interrogate it externally. ============================================================================== 97.052 Configuring all 3 ports on HP JetDirect EX Plus3 ============================================================================== I'm running AIX 4.1 and I've configured the first port with IP. However, I need to configure the other 2 ports to print also. ------------------------------------------------------------------------------ There are a couple of ways of doing this. You can setup a remote queue to the EX3 using the HP boxes queues text2, raw2, text3, or raw3 to print to ports 2 and 3. The text queues add carriage returns to linefeeds, and do some minimal formatting. The raw queues assume that the host sending the job has already properly formatted the data. If you run into irregularities with printing to these boxes, such as queues intermittently and randonly going to a DOWN state, you may wish to print to them using TCPrint for AIX available from http://www.flash.net/~laixsoft instead. HP has also put out some recent firmware updates but I don't think they resolve the down queue issue. The HP EX3 print servers are fully supported under AIX 4.2.1 if you would prefer to upgrade AIX. ============================================================================== 97.053 Null name directory ============================================================================== I have Been using AIX 3.2.5 Enh 4 on a server with PCs connecting thru NFS. Everything has been OK but I have just discovered one null name directory which has the same i-node number as it's parent. I cannot delete the parent directory using rmdir (as it is not empty). I cannot delete it with rm -r as it simply recurses to the limit and then retries. I cannot mv the null name directory (no name to address it). I've read a few books and the best suggestion I have found is to use a program called clri to clear the i-node and then fix the file system with fsck. I have been unable to find any other reference to a program/command called clri. Does anyone have any knowledge of clri or can suggest a way of curing the problem? ------------------------------------------------------------------------------ In similar situations I've been successful with: find /path -inum -exec rm {} \; What you think you see is not what's really there. What you have is a directory (call it A) that contains an entry (call it B) with a zero-length name. When you try to reference B, the zero length name makes the system think you are trying to reference "/somepath/A/", which is the same as "/somepath/A". There is simply no way to tell the kernel you want B instead of A. It is trivial to create such zero-length names from an NFS client. It is messy to get rid of them. The tool to use is fsdb and the goal is to edit the data blocks of A to give B a real name. Once it has a name, you can do normal things with it. You need to unmount the file system before you can make changes via fsdb, but you can investigate on the live file system to learn exactly what you need to change. If you're squeemish about this, do a backup by inode (not by name--it will loop), then destroy and re-create the file system and reload. Come to think of it, do a backup by inode anyway, just in case. ============================================================================== 97.054 Restoring AIX backup on HP or SUN ============================================================================== I have some backup tapes written with the AIX backup command and now I would like to restore them. Unfortunately I do not have any more an AIX machine available, but only Sun and HP-UX. I have tried with the HP restore and frecover commands and with the Sun ufsrestore commands but I have not been succesfull. ------------------------------------------------------------------------------ HP restore should be able to read the AIX backup tape, since it is really dump. However, your problem is probably block size, since AIX uses a fake block size of 512. (A tape written in 512 block size is readable on AIX, but completely unreadable anywhere else. This is because it writes a block of 512 and pads it with 0's. If that is the case, you're SOL. However, it might not have been written with 512. Try this trick on HP to determine the block size. (Substitute your tape drive name for "device.") dd if=device bs=126k count=1 of=/tmp/file ls -l /tmp/file The size of /tmp/file is the block size. Let's say it was 1024. Now try this command: dd if=device bs=1024 | restore tfy - If this works, it will give you a table of contents list of your tape. If it doesn't, it was probably written with the "fake" block size of 512, which LOOKS like 1024 on other systems. dd if=device bs=1024 |restore xfy - This will restore everything on the tape to the current directory. ============================================================================== 97.055 Firmware required to boot from SSA ============================================================================== Why should one never have multiple SSA adapters in the rootvg disk loop? ------------------------------------------------------------------------------ The following restrictions apply if you want to boot off of an SSA disk drive: 6. Mirroring rootvg with SSA disks, each copy of the boot logical volume must be on a separate SSA loop. 7. An SSA loop that has a disk with the boot logical volume on it can only be attatched through a single adapter on a single machine. Points 6/7 are key. If you are mirroring rootvg, with BOTH drives being SSA drives, then you must put each drive in a separate loop (there can be other, non-boot SSA drives in these loops, however) with only one adapter attached. I have an IBM document titled Is it possible to use SSA with AIX with mirroring?, dated 03/10/97, which says that there must be no more than TWO SSA connections in the loop involving rootvg, and gives an explicit example of using two SSA adapters to connect to root vg in one loop. The information I posted came from the internal home page of the DASD and HACMP support group here at AIX Supportline, dated 5/22/97. I've also seen examples of cabling rootvg disks between multiple adapters, but just because it may work in some situations doesn't mean that it isn't supported. All the official information I can find (including the DASD/HACMP group's home page) indicates that rootvg must be on a single-adapter loop. ============================================================================== 97.056 Reorgvg failure ============================================================================== On an R40, two processors, I can no longer reorgvg since I mirrored the logical volumes in that volume group. This volume group in on an external SSA system. I am running 4.2.1 code, with 4.2.1.1 lvm. The message I get is 0516-966 reorgvg: Unable to create internal map. ------------------------------------------------------------------------------ A quick look of /usr/sbin/reorgvg indicates that this error comes as a result of the migfix command (which is taking /tmp temporary files as arguments) failing with an error code other than 5. The /tmp files are deleted when the cleanup function cal is run within reorgvg; you might try commenting out cleanup in reorgvg to see what the contents of those files are. Is /tmp full? I've seen problems where the failure to create special files (due to a full file system) can cause problems. A quick look at all the 4.2.1 LVM fixes didn't show anything obvious for this problem, so there might be some system-related problem, although I won't completely rule out a code problem. Also, make sure that there is an /etc/vg directory on the system. While AIX version 4 doesn't store internal maps in that directory anymore, it does store a 0-length file in /etc/vg for each volume group. ============================================================================== 97.057 Error log ============================================================================== I have a C10 running AIX 3.2.5, and it is doing constantly this messsages [stuff deleted] ERROR_ID TIMESTAMP T CL RESOURCE_NAME ERROR_DESCRIPTION 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run 0873CF9F 0530091397 T S tty3 ttyhog over-run ------------------------------------------------------------------------------ I get the ttyhog error when carrier is forced and the attached terminal is powered off. In SMIT, check if carrier is forced for that tty. If it is and you use 8 wire cable, turn it off. Also ensure that the alternate RJ45 option is on. ============================================================================== 97.058 AIX 3.2.5 -> 4.1.4 Migration ============================================================================== I am about to go through several 3.2.5 to 4.1.4 migrations. I have heard that this migration is not as "cut and dry" as the 4.1 -> migrations. Has anyone gone through this before? if so, can you please fill me in on some of the "gotcha's" that I should be aware of? ------------------------------------------------------------------------------ You will have to reconfigure your print queues. Other than that, there was a reconfiguration of tcpip to re-enter the hostname and the addresses... I did this migration for many servers with the CDROM AIX V4.1.4 in mode 'migration'. It worked fine but as usually it is better to do a 'smitty mksysb' before and save a few directories : /etc /var/spool Many files (/etc/rc.nfs /etc/rc.tcpip ... /var/spool/cron/crontabs/root) change and it is preferable to keep the old files to compare them to the new. Also, you must be at 3.2.5.1. Other patches you may want to load are: IX56734 - Accounting IX54318 - LV renaming U440777 - 4.1.4 SSA ptfs The numerous 3.2.5.1 upgrades I have performed worked great. Total upgrade time including a system rootvg backup was a maximum of 3 hrs. Note as above, make copies of the rc.* files, /etc/inittab, and the root crontab file. The only issues I have had are with every system utilizing SSA drives, these gave VPD errors. The fix for this was to remove the following files from the system after the upgrade: ssa.diag.obj ssa.rte.obj ssadisk.obj devices.ssa.disk.rte devices.mca.8f97.rte devices.mca.8f97.diag devices.mca.8f97.com Then, install these SSA drivers from the 4.1.4 upgrade media devices.ssa.disk.rte devices.mca.8f97.rte devices.mca.8f97.diag devices.mca.8f97.com Followed by loading these drivers from the SSA ptf media: devices.ssa.disk.rte 4.1.4.4 or later devices.mca.8f97.rte 4.1.4.1 or later devices.mca.8f97.diag 4.1.4.3 or later devices.mca.8f97.com 4.1.4.4 or later For further information, I suggest IBMs 3.2.5 - 4.1.x upgrade redbook. ============================================================================== 97.059 Maximum files in directory ============================================================================== What is the maximum number of files an AIX directory will hold? We have got tens of thousands of images that we want to put in as few folders as possible on our server. ------------------------------------------------------------------------------ There is not an absolute answer. The limit of how many files (and I mean just files, no directories) a directory can hold is a function of the size of each filename in association with the limit of the directory file itself. The directory has a limit of 2gig of storage. Each file entry in the directory takes up the space required for the name, plus 8 bytes for the inode/index references. Also, the directory block size needs to be accounted for. The reason is that a file entry can not cross a block size boundary. In AIX, this block size is 512 bytes. What that ultimately means is that if you have a file that has a name structure that would require 200 bytes, and you have 190 bytes left in the current directory structure, then another 512 bytes will have to be allocated, and the next entry will start on that 512 byte border of the newly allocated block. The 190 bytes left in the previous block will not be used. However, if you add a file later that will fit in that hole, then it should go there instead. What you are asking is fairly hard to calculate IF you will continually add and remove files, since you can't relaly predict the directory fragmentation that will occur. Further, the only way to reduce the the fragmentation much like how you would normally fully defragment a filesystem (ie, back it up, destroy it, recreate the directory, and restore it). I will say this much, you can only have 16 million files in a JFS filesystem, so to fill up a directory to the extent of that limitation would be to have 16 million files with a size of 120 characters per name. I really don't think you will run into a problem. ============================================================================== 97.060 Nohup question ============================================================================== When you start an unix command with nohup, the resulting process starts with your tty (ps -ft ), then '?' after you've logged out. How can I start a process with an already '?' in the tty column of a ps command instead of my tty (without exit or logout of course...)? ------------------------------------------------------------------------------ 'nohup' simply means that your process will not receive a SIGHUP when you logout. If you want to disassociate your process from your tty, you must fork() it and exit the parent (this has the same effect as appending the command with &), and let the child become a session leader with setsid(). For more information (from a programmer's point of view) see http://www.raleigh.ibm.com:80/cgi-bin/bookmgr/BOOKS/EZ30LO00/CCONTENTS http://www.erlenstar.demon.co.uk/usenet/daemons.txt ============================================================================== 97.061 SSA vs SCSI (EMC) ============================================================================== We are evaluating disk storage for our environment. The choices are SSA or an EMC scsi array. Any opinions? ------------------------------------------------------------------------------ I use both on SP nodes and Pyramid Niles and my 2 years of experience tells me.....SSA all the way You should be able to sustain 25-30 Mbps (burst over 35!) on each SSA loop (assuming you buy enough spindles build good sized stripe sets). EMC will give you straight scsi speeds. Sustained high enough to max a channel, but nothing faster, say 10 Mbps. The more SSA spindles you buy and stripe across, the better the throughput. Up to a certain point, of course. Then you get headaches thinking about the stripe sets. However, you have to balance the raw speed (both data transfer and access times) with the sheer reliability (but *not* simplicity) of EMC. I've got the staff to manage large striped / mirrored disk sets. You might not have that luxury. Stay away from the 'stock' SSA raid adapters, their performance is crap. Use the original 4 port adapters until the NEW 16Mb cache SSA raid adapters come out this fall. You might be able to squeeze your IBM rep to make a marketing based decision and give you free upgrades to the big-cache SSA adapters and build it into your sales contract. It's been done before. ADSM can help a lot managing volgroups that live on SSA disk. Makes backups and restores pretty easy. But whatever you do, keep an eagle eye out for EMC 'sales practices'; they will bypass your front line tech and managerial staff and start to wine and dine senior management. Then all could well be lost for a rational decision. EMC is *very* good that that game, far better than IBM ever was. You might want to get in touch with Champion Computer down your way, they should be able to offer a better price than the local IBM 'official' rep can. We're buying SSA delivered with drawers and racks and cables for about $0.70 per meg. 1 year warranty and follow-on IBM maintenance is pretty cheap. EMC is giving us Symmtrix 3000 prices in the area of $1.25 per meg, but they are throwing in a third year of maintenance (on top of the two year warranty). But that's when we order full arrays. If you order partial arrays, you have to amortize the raw cost of an empty S-3000 frame (about $300k) into the real cost of those old Seagate drive EMC still uses. EMC will play the math games for you. Don't let them tell you any story about the price per meg based on 'raw disk'. Do your own math and figure the costs based on REAL DELIVERED AND USABLE DISK. EMC is also (very quietly!) demoing E-3000 arrays with SSA adapters. These are covered by some less than airtight NDAs (not mine, thank Ghu!) but it appears than an EMC-SSA array is about 25% better than scsi based EMC, and still not as good as pure IBM ssa even with the massive 4 Gb (!) sram cache the E-3000 box can deliver. Getting real performance numbers is tough; IBM publishes some very impressive numbers. Both Sybase & Oracle have recently come out endorsing SSA as a good way to maximize both OLAP and OLTP performance. EMC will NOT cooperate with any kind of benchmark where they do not control *all* variables. Including OS config, file system layout, and data set sizing. That makes me very suspicious about any performance numbers EMC offers up and equally suspicious about 'reference customers'. If EMC is so durn good, why not just drop a big array on the floor at UnixWorld or UniForum and let the show run public benchmarks? IBM did that with SSA two years ago. Of course, EMC will try to claim that FC-AL is 'just around the corner'. Don't buy that story either. And don't volunteer to be a beta site. If it can't be deliverd it out of stock, then tell them you don't want to hear it (both EMC & IBM). I think that's about all, I wonder how long I will go this week before I get an indignant call from EMC...... Having said all that, if what you want is scsi disk, with 6 or 7 sigma reliability, then EMC is the way to go. On the other paw, if you need performance 3-4 times better than scsi (and reliability to 4 or 5 sigma, depending on *your* storage management disciplines), SSA is the way to go. I'm not even going to go into the issues of storage density and how much disk you can successfully hang on an SSA adapter vs EMC disk on an enhanced SCSI adapter. Or why EMC may not be a good choice in an SP thin node environment because of the card slot shortage problem. ============================================================================== 97.062 FTP command line arguments ============================================================================== Does anyone know of a commercial or other ftp client that is scriptable or if the AIX shipped ftp client accepts command line arguments for userid, password, files to download. I need to automate the download process. ------------------------------------------------------------------------------ Use a "here document" in a shell script: ftp -n $hostname << THE_END user $login $passwd cd $fromdir lcd $todir bin # or ascii, or $bin_or_ascii get $fromfile $tofile ... THE_END ------------------------------------------------------------------------------ AIX ftp supports non-interactive dowloading as do most ftps. The magic part is based on creating a .netrc file in your home directory, this .netrc must contain lines like: machine ftp.microprose.com login ftp password mickey@cetia.fr YOu can have several groups of lines each group starting with the 'machine' directive. The .netrc MUST NOT be readable by others or ftp will not use it (this is to make sure you don't give away your password:) My .netrc has -rw------- permissions. Once this file exists then shell redirection with ftp will work, for example: ftp ftp.microprose.com <<+ cd /pub/xxx get yyy quit + will make a connection to ftp.microprose.com using the login and password given in the .netrc file and will then perform the commands from the 'here' script (or you can put the commands in a file, such as ftp.cmds and do: ftp ftp.microprose.com < ftp.cmds You CANNOT use the user and passwd commands inside the file, you MUST create a .netrc file. ------------------------------------------------------------------------------ Use "wget" from GNU for any "automated ftp" tasks. It is an extremely powerful tool, but is still simple to use. It works through HTTP and SOCKS proxies. For AIX4, a smit-installable, pre-compiled package for wget is available on http//www-frec.bull.com/ (click on the big "Download" the middle of the screen). There is also a mirror in Germany at http://www.bull.de/pub/ (don't forget the trailing '/'). There are also several other FTP clients for X11 and ascii on the server. (xdir-2.0.0.0, xftp-2.1.0.0, ncftp-2.4.2.0). ============================================================================== 97.063 AIX to IBM Mainframe file transfer ============================================================================== Is there any way that I can transfer a file from AIX 4.2 to an IBM Mainframe using "IND$FILE"? FTP is not running on our Mainframe and is not an option at the moment. Presently if we need to move a file we first FTP it down to a PC and then use a 3270 emulator software to transfer the file to the Mainframe using "IND$FILE". Is there any way to do this in AIX, or do I need a third party product? ------------------------------------------------------------------------------ You don't necessarily need to use IND$FILE -- you could just use Kermit, which is available for both AIX: http://www.columbia.edu/kermit/ck60.html and the mainframe: http://www.columbia.edu/kermit/ibm370.html This will work over a serial connection (e.g. into a 3705 linemode port, or a VT100 or similar port on a 3270 protocol converter such as the 7171 or a Cisco terminal server). It also works on various kinds of TCP/IP connections (which you don't have). Kermit works very well, if you're allowed to install software on the mainframe. If you have to use IND$FILE, IBM's HCON product supports it over co-ax terminal connections, SNA connections, or TCP/IP (which you don't have). I use ftp to move files to/from my own mainframe, but HCON to upload and download files to the IBMlink system, since IBM doesn't allow me to install Kermit or TCP/IP on their systems. ============================================================================== 97.064 mpcfg and system tests ============================================================================== I was told by a customer with a couple of J40's running HACMP that they have the option of running or ignoring system hardware tests during boot. Anyone know if these are only "system" tests or do they also include any adapter diagnostics? ------------------------------------------------------------------------------ The command in question is "mpcfg -c -f 11 1" and it only disactivates the firmware tests. Any tests run under AIX are not affected. For your info, the two new machines from Bull, the Escala T and the Escala E allow you more control over the firmware tests - for example if you hit reset before turning the key to power-on, the're skipped. Also the various CPU tests run asychronously so a 4-cpu boot only takes marginally longer than a 1-cpu boot. http://www-frec.bull.com/ for the specs.... ============================================================================== 97.065 Redirecting output to a file ============================================================================== I have written a script for disaster recovery in case our RS/6000's are failing. It gathers a lot of information about the system and prints that to standard out. The thing I want to do is declare a variable which looks like "filename" to which I can redirect output to *in* the script so I don't have to put >$filename after every line. I'm working in ksh and AIX 4.1.4.0. I know I can do someting like this: sysinfo > filename, but I'm using getopts and would like to be consistent. ------------------------------------------------------------------------------ Try doing something like this: at the top of your script reconnect stdout/stderr to the required output file(s), for example: #!/bin/ksh # # A simple test script OPFILE=/tmp/script.out ERRFILE=/tmp/script.err exec 1>$OPFILE exec 2>$ERRFILE # Now run the rest of the script ... #End of script Obviously you can build in stuff to set the variables from the command line. Basically, exec used like this changes the handle associated with stdout (1) & stderr (2), which gives the effect you're looking for. Incidentally, you can use the same mechanism to create additional output channels, e.g. 'exec 4>/tmp/file' then allows you to redirect like this, 'echo "Hello" >&4'; this can be useful sometimes... ============================================================================== 97.066 Accessing a RAID-System from 2 RS/6000s ============================================================================== Does anybody know if it is possible to access a SCSI-RAID System from 2 RS/6000s simultaneously? Do I need HACMP,special SCSI controllers or SCSI cables? ------------------------------------------------------------------------------ There are vaious RAID arrays that can support multiple systems. One that comes to mind is the Clariion array that can support up to 4 hosts. You should be able to find info on this at www.clariion.com or www.dg.com. Note that the LVM is only designed to allow access to a volume group from one system at a time, unless HACMP is running. You can easily attach a RAID box (IBM, Clarion, etc.) to multiple machines, but unless you get HACMP or another product that allows concurrent access, the LVM restricts access to one machine at a time. ============================================================================== 97.067 Disk striping, controllers & performance ============================================================================== Can anyone tell me whether there is any performance benefit to be had when striping an Oracle database over three disks, all on the same controller? Also, is there an optimum stripe size (under AIX 4.2) for a database application like Oracle? When setting up the striping we were queried by smit for a stripe size and didn't know if we should change the default value. Is there a rule of thumb? ------------------------------------------------------------------------------ There is certainly a performance benefit if you are using large sequential reads. Obviously, using different controllers might give you a bit better performance. The optimum stripe size depends a bit on the application. I have seen some consensus of opinion indicating that 64K is a good default, but Oracle might have another specific recommendation. ============================================================================== 97.068 Phantom logical volume ============================================================================== We have run into a situation where someone attempted to rename logical volume lv02 and now the LV is in a questionable state. He is not sure exactly what he did, but now the lsvg command shows the LV having a TYPE of "???" and the ODM seems to know nothing about this LV. Since there was no data in it yet, we tried to remove it using the rmlv command but it complains that it isn't in the device configuration database. I checked all the Cu* ODM classes and indeed there does not seem to be any reference anywhere to "lv02". In trying to help him out, my first thought was that maybe we could dissect the rmlv script and manually enter the underlying LVM commands, avoiding the parts that interface with the ODM, but the more I think about it the less I like the idea of doing this on a production system. Since I really don't know how he got to the point he's at, I wouldn't feel comfortable that I had ceaned everything up adequately. I also considered trying to manually add the appropriate stanzas back into the ODM, or at least enough to coax the rmlv command to work, but the pucker factor on that one seemed about as high as for the previous idea. Another possibility I considered was running mkszfile, editing out any "lv02" references in the image.data file and then backing up and restoring using mksysb. This seems promising but I'm not sure he will want to take the system down for the length of time that would require. ------------------------------------------------------------------------------ "lsvg -l VGname" gets its list of LVs from the VGDA. The only field in this output coming from the ODM is the Type field (??? indicates that it isn't found in the ODM, as you have discovered). If you run "synclvodm -v VGname LVname", this should resolve the problem and then you can remove that LV, or do whatever you want to it. ============================================================================== 97.069 Mounting CD-ROMs from non-root users ============================================================================== Does anyone have a script or procedure to allow non-root users to mount a CD-ROM? I don't want to have to mount everyone's CDs so they can access the data. They should be able to mount the CD themselves using either a program or script. ------------------------------------------------------------------------------ Write a C wrapper, or use sudo. Here's an example: #include main () { int rc; setuid(0); setgid(0); rc=system("domyscript arg1 arg2"); return (rc); } Then compile the program chmod +x chmod ug+s ============================================================================== 97.070 Maximunm rootvg size ============================================================================== I currently have 6 GBs on our C10 running 3.2.5 but I'm looking to add more external storage (hard disks). The 6 GBs that I have are all on rootvg. Is there a limit on how large rootvg can be? And, what are my options in external storage? ------------------------------------------------------------------------------ The limit of the number of drives you can have in a volume group is 32, but for rootvg (especially at AIX 3.2.5) this may be different. There is a -d flag on mkvg that is used when creating rootvg; at AIX 3.2 the -d flag contains the number of disks on which you installed rootvg. That number is multiplied by 1016 to determine the total amount of PPs that rootvg can EVER have (without restoring a mksysb to a larger number of disks). I.e., if you installed to one disk, you can only have 1016 PPs in rootvg. This can cause a problem if the one disk is using 537 partitions (say a 2.2GB drive) and you try to add a similar disk to rootvg; you'll get an error saying that you've run out of descriptor area space. The only solution is to restore a mksysb on both drives. The algorithm changes at 4.1 and 4.2 to give you more default rootvg space. ============================================================================== 97.071 Auto logout ============================================================================== I am looking for a good program or script to log out users that have been on for too long. I am running AIX 4.1.4. I have the TMOUT set, and it only logs out people that are at a prompt. It has no effect on the people that have our software application running. I would also like an application that I could use to knock users out manualy through an X11 graphic interface. ------------------------------------------------------------------------------ If you are not using CDE, that is you start your X-Session with xinit / startx, then you can use "xss" to log the screen or to logout the user after a given amount of time. Example: xss -timeout 600 -e xlock (screen lock after 600 seconds inactivity) xss -timeout 600 -e kill -9 $(ps -fu username|grep mwm|awk ...) (logout after 600 seconds of inactivity, you have to get the PID of the mwm process) ============================================================================== 97.072 CDE and font problems ============================================================================== I am running AIX 4.2.1 on RS/6000 workstation Model 7012 with 64 MB RAM and CDE installed. Whenever I run dtterm or any other X-windows application like Xemacs, the terminal keeps reporting problems as follows: $ xemacs & Warning: Cannot convert string "-dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-*-*" to type FontSet Warning: Unable to load any usable fontset Warning: Cannot convert string "-dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-*-*" to type FontList Warning: Cannot convert string "-dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-*-*:" to type FontList Although the program itself works fine, the repeated error messages are very annoying. I read through the CDE Readme files which indicated that if the font alias file doesn't define these fonts I will get these errors etc. But I checked all that yet this problem has me flummoxed. I am doing this through a PC based X-server (Exceed) which adds its own font directories to the font path. ------------------------------------------------------------------------------ the problem is that Exceed doesn't find the right fonts on the PC disk. You can use the AIX fontserver to easily fix the problem: 1. Start the fontserver on AIX with the commands: # fsconf # startsrc -s fs 2. Add the fontserver to Exceeds "font path" in the setup windows: Font Settings -> Font Database -> Add... then activate the "Server" Button enter the hostname and port number 7500 (not 7000 on AIX!) save with "OK" and rebuild the database ============================================================================== 97.073 APAR info files ============================================================================== I was looking through an info file about an particular APAR/PTF, and at the bottom, had the following lines: COREQ FOR U435231 = NONE SUP FOR U435231 = big_ol_list_of_PTFs IFREQ FOR U435231 = big_ol_list_of_PTFs What do COREQ, SUP and IFREQ mean? ------------------------------------------------------------------------------ A COREQ is a corequisite -- a fix that's needed for the one you're looking at, and one that needs the one you're looking at. In other words, if you were looking at, say, U435000 and it COREQ'd U435001, then U435001 would COREQ U435000 and you couldn't install either without the other. SUP possibly means "supercedes", indicating that whatever is in the list is no longer necessary once you install this fix. An IFREQ is an "if installed, this level is required" requisite. Each PTF in the IFREQ list refers to one or more optional LPPs. If you have one of those LPPs installed, you need the associated IFREQ'd PTFs in order to install U435231. Let's say, for example, that U435001 appears in the IFREQ list for U435000. U435001 is actually a fix for foo.obj, an optional LPP that installs the /dev/foo device driver on systems with the IBM XPQJ 3 1/2 port Obscure Protocol Adapter. If you have foo.obj installed on your system, you need U435001 already installed, or available for installation, when installing U435000. This stuff is actually documented, more or less, in InfoExplorer. Actually, the documentation has gotten better since AIX 3.1. You can search for "COREQ" or start with the "ckprereq" command. In at least the 3.2.5 Info docs (and probably in 4.x as well) there is a chapter in General Programming Concepts called "Software Product Installation Package Process for Programmers". ============================================================================== 97.074 Problem with HP Jetdirect ============================================================================== I have a problem sending files from a rs600 /350 O.S 4.1.4 to a hp laserjet 4MV. The printer is connected to a jetdirect card. The communication between the rs6000 and the printer is good. It works very well when I send ascii-postscript files to the printer. However, it doesn't work when I send binary-postscript files to the same printer. I have tried it in differnt ways, first with the lpd-Spooling system. The /etc/qconfig looks like lmv: device = @laserJet4MV up = TRUE host = laserJet4MV.tfh-berlin.de s_statfilter = /usr/lib/lpd/bsdshort l_statfilter = /usr/lib/lpd/bsdlong rq = raw @laserJet4MV: backend = /usr/lib/lpd/rembak Then I tried it with the remback program directly, for example, /usr/lib/lpd/rembak -S laserJet4MV -P raw -N /usr/lib/lpd/bsdshort There are no reported errors, but the printing is incomplete. I've used all "-N " parameters in /usr/lib/lpd with no success. Another strange thing is that when I use the same file and send it to an Apple Color Laserwriter everything works fine. Both (binary and ascii) files leads to good results. Is the problem on the Jetdirect card? ------------------------------------------------------------------------------ Instead of using rembak, try using the HP JetDirect software. As you have tried rembak from the command-line, perhaps trying this from the command-line may help: /usr/lib/lpd/pio/etc/piohpnpf -x HOSTNAME < yourfile.ps Setting up the print queue using JetDirect attachment option and adding an HP LaserJet IV PostScript virtual printer may help. ============================================================================== 97.075 Accessing data after cplv ============================================================================== After doing a raw logical volume copy from one vg to another, a new logical volume was created. I assume that cplv copied all the data from the source LV to the target one. My question is: how to make it a filesystem, i.e., how to access the data on it? ------------------------------------------------------------------------------ Never create a filesystem using this LV if it was not already created. Creating a file system on the LV after you have used cplv will destroy everything you just copied; crfs calls mkfs to reformat the LV. You have to manually change /etc/filesystems and then run "chfs /mntpt", or use the -a flags on chfs to change /etc/filesystems. ============================================================================== 97.076 Physical disk replacement in the rootvg VG ============================================================================== I need to replace one disk of the rootvg volume group because of permanent errors. However it has an hd5x (boot logical volume extent?) and I'm not sure if it's qualified to be an hd5 boot logical volume or not? Following the 'Migrating the contents of a physical volume' of System Management Guide: Operating Systsem and Devices procedures, it states that special care must be taken regarding the hd5 logical volume, it however does not mention the hd5x. Can I ignore the hd5x LV on the disk and migrate it as a regular LV or it must be treated as an hd5 LV? ------------------------------------------------------------------------------ You'll have to migrate the LV and then use the bosboot command to update the bootlist. It looks to me like someone set up mirroring of the rootvg (hence the hd5x) using the AIX 3.2 (*unsupported*) instructions. If you're running AIX Version 4, get the mirroring instructions from 1-800-IBM-4FAX. If you're running version 3 still, there were instructions floating around (ask your marketing rep or check the Oasis/Pitstop home pages). ------------------------------------------------------------------------------ hd5, hd5x, or any other boot logical volume would only be needed at boot time, so if you can't migrate it just remove it and recreate it. The old 3.2 mirroring instructions were pulled from general circulation so I would doubt that any IBM web site would contain them. However, the AIX 3.2 System Management Guide would have up-to-date instructions. Most IBM support documents can be seen outside IBM from http://isscfax.sanjose.ibm.com. ============================================================================== 97.077 Symlinking /tmp, /usr/tmp and /var/tmp to one fs ============================================================================== I want all temporary files to go in one big filesystem instead of having to maintain the 2 separate ones in the default AIX setup. Is this a sound idea or not recommended? If not, why? Is there a better way to consolidate them than symlinks? ------------------------------------------------------------------------------ A lot of applications are written to use a particular directory (/tmp or /var/tmp). Some applications are smart enough to allow you to set a TMPDIR environment variable (I think it's TMPDIR; I don't remember) but if it's coded to use /tmp, you can't get around it. Symbolic links are the easiest way to go. ============================================================================== 97.078 Recovering Volume Group when PVID on Physical Disk is lost ============================================================================== We lost an I/O planar in one of our 7013-59H models. The C/E replaced the I/O planar and the machine was brought back online. The only problem was we lost one of our VG. This particular VG was created on the attached 7137 and contained a massive amount of data. What we see now is that the drive is available (7137 is defined as one large physical drive hdisk3 in this case ), but lspv shows no PVID for the drive thus we cannot vary on the volume group defined to the drive. I maintain on another machine a report of the machines configurations and I know the PVID of the volume group prior to losing it. We also have a MKSYSB from the morning prior to the crash. Is there any way to recover the volume group either by editing the ODM to restore the parameters (I am not sure what information would be required, I mainly only have the outputs of lsvg, lsvg -l, lspv, and a few other commands; but no lvids or anything like that); or is it possible to recover the correct ODM from the MKSYSB? I am sure in a worse case I could recover files off the MKSYSB for other pertinent information required for editing the ODM also... ------------------------------------------------------------------------------ "lspv" gets its information strictly from the ODM. If the ODM were the problem you could easily put this back. However, you need to first establish if that is the problem. Run "/usr/sbin/hdf /dev/hdisk# 80 10" to read the PVID. If this doesn't come back, or doesn't show the correct PVID, then there is either a hardware problem or corruption of the data on the drive. You are AIX 3.2.5, so hdf should be used to read the PVID. If at AIX 4.x, use "lquerypv -h /dev/hdisk# 80 10". If the PVID is messed up (i.e., you get data back but not the correct PVID), try running "lqueryvg -Atp hdisk#" to see what comes back. It may be possible to recover this data under these circumstances. ============================================================================== 97.079 Annoying mail/editor problem ============================================================================== I occasionally receive mail messages that have lines terminated with"=20". I have always been a little annoyed by them, but have recently begun using the CDE mail application on my AIX 4.1 system and find to my embarrassment that some (not all!?!) of my outgoing messages have the same problem! Messages sent not using the CDE application (command line "mail" and vi editor) do NOT contain these characters, which leads me to believe the problem is either in the CDE mail application or the associated editor, but I cannot determine where the problem is originating. The =20 characters don't show up all the time. They appear to be more frequent when I am replying to mail messages and including parts of the original message. ------------------------------------------------------------------------------ The mail in CDE (as many mail applications now) use the MIME (Multipurpose Internet Mail Extension) format to send messages. This intends to send messages across Internet without the loss of local idio-syncrasies (like eaccute in french). In your case, =20 means space, and should be transcripted in a real space (i.e. ' ' ) by your mail-reader, whatever language or font you use (even in kanji). So, use a MIME-compatible reader, of configure you mail-reader to be so. ============================================================================== 97.080 Netmasks in AIX ============================================================================== I need to know where the file(s) is(are) that associate subnet masks with network numbers at boot time. This is analagous to /etc/inet/netmasks in solaris 4.x. I made a grotesque kludge fix by putting an "ifconfig en0 netmask x.x.x.x" in the .login. ------------------------------------------------------------------------------ Take a look at /etc/rc.net or /etc/rc.bsdnet. And that's maybe AIX 3.1 ============================================================================== 97.081 Name resolution order ============================================================================== Is it possible under AIX 4.1 to configure the internet name resolution to use the /etc/hosts file first and then the nameservers listed in resolv.conf? My AIX box is on a non-routing network (192.168.0.x) that has internet access via a ppp link on a firewall. Most of the time the network and external nameservers are not available. If the resolv.conf file is present the system experiences intolerable delays in resolving node names already entered into /etc/hosts. If I remove the resolv.conf file I get quick response, via /etc/hosts, but can not get any external name resolution. For example if I traceroute to a known exteranl site I only get a list of IP addresses. I can not acces any site not listed in my local /etc/hosts. On most systems one can direct the resolver to use the /etc/hosts file first and then the nameserver only if the name is not in /etc/hosts. How do I configure AIX 4.1.4 to do this? It would be difficult to create the resolve.conf file when the ppp link is up and then remove it. Besides it would create unnecessary network traffic to a nameserver to resolve lots of local names, which are not listed with a nameserver since it is a non-routing network. ------------------------------------------------------------------------------ This can be done on a system-wide basis. vi the /etc/netsvc.conf file to specify the order of resolution. The default is DNS, NIS, /etc/hosts. You can also do this on a per-user basis via the NSORDER environment variable. /etc/netsvc.conf: hosts=local,bind The system looks in /etc/hosts and then if the name cannot be resolved, DNS is consulted. ============================================================================== 97.082 Need to know which PTF/APAR to get ============================================================================== We have 3 RS/6000's running AIX 3.2.5 and I noticed on one box (250) our 'cu' command is at a newer version than on our other two boxes (590 and 59h). How would I know which PTF or APAR to get to update cu? ------------------------------------------------------------------------------ The easy way to find what LPP a given command (or other file) is in is lslpp -c -f all | grep -w cu (The -f option to lslpp is "list files", and -c is "column format", without which you'd just get the file name -- the LPP name would be on a different line.) That tells us that cu is part of bosext1.uucp.obj, which makes sense. However, I don't know of an easy way to find out all the PTFs that apply to a given LPP, though it shouldn't be tough to extract that info from the database downloaded by FixDist. It's probably easier, though, to use lslpp on one of the machines with the fix to list all fixes for bosext1.uucp.obj, and then compare that with the machine that doesn't have the fix: lslpp -L bosext1.uucp.obj You should also be able to take the fix IDs you get from that and do an lslpp -f on them, but this doesn't seem to work. Apparently inventory information isn't saved for fixes. You can do lslpp -A -B fix-id to get lots of output about which problems a fix addresses. ------------------------------------------------------------------------------ You can update the whole thing with U493251 (to get to AIX 3.2.5.1) and U495102 (to get all fixes since 3.2.5.1). ============================================================================== 97.083 Mklvcopy problem on 4.2 ============================================================================== I have a problem re-establishing a mirror under AIX 4.2. I am running base os 4.2.0.0, Oracle 7.3.2, HACMP 4.2, bos.rte.lvm 4.2.1.0 on two G40s with mirrored 9133 Model 600 SSA subsystems. Initially, I had the mirroring active, but when the db admin guys went to manipulate tablespaces, the box hung with no error message. When I broke the mirrors (using the rmlvcopy command), their programs worked without a hitch. After the db guys were finished their tasks and had the database up and in production, I set up a script to re-establish the mirrors (using the mklvcopy command, w/synch set to yes) at 3:15 am. At 4 am the database stopped accepting writes, but was still allowing a few selective reads, but no direct connects to the database. I killed the mirror job, rebooted the box and it has worked fine since then. My problem is, I now need to re-establish the mirrors without freezing Oracle. I also cannot afford to shut Oracle down for the approximately four hours it will take to mirror 18 GB of data. I have spoken to IBM Support and they told me to down Oracle and try it. I am in desperate need of alternatives. I have heard there is a bos.rte.lvm.4.2.1.4 out there that hasn't been released yet and was wondering if that would help. ------------------------------------------------------------------------------ This is probably IX68631 (you are using mirrored drives at 4.2.1 of the LVM). You can find the fix at ftp://testcase.boulder.ibm.com/aix/fromibm/ix68631.efix.tar.Z You need to install this before any other analysis is performed. ============================================================================== 97.084 MVS to Unix FTP problem ============================================================================== We're transferring a file from a MVS mainframe system using ftp. The file format on MVS is that it is a fixed record length file with each record being 225 characters in length. Padding of the records is achieved using spaces (Hex 40). Once the file is transferred to Unix, the fixed length record format is lost. Any space padding at the end of records is lost and I end up with a variable record length file. Unfortunately, the COBOL program which then reads this file expects the record length to be 225 characters. Does anybody have any clues as to why the padding is being lost? Also does anyone have any suggestions on the best way to write a shell script which will pad fill each record up to 225 characters with spaces? ------------------------------------------------------------------------------ We don't run FTPD on our MVS system for security reasons, so I'm just guessing, but... TCP is a stream transport mechanism that has no concept of record structure (unlike various SNA components). Consequently, applications built on TCP generally treat files as unstructured data. That includes FTP -- usually. Moreover, Unix itself does not have any concept of file structure at the OS level. A file of fixed-length records on Unix is just a file that has a certain regularity in the arrangement of its data. As far as Unix is concerned, that's entirely an application issue (leaving aside the issue of sparse files). However, FTP does have some extensions for dealing with non-Unix operating systems. Some of them, like the "record" subcommand, may be useful to you, but the documentation (as of AIX 3.2.5) is so poor I really don't know. You might want to check the latest FTP RFC, whatever that is. There's a nice HTML interface to the RFCs at http://www.cis.ohio-state.edu/hypertext/information/rfc.html The problem is that a shell script won't know where the record boundaries are, unless they're marked some way (e.g. by a special character). Also, if the files are still EBCDIC on Unix (it wasn't clear from your description if you were translating them to ASCII), then however the records are delimited, it presumably won't be with an ASCII newline. Unix text processing utilities and shell built-ins generally like their data line-oriented. If the files aren't lines of ASCII text, you might be better off writing your own program. Actually, that wouldn't be that hard in Cobol (though easier in C). I stay away from Cobol when I can, but this kind of file I/O is pretty much what it was designed for. Define the input file as a non-indexed sequential file having records of just "PIC X", the output as having "PIC X(225)", move spaces (EBCDIC spaces, if necessary) to a working-storage output record, and then read (1-byte) records from input and copy them to output plus a range adjustment until you hit the delimiter on input. Write the output and start again. ------------------------------------------------------------------------------ There are two basic problems to transferring files from MVS COBOL to AIX COBOL via ftp: 1. The record length truncates during transfer (your problem) 2. Packed data will not survive the EBCDIC to ASCII conversion that ftp will do to the data What my team has done in the past in to solve both these problems is to write a COBOL program on each platform. First, on the MVS box, write a program that will create a flat, sequential file with no packed data. i.e. "SIGN TRAILING SEPARATELY" for signed fields, etc. When you write this file, place a non-blank character at the end of the record. For instance, if your record is 255 bytes long, in position 256 place the letter "P" or similar. This will force ftp to send the entire 256 bytes in order to preserve the position of the last character, even if the first 255 characters are null or spaces. Then on the RS/6000 AIX side, write another COBOL program to read the flat file, (now converted to ASCII by ftp), write the indexed file you need, and ignore the last character that was used as a placeholder. OR, if you're not running COBOL on AIX, you can manipulate the data with the standard AIX tools: grep, awk, sed, cut, etc., or whatever. ============================================================================== 97.085 Monitoring incoming telnet / ftp requests ============================================================================== Is there any utility that will show the IP address of incoming users requesting FTP or Telnet sessions to my server? (J40/AIX4.2) ------------------------------------------------------------------------------ Try TCP Wrappers by Wietse Venema, available from ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz It allows you to control which hosts have access to TCP services (ftp, telnet, rlogin, etc.) and logs all successful and unsuccessful connections. ============================================================================== 97.086 POP3 server for AIX ============================================================================== How do I configure the POP3 server which comes with AIX 4.2.1? ------------------------------------------------------------------------------ There is no configuration file. Simply uncomment the pop3d line in /etc/inetd.conf and then restart inetd (refresh -s inetd) to reread the file. It is just that simple. In addition there is an entry for IMAPD also, so don't forget to turn that on as well, if you need IMAP support. ============================================================================== 97.087 Bos.adt.include ============================================================================== While attempting to install gcc I got the following message from smit. Missing bos.adt.includ 4.1.0.9 # Base Level Fileset Can anyone point me to where I can find this? I've searched www-frec.bull.com and am still searching the web for it. ------------------------------------------------------------------------------ The GCC package requires that the system include files be installed before installing GCC. These include files are delivered by IBM on the AIX CDROM in a fileset called "bos.adt.include". They are only available on the AIX CDROM and cannot be downloaded anywhare else. If you haven't installed the include files, then there are probably a fair few "development" things that aren't installed either. There is an "App-Dev" (application development) bundle that can either be "easy_installed" (installs everything in the bundle) or selectively installed (you get to choose).' Basically insert your AIX CDROM and run either the command "smit easy_install_bundle" or "custom_install_bundles" and choose "App-Dev" when the list of bundles is displayed. ============================================================================== 97.088 TCP/IP MTU ============================================================================== We recently had to double the MTU size on the token ring on one of our systems. I'm wondering if I should also increase any other parameters? I've more than doubled the size of the MBUFs pool, but I'm wondering about the "no" parameters like tcp_sendspace and tcp_receivespace. I didn't have much choice about the MTU size. My MTU size was smaller than the "typical" message size, which was causing all sorts of performance problems. ------------------------------------------------------------------------------ The AIX Networking Performance Guide has tips on how/when to mess with IP parameters (via the 'no' command) as well as hardware settings (accessed via lsattr -El tok0). But be careful. 'Guessing' at parameter changes can all too easily cause your system to drop off the network. In extreme cases, you can hose up a system to the point where a serial console on tty0 would be unable to communicate. Then you'll be in a fine kettle of fish. ============================================================================== 97.089 Restoring ODM ============================================================================== If my Customized Database is corrupted, what is the procedure to restore from the tape (if I have a system backup) or can I fix it by using commands only? How about if my Predefined Database is corrupted, can I fix it ? ------------------------------------------------------------------------------ You can boot in maintenance mode and choose the option to start a shell before mounting filesystems. At this point, the RAM filesystem will contain a freshly created set of ODM databases which you can then copy to a diskette (sometimes I just put a copy of 'backbyname' on a diskette and do a 'restbyname' of the backbyname program into the RAM filesystem and then use backbyname to backup the Cu* or Pd* files to a diskette). Then after you exit the subshell, the real filesystems are mounted. At this point, you can just restore the new databases from diskette into /etc/objrepos to overwrite the corrupted ones. You'd lose any special customization that you might have done in SMIT, but at least your system is back up and running. ============================================================================== 97.090 Samba printing on AIX ============================================================================== I have a problem with Samba printing. I can send a file from a WIN95 PC to AIX for printing. After printing of the last page, there is always another page with unusual characters. ------------------------------------------------------------------------------ See if the AIX virtual printer cr attribute contains the "garbage" you are seeing after the job. If so, set _J=! via lsvirprt. ============================================================================== 97.091 Trouble with fixdist sites ============================================================================== I'm trying to download some preventive maintenance packages from the fixdist sites, and it seems that every site I connect to drops my connection anywhere from 2MB to 20MB downloaded. How can I stay connected to these sites to download these packages? ------------------------------------------------------------------------------ I've never used fixdist, but you might want to check out Bull's PTF server at http://www-opensup.bull.com/. There is a cute facility to find the latest PTFs for a given fileset: Click on "Consult", then fill in the filest name in the field displayed (the wildcard character is "%", bizarrely enough). ============================================================================== 97.092 Utmp file accounting ============================================================================== I am trying to write a C program to trim down the failedlogin file on our system, which has grown rather large. In utmp.h there are functions that let you extract lines and search through files in utmp format, such as getutent(), etc...but there is no function to remove an entry. Does anybody know a good way to delete entries from a utmp file? Also, does anybody know of a utility that already exists that might do this? My program will trim a utmp-type file by date given on the command line, and give statistics about the file, and it already works except for being able to delete entries. ------------------------------------------------------------------------------ There is a couple things you can do here. 1. /usr/sbin/acct/fwtmp < /etc/utmp > /tmp/utmp.tmp Edit the /tmp/utmp.tmp file manually, removing what you want /usr/sbin/acct/fwtmp -ic < /tmp/utmp.tmp > /etc/utmp 2. There's a program called tidysys out there, can't remember where I got it from, but it cleans up the accounting files like utmp and such. It's a pretty good program. The above is for 3.2.5, not sure about 4.x ============================================================================== 97.093 Sendmail question ============================================================================== How do you strip off the host name from the FROM and TO fields in mail headers. They look like user@mail.domain.com when they should look like user@domain.com. ------------------------------------------------------------------------------ AIX 4.2 has this feature built in to the /etc/sendmail.cf file - it is called MASQUERADING. I wanted to do this exact same thing on my work system running AIX 4.1.5 (it should work for AIX 4.1.4 too) and came up with the following: Find the S4 rule and alter the line: #R$*<@LOCAL.D>$* $:$1<@$w$?D.$D$.>$2 R$*<@LOCAL.D>$* $:$1<@$D$.>$2 I'm not saying that this is the perfect solution, just that it works. If anyone has a more elegant solution I'd be glad to hear of it. Alternatively, you could try replacing sendmail with the latest version from the Internet (http://www.sendmail.org/). I tried doing just that before I worked out the above change to sendmail.cf. However, at my site I have to use UUCP pathing too (we connect to some client sites directly), and I couldn't get UUCP (ie. hostname!username) and Domain (ie. username@hostname) naming working correctly using sendmail 8.8.5. ============================================================================== 97.094 Cabling ============================================================================== I am in charge of a RISC6000 running AIX Version 3...I know little about Unix, much less AIX, but am learning bits and pieces and looking into classes. Our software support company provided the company with the system, therefore they also handle the hardware support. They recently sent us a letter referring to the IBM notice of cancellation of support of AIX versions prior to version 4. In their letter, they say 'line noise on async devices provide a more verbose output. If you are using older three wire telephone line cable for your devices, you will probably be inundated with hundreds of error messages to your error logs. Generally wiring that is below standard or not shielded, will cause your system to panic.' Is there truth to this statement? We have 44 lines which are below Cat 5 standard, and we are thinking of rewiring these cables. This will cost a chunk of money, therefore we are double checking on the recommendations. ------------------------------------------------------------------------------ Cat 5 cable has absolutely nothing to do with asynch cabling. The category 5 specification is for the balanced transmission caracteristics of bulk cable, i.e. 10 Base-T Ethernet. With balanced transmission, line noise is canceled using differential amplifiers. Asynchronous or RS-232 communications are unbalanced transmission lines and therefore will pick up electrical noise if the bulk cable is not shielded. If the cable length is short, 50 feet or less, you should not have a problem. Between 50 and 200 feet problems will be experienced if the cables are run near florescent lighting fixtures. Over 200 feet you are on your own, even if the bulk cable is shielded. Most of the ports that have electrical noise will cause getty to respawn too rapidly and will be a pain too use due to transmission errors. Never have heard of a system panic but in extreme cases it is possible. ------------------------------------------------------------------------------ With 3-wire connections, you have to rely on software (xon/xoff) flow control. This is problematic at speeds above 9600 (depending on the UART). You really should use "full" 5-pair (or at least 4-pair) cabling and take advantage of hardware (rts/cts) flow control. IBM uses the RS232-D spec for async cabling. Above 200 feet is your problem and, technically, everything has to be shielded (foil or braided shield). Excessive errors will cause performance problems. At least with AIX V4, if "too much noise" is detected on a line, AIX will disable that port (and log an error in the error log). ============================================================================== 97.095 4GB drive running under AIX 3.2.5 We have an RS6000 550 at AIX 3.2.5 and just got a 4Gb drive. I'm perfectly happy to subdivide it into smaller partitions that are less than 2 gig. Before doing anything I took a look using lsdev -P -c disk -F "type subclass description " -H which only lists 2 gig and smalller drives. Do we need to upgrade to 3.2.5.1 to even put the drive on? ------------------------------------------------------------------------------ After a long discussion with some of my former collegues and a engineer, we discovered why MOST hard drives larger than 2 gig have problems when attached to the IBM RS/6000 4-1 SCSI controllers. The problem is not a single issue, of course; it turns out to be a myriad of if's and maybe's. What I can say is you CAN get a drive larger than 2 Gb to work with the 4-1 controller; many people have kindly shared information on how they did that. I'd like to share the info I have on this subject in three sections: the 4-1 SCSI controller, the hard drives, and the RS/6000 SCSI drivers. 1. The 4-1 SCSI controller Like many people pointed out, the number of bits the interface utilizes has nothing to do with the capacity of the drive. They only specify the amount of data and speed at which the data moves across the interface and bus. I knew this, but, unfortunately, took an inexperienced tech's word as this being the whole problem. What is known about the controller is that it is SCSI-1 (a command subset of the SCSI-2 protocol), has an 8-bit bus, and is slower than a snail (~4Mb/s). We also know that this interface is no longer for sale by IBM; the only single-ended solution currently available from IBM is the 4-7. The controller SHOULD work with any drive that supports the SCSI-1 protocol and can pipe data 8-bits at a time (i.e. the bus is NARROW instead of WIDE). Note, however, that the microcode on the controller might NOT be compatable with the microcade that controls the hard drive. 2. The Hard Drive The "official" IBM line is that they only support the drives that they make and/or sell. Putting a non-IBM drive in your system *might* void your service contract or warrenty; you might what to check this out before you decide to put a non-IBM drive in your system (if you are a corporate or government user). But, of course, with the number of us who have "second-hand" systems with no support, this is rarely an issue. Again, the drive and controller SHOULD work together provided that the drive supports the NARROW data bus and the SCSI-1 protocols. Some SCSI-2 drives can do this with no problems; others, however, can't. These SCSI-2 drives usually rely on SCSI-2 commands and protocols to run correctly. If the drive is fast/wide, chances are it won't work with the 4-1 controller. You *might* find the rare fast/wide SCSI-2 drive that can. Again, also, is the chance the microcode that runs the drive and talks to the SCSI interface is incompatible with the microcode on the 4-1 controller. The letters I have recieved thus far point to Quantum drives being those that give the most problems. 3. The RS/6000 SCSI drivers The SCSI device drivers that AIX utilizes (this is under 3.2.5) are very generic in nature. As such, the hardware my be compatable, but the device drivers may not be able to properly talk to the drive to read and write data. The drivers may not even recognize the drive as a valid SCSI device. How to determine if your drive will work with your RS/6000? According to our engineer friend, the best way to determine if your drive will work with your system is the following: 1. Power down your system and install the new drive. 2. Power up your system in SERVICE MODE; preferably booting from diagnostic diskettes. 3. Select the SERVICE AIDS option (#2 on the 2.4.3 diagnostics list). 4. Select the SCSI BUS ANALYZER and follow the prompts. If the SCSI Bus Analyzer can see you drive, then it means there is a very good chance that your drive will work properly. If you cannot, then save yourself some headaches and try a different drive. ============================================================================== 97.096 Physical volume corruption ============================================================================== I am having problems trying to make a disk (Micropolis 9Gb known as "hdisk2") available as physical volume which I can then attach to a volume group. I get the following when executing "lspv hdisk2": Physical Volume: hdisk2 Volume Group: micro9gig PV Identifier: 0000003390350286 VG Identifier: 00000033a83eb579 PV State: ??????? Stale Partitions: ??????? Allocatable: ??????? PP Size: ??????? Logical Volumes: ??????? Total PPs: ??????? VG Descriptors: ??????? Free PPs: ??????? Used PPs: ??????? Free Distribution: ??????? Used Distribution: ??????? ------------------------------------------------------------------------------ There was/is a problem (not sure of its status) with Micropolis drives and the LVM (the problem was from the Micropolis side). See if the stuff described below is relevant to the problem. PROBLEM When working with new Microplis drives, the following behavior is observed after creating a new volume group: # mklv -y jnk vg3 1 0516-022 lextendlv: Illegal parameter or structure value. 0516-822 mklv: Unable to create logical volume. 0516-304 getlvodm: Unable to find device id 000082611753ffba.2 in the Device Configuration Database. 0516-304 getlvodm: Unable to find device id 000082611753ffba.2 in the Device Configuration Database. 0516-356 lvrelminor: Warning, the reldevno function failed. 0516-304 putlvodm: Unable to find device id 000082611753ffba.2 in the Device Configuration Database. 0516-916 rmlv: Warning, can not remove logical volume 000082611753ffba.2 from Device configuration database. # lqueryvg -Atp hdisk3 0516-086 lqueryvg: Volume group descriptor area has a bad block. The VGDA is fine until after some LVM command fails, and then is marked as having a bad block. CAUSE Read-ahead is not working on these drives, and parts of the VGDA are not being correctly updated. The LVM is issuing the writes correctly, but the disk is not completely them, even though it says that it does. SOLUTION Ultimately, Micropolis needs to address this problem from their end. However, here is a temporary workaround. Be warned that it will alter the osdisk (Other SCSI Disk Drive) driver, which will affect other third-party drives. Here are the steps to run: varyoffvg testvg cp /etc/objrepos/PdAt /etc/objrepos/PdAt.backup odmget -q "uniquetype=disk/scsi/osdisk and attribute=mode_data" PdAt > file The file should have this entry (the deflt line is one continuous line): PdAt: uniquetype = "disk/scsi/osdisk" attribute = "mode_data" deflt = "0x000000080000000000000200010124020a0000000000 0000000000070a05000000000000000000080c0000ffff 0000ffffffff00040a06000100000000" values = "" width = "" type = "R" generic = "" rep = "s" nls_index = 0 Change it to look like (make the deflt line one continuous line, with no spaces between the hex numbers): PdAt: uniquetype = "disk/scsi/osdisk" attribute = "mode_data" deflt = "0x000000080000000000000200010124020a0000000000 0000000000070a05000000000000000000080c0100ffff 0000ffffffff00040a06000100000000" values = "" width = "" type = "R" generic = "" rep = "s" nls_index = 0 odmdelete -q "uniquetype=disk/scsi/osdisk and attribute=mode_data" -o PdAt odmadd file rmdev -l hdisk# (where hdisk# is the Micropolis disk) mkdev -l hdisk# bosboot -a ============================================================================== 97.097 High speed modem ============================================================================== We have a dialup line with a 28.8kbps modem, all of us connect fine at 28.8 kbps. But I think the terminal speed is still limit with 9600 (because zmodem shown 9xxbps rate). I tried to disable the line and use smit to tune up the speed to 19200, re-enable the line but dialup is garbled, with silly characters. Any idea on how to achieve the maximum speed? ------------------------------------------------------------------------------ As you are probably aware, there are two different bps's when you talk about a modem. There is the speed at which the modem connects to another modem across the dial-up line, i.e. 28.8 kbps and the speed at which the modem "talks" to the computer it's attached to (serial connection). Of course, it's possible to connect to another modem at 28.8 kbps and still communicate to the computer at 9600. This port speed is usually configured on the modem to adjust to the speed at which the computer "talks" to the modem. So there's your problem: The modem was last "spoken to" by your computer at 9600bps, then you changed the tty speed to 19200bps. The modem is still at 9600 when another modem dials in and connects, and the 9600bps modem to 19200bps tty results in garbage on your screen. You can correct this by dialing out with your modem (or simply communicating to it serially at 19200bps). You can use the following: # cu -ml tty# <--You type (tty# is the serial port where the modem is connected) connected <--System responds AT <--You type OK <--Response ~. <--You type ~[system name]. <--Response <--You type # <--Back to prompt Please note: The port must be configured to dial out (disable or share) and you need to have "Direct" configured in either your /etc/uucp/Dialers or /etc/uucp/Devices file (I forget which one, sorry). ============================================================================== 97.098 ftpd and symlinks ============================================================================== How do I allow user access via ftpd to symbolic links? I have created symbolic links in my anonymous ftp user area which works fine locally. However, when one ftp's into the system (AIX 4.1.5) the symlinks are not accessible. I have tried changing ownership on the symlinks but no change. ------------------------------------------------------------------------------ Symbolic links work by putting what you type on the command line in the file system to be resolved. If the link specified is relative (if it does not begin with a /), then the link is interpreted relative to the directory of the link. For security reasons, anonymous ftp calls the chroot() system call to change the root for the ftp process to the ftp anonymous area. This means that (1) it can't access anything not under this file structure, and (2) if a symbolic link is absolute, it will resolve to a place under the new root. So, the rules for symbolic links in the ftp area are: 1) the data pointed to must be under the anonymous ftp root directory 2) the link must be relative to its own location. ============================================================================== 97.099 Direct connect through COM1 or COM2 ============================================================================== How would I go about hooking up a router or a hub or something of that nature directly to a com port on a aix machine. I would like to hook up a router directly through the serial port and then access the routers configuration. Are there any recommended programs for doing. If so reply back via the news group. ------------------------------------------------------------------------------ It shouldn't be too difficult. Attach via a terminal cable (null-modem cable) rather than a modem cable, or use a separate null modem (which IBM used to call a "terminal/printer interposer"). Configure the tty port attributes to match those defined in the router manual for attachment of the control terminal (probably 8/N/1 at 9600). Then you can talk to the router as you would to a modem: I'd use C-Kermit myself... free, good, scriptable, but any program would do. before you get any scripts set up, you'd talk to the device like this: kermit C-Kermit 6.0.192, 6 Sep 96, for IBM AIX 4.1 Copyright (C) 1985, 1996, Trustees of Columbia University in the City of New York. Default file-transfer mode is BINARY Type ? or HELP for help. C-Kermit>set line 1 C-Kermit>set speed 9600 1, 9600 bps C-Kermit>set parity none C-Kermit>set modem none C-Kermit>connect Connecting to 1, speed 9600. The escape character is Ctrl-\ (ASCII 28, FS) Type the escape character followed by C to get back, or followed by ? to see other options. ============================================================================== 97.100 Changing physical volume names ============================================================================== Does anyone know a reasonably simple way to change the name of a physical volume from hdisk1 to hdisk0? Is it something you can change easily in the ODM? ------------------------------------------------------------------------------ You should not equate the hdiskx label of a disk to your physical volume. hdiskx labels are assigned at boot time I believe and you can get yourself into serious trouble assuming that hdiskx belongs to vgx. Here's a completely unsupported script to change hdisk names. hdisk names are COMPLETELY cosmetic and don't really matter, provided that the PVID and VGDA are intact. hdisk names are assigned when they are configured and don't change unless deleted from the ODM, the ODM is rebuilt, or if the disks are replaced. #!/bin/ksh # # mvhdisk : by Kevin Gee, 6 August 1996 # # Syntax: mvhdisk # file=/tmp/.mvhdisk.0 file2=/tmp/.mvhdisk.1 lspv | grep $1 > /dev/null 2>&1 if [ $? -ne 0 ] then echo mvhdisk: Cannot find $1 in the device configuration database exit -1 fi lspv | grep $2 > /dev/null 2>&1 if [ $? -eq 0 ] then echo mvhdisk: $2 already exists in the device configuration database exit -1 else odmget -q name=$1 CuAt > $file odmdelete -q name=$1 -o CuAt > /dev/null 2>&1 odmget -q value=$1 CuAt >> $file odmdelete -q value=$1 -o CuAt > /dev/null 2>&1 odmget -q name=$1 CuDep >> $file odmdelete -q name=$1 -o CuDep > /dev/null 2>&1 odmget -q name=$1 CuDv >> $file odmdelete -q name=$1 -o CuDv > /dev/null 2>&1 odmget -q value3=$1 CuDvDr >> $file odmdelete -q value3=$1 -o CuDvDr > /dev/null 2>&1 odmget -q name=$1 CuVPD >> $file odmdelete -q name=$1 -o CuVPD > /dev/null 2>&1 sed "s/$1/$2/g" $file > $file2 odmadd $file2 mv -f /dev/$1 /dev/$2 mv -f /dev/r$1 /dev/r$2 savebase echo $1 changed rm /tmp/.mvhdisk* fi