Unix Notes

4/23/2002

Red text indicates a change or new stuff added.

I've put together these notes over the years in order to help me with Unix systems support. And yes, a small bit of searching will get the same information. Probably more information in a better format, now that I think of it.

Anyway, I hope this helps.

Disclaimer: Use at your own risk. If you see any problems with this stuff, please send an email explaining what I screwed up on: DBurton3@TampaBay.RR.Com.

Links: I have some links scattered throughout this page that will take you to other Unix related sites. I've also duplicated them (and maybe added some) at the bottom of this page.


Rosetta Stone for UNIX

Exceed Stuff

Reflection Stuff

Unix (HP) Stuff

Building an HP-UX 10.20 or 11.00 bastion host CDE stuff How to change the CDE login screen? How to change the CDE login screen "Welcome" message? How to change the CDE screen saver (locked screen) logo bitmap? How to change the CDE Login Greeting: Copyright (Blue) Screen Disable X-Client access (Exceed and Reflection can't connect) Host lookup issues How to boot to single user mode Ignite To wipe the drives Changes to sendmail.cf Lan cards Check Lan cards LVM Stuff Make a bootable mirror disk Add a mirror Remove a mirror and/or the mirror drive To extend a logical volume /etc/lvmtab file problems Volume Group problems Console settings for N and L servers IP to MAC address resolution (or who pings back on the subnet) Software Depot and SW install stuff Check core dumps Copy a set of printers from one server to another Convert a "nolargefiles" file system to a "largefiles" file system Mounting CDs PFS mount Kernel stuff Other Kernel stuff Check Kernel parameters Set the stinkin date 32 or 64 bit supported server .profile thang - put into /.profile and create link NTP stuff OmniBack stuff Recreate device files Setting/Resetting some system parameters Swap Find stuff Move (copying) /usr Backups Command line stuff NIS Stuff Errors and such Hitachi/Controler time out Get statistics and info Give root a REAL ksh shell at bootup Check /etc/passwd and /etc/group files Man page stuff

Unix (Sun) Stuff

Scripts

PC Stuff

Links to other Unix sites


Rosetta Stone for UNIX:
http://bhami.com/rosetta.html
Can't say enough about this site. Great cross reference of Unix commands.

Top


Exceed Stuff - like Reflection


/usr/bin/X11/xterm -display @d &

   - to get an xterm only



open "xconfig -> communication"

  mode = xdmp-query

  press "configure" button, type in target hostname

  display class = HCLpcXserver

Top

Reflection Stuff - like Exceed


In "Connection type" window:

  In "Description:" area...  XDMCP Direct to Host_IP

  In "Method:" area...       Direct

  In "Host name:" area...    Host_ip



NOTE:

"Host_IP" is the host IP address you want to connect too.

Top

Unix (HP) Stuff


HP Support:       1-800-633-3600

Hp Contracts:     1-800-386-1115



HP ITRC:          http://us-support.external.hp.com/



   Look up the following document numbers in ITRC to find "L" and "N"

   server troubleshooting info:

     L-Class Server - HP document number: 26812dhtm

     N-Class Server - HP document number: 25559dhtm



HP Documentation: http://docs.hp.com/index.html



HP Security: ftp://ftp.itrc.hp.com/export/patches



HP Freeware:

  http://hpux.cs.utah.edu/, or

  http://hpux.connect.org.uk/, or

  http://hpux.ee.ualberta.ca/

Top

Building an HP-UX 10.20 or 11.00 bastion host


To build a pretty secure system...

http://people.hp.se/stevesk/bastion.html

Top

CDE stuff


xmodmap -e "keycode 109=hpDeleteChar"

   - Map the "del" key



xmodmap -e "pointer = 123"

   - Change the mouse buttons.



what /usr/lib/Motif1.2/libXm.sl

   - Get motif version info



/usr/dt/bin/dtconfig -e

   - Enable CDE



/usr/dt/bin/dtconfig -d

   - Disable CDE



Send sound to another server/workstation:

  On target.com box as root...



    /usr/ausio/asecure -C

    enter the root password

    /usr/audio/bin/asecure +h source.com



  On source.com box...



    /usr/audio/bin/send_sound \

    /path/of/sound/file.au -server target.com

Top
How to change the CDE login screen?

1. Obtain the application "XV" from this site:

   

     http://hpux.cs.utah.edu/, or

     http://hpux.connect.org.uk/, or

     http://hpux.ee.ualberta.ca/

   

2. Use XV to convert your existing bitmap file to XPM format.



   Valid values for this resource can be any file which can be

   viewed in the CDE icon editor (dticon).  If the file is in either

   XMICONSEARCHPATH or XMBMICONSEARCHPATH, then only the filename is

   necessary.  If the file is not in one of those paths, then the

   full path should be specified.



3. Save file to: /etc/dt/appconfig/icons/C/LoginLogo.xpm



4. chmod   444   /etc/dt/appconfig/icons/C/LoginLogo.xpm



5. Add the following:



   Dtlogin*logo*bitmapFile: /etc/dt/appconfig/icons/C/LoginLogo.xpm

   Dtlogin*logo*height: 139   (68  for Exceed)

   Dtlogin*logo*width:  552   (276 for Exceed)



   to the /etc/dt/config/C/Xresources file.

Top
How to change the CDE login screen "Welcome" message?

It can be set system-wide by adding these lines in the

/etc/dt/config/C/Xresources file:



   Dtlogin*greeting.labelString: Welcome to %LocalHost%\n

   Insert additional message here\n

   Final additional text



Note:

The \n's indicate places where newlines should appear in the greeting.



   Inserting %DisplayName% will display the X server

   display name if different from the login host.



Once the user name has been entered, the login server displays

the message Welcome username by default.  This greeting string can

be customized by changing the line:



    Dtlogin*greeting.persLabelString:   Welcome %s



Note:

The "%s" will be replaced with the username by the

system. So if you want to change the login to read

"login_name is a goof", you would make the change

look like "%s is a goof" instead of "Welcome %s".

Top
How to change the CDE screen saver (locked screen) logo bitmap?

It can be set system-wide by adding this line:



   Dtsession*lockImageName: /etc/dt/appconfig/icons/C/LoginLogo.xpm



to the /etc/dt/config/C/sys.resources file.



Per-user changes can be made in $HOME/.Xdefaults.

An example would be:

    Dtsession*lockImageName: ~/bitmaps/YourLoginLogo.xpm



Also, you can change the width and height with the following

additional lines:

    Dtsession*lockImageName*height: 129

    Dtsession*lockImageName*width:  282

Top
How to change the CDE Login Greeting: Copyright (Blue) Screen

Add this next line to the /etc/dt/config/Xconfig file:



   Dtlogin*environment: INFO_PATH=/etc/motd



Run this command to reload the configuration information:



   /usr/dt/bin/dtconfig -reset



Note:

Sometimes (don't know why) adding this stinkin file will make the

"new" login logo NOT show. If this is your problem do the

following...



Change the default 'dthello' execution:



    To create and modify this new script, run:



        vi /etc/dt/config/Xsession.d/0091.dthello



    Add the following lines to this new script:



        #!/usr/bin/ksh

        dtstart_hello[0]="/usr/dt/bin/dthello -file /etc/motd &"



    Set the permissions:



        chmod 555 /etc/dt/config/Xsession.d/0091.dthello

Top
Disable X-Client access (Exceed and Reflection can't connect)

Comment out the following lines in /usr/dt/config/Xaccess



*    # grant service to all remote displays

*    CHOOSER BROADCAST    #any indirect host can get a chooser

Top

Host lookup issues


Trouble with host lookup using DNS and NIS?

Try adding this to the /etc/nsswitch.conf file



  hosts: dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] \

    files[NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]

  hosts: nis [NOTFOUND=return UNAVAIL=continue] \

    files[NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]



  Note:

  The four lines above should be two lines. One for DNS and one for

  NIS. I typed it this way so it would fit on the sheet.

Top

How to boot to single user mode


For 9000/700 series



   b p0 ipl

   isl>hpux -is boot disc(;0)/stand/vmunix



   isl>hpux -is boot disc(;0)/stand/vmunix.prev

      - Boot to previous kernel



For 9000/800 series



   sea ipl

   bo p? ipl

      - Where "?" is the p number given for the boot item you

        want to use.



   hpux -is (;0)/stand/vmunix

      - Or just "hpux -is"

Top

Ignite


isl> hpux (;0)/boot/install

   - Boot to an ignite server.



make_sys_image -d /tmp -v -s local

   - To make a system image for ignite and place it into /tmp.



make_recovery -vAC -d /dev/rmt/c?t?d?BEST

   - To make a recovery tape.



   Note:

   The make_recovery tool will create a recovery tape for a

   system with mirrored disks but it will not preserve the

   mirrored disk configurations.

Top

To wipe the drives


mediainit -v /dev/rdsk/c?t?d?   <-- We like this one........

Top

Changes to sendmail.cf


In order to send mail to uppercase users ("USER" for example).



Add the "u" below:



From: Mlocal,P=/usr/bin/rmail, F=lsDFMAw5:/|@qm9,  S=10/30, R=20/40,

To:   Mlocal,P=/usr/bin/rmail, F=lsDFMAw5u:/|@qm9, S=10/30, R=20/40,

Top

Lan cards


Use "lanscan" to get "NUM ID" to use on stuff below.



lanadmin -x         0 = lan info - speed half or full duplex

                                 - auto on or off

lanadmin -X 100HD   0 = turn lan0 to 100 speed half duplex auto on

lanadmin -X 100FD   0 = turn lan0 to 100 speed full duplex auto off

lanadmin -X AUTO_ON 0 = turn Auto Neg. on



If "ioscan -funC lan" shows "btlan" as the device driver for

the lan card, then modify the /etc/rc.config.d/hpbasetconf file

to read:



  HP_BASET_INTERFACE_NAME[0]=lan0 - the lan number

  HP_BASET_SPEED[0]=100FD         - the speed you want

Top
Check Lan cards

linkloop -i 1 mac_address

   - Check loopback



lanscan -v

   - Verbose output



ifconfig lan0  (or lan1, or lan2)

   - Status of network interfaces



netstat -in

   - IP interfaces



/usr/sbin/fddistat /dev/lan0

   - Check the state of the FDDI card



/usr/sbin/fddinet /dev/lan0

   - Check the FDDI network neighbors



elstat -n ??? -v

   - Check the ATM card

NOTE:

"???" is the ATM card name gathered from the "netstat -i" command

Top

LVM Stuff


Make a bootable mirror disk (primary=c0t6d0, alternate=c0t5d0)

pvcreate -B /dev/rdsk/c0t5d0

   - The -B option is used to create a bootable Physical Volume.



mkboot /dev/rdsk/c0t5d0

   - Make sure to use the character device file when using mkboot.



mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO /

          -p HPUX  -p LABEL /dev/rdsk/c0t5d0

   - Add Diag to lif.



mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c0t5d0



   Note:

   The "-lq" indicates no quorum when two disks are used.

   When three or more are used you don't need "-lq."



   You also need to do this with the primary disk. Otherwise,

   when you boot normally to pri and the alt disk is not there

   for whatever reason, you will **NOT** be able to boot. The

   pri disk will "look" for the alt disk. No quorum???? To bad

   so sad, you loose. Ack! So do this too:



   mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c0t6d0



vgextend /dev/vg00 /dev/dsk/c0t5d0

   - Adds the Physical Volume to the root volume group.



----------------



Do this next command for each "lvol"[1-7]......



lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0



    ******* or *******



for x in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 swap2 Crash Logs

  do

    echo "\n******** Doing ${x} ********\n"

    lvextend -m 1 /dev/vg00/${x} /dev/dsk/c0t5d0

done



Don't forget any extra swap you added (like /dev/vg00/swap2).

Do "swapinfo" and "bdf" to check for swap and any other lvols

that may have been created.



----------------



lvlnboot -r /dev/vg00/lvol3

   - Specifies the root logical volume.



lvlnboot -s /dev/vg00/lvol2

   - Specifies the swap logical volume.



lvlnboot -d /dev/vg00/lvol2

   - Specifies the dump logical volume.



lvlnboot -b /dev/vg00/lvol1

   - Specifies the boot logical volume. 



lvlnboot -R

   - Recovers any BDRA info.



lvlnboot -v

   - Verify boot, root, swap and dump settings.



setboot

   - Display the Primary and Alternate boot paths that are

     currently set.



setboot -a 10/0.5.0



   Note:

   Change the Alternate Boot Path to the path of the Root Mirror.

   Use "ioscan -funC disk" to find out what the path should be.

   Run "setboot" again to confirm the change.



Do "shutdown -r 0" (or "reboot") to test. After halting the boot

process, type in "bo alt" to boot from the alternate disk. Also,

you may want to *remove* the primary disk to test as well. The

server should automagically boot from the alternate disk if the

primary is not found and no quorum was set.

Top
Add a mirror

vgextend /dev/vg00 /dev/dsk/c?d?t?

   - Adds alternate links



lvextend -m 1 /dev/vgoo/lvol1 /dev/dsk/c?d?t?

Top
Remove a mirror and/or the mirror drive

lvreduce -m 0 /dev/vg00/lvol1

   - Remove the mirror from a logical volume



vgreduce /dev/vg00 /dev/dsk/c?t?d?

   - Remove the disk from the volume group

Top
To extend a logical volume (do in single user mode for var, tmp, etc.)

Unmount the target file system.



   lvextend -L 400 /dev/vg00/lvol3

      - Increase to 400 meg



   extendfs /dev/vg00/rlvol3

   mount -a

Top
/etc/lvmtab file problems

Down ALL applications first, then:



  mv /etc/lvmtab /etc/lvmtab.old

     - Move out the old (bad?) lvmtab.

  vgscan -v -p

     - Check the lvmtab file.

  vgscan -a

     - Generate the lvmtab file.

  vgchange -a

     - Activate all volume groups.

  lvlnboot -R

     - Correct boot information on disk.

Top
Volume Group problems

vgcfgrestore -n /dev/vg00 -o /dev/rdsk/c?t?d?

   - Restore LVM volume group configuration from backup file.



vgchange -a -y  /dev/vg00 /dev/rdsk/c?t?d?

   - Activates volume group.



vgsync /dev/vg00 /dev/rdsk/c?t?d?

   - Synchronize stale logical volume mirrors in LVM volume groups.



lvsync /dev/vg00/stuff

   - Synchronize stale mirrors in LVM logical volumes.

Top

Console settings for N and L servers


Exit the session before making these changes to the terminal

configuration.



Perform the following steps on a 700/96 terminal:



      1. Press the user/system key to get to the configuration

         screen.

      2. Press f8 (config keys).

      3. Press f5 (terminal config).

      4. Tab to the Terminal Id field.

      5. Type VT100 in this field.

      6. Tab to the TermMode field.

      7. Press f2 (next choice), EM100 appears in the field.

      8. Press f1 (save config).

      9. Use the f8 (config keys) to go to the ansi config screen.

     10. Press f6 (ansi config).

     11. Tab to the backspace Def field.

     12. Press f2 (next choice).

     13. Verify the Backspace Def field now reads BackSpace/Del in

         the field.

     14. Tab to the EM100 ID field.

     15. Press f2 (next choice) to change the EM100 ID field to

         EM100.

     16. Press f1 (save config).





The terminal should now display EM100 below the softkeys.



This procedure enforced the following settings:



      * terminal id to vt100,

      * termmode to em100,

      * correctly mapped the backspace and delete keys

      * em100 id to EM100



The terminal is now ready to correctly operate in vt100 mode.

Top

IP to MAC address resolution (or who pings back on the subnet)


ping XXX.XXX.XXX.255    example:(120.1.1.255)

arp -a



"? (120.1.1.XX) at bi:g_:ma:c_:ad:dr:es:s_  ether"  = DNS can't

  resolve IP to name. You may have a spook on the line.

Top

Software Depot and SW install stuff


To install a patch:



   sh /tmp/Patch_Name.sh

      - Un-shar the file.



   swinstall -x autoreboot match_target=true -s /tmp/patch.depot



swcopy

   - To add depots to an 11.00 server using the GUI.

     (swcopy -v -s /tmp/patch_dir/PH*.depot @ /tmp/patch_dir

       - then "swreg")



swcopy -x layout_version=0.8 -i

   - To swcopy a depot of 10.20 patches onto an 11.00 server

     using the GUI.



swreg -l depot -v /PATH/of/depot

   - To register a depot.



swlist -l fileset -a state

   - Check filesets installed.



swinstall \*

   - To complete the installation of the software.



swverify \*

   - To verify all products and dependency files.



cleanup

   - On 10.20 servers will remove old patches and cleanup

     the logs.



cleanup -c 1

   - Same for an 11.00 server

Top

Check core dumps


file core

   - What made the stinkin core in the first place



what core

   - To get the libs used



gdb -c core

   - To debug the stinker



gdb ProgramName -c core

   - To debug the stinker



Also see HP doc - KNC071499001

Top

Copy a set of printers from one server to another


On server "A"

  1. Open "sam ->Printers and Plotters->LP Spooler->

     Save/Restore Spooler Configuration"

  2. Go to "Actions"

  3. Click on 'Save Spooler Configuration'

  4. Exit out of SAM

  5. cd /var/sam/lp; tar cvf sam.tar *

  6. Transfer the sam.tar file to system B:/tmp.



On server "B"

  1. mkdir /var/sam/lp  if not created already

  2. cd /var/sam/lp ; mv /tmp/sam.tar /var/sam/lp ; \

     tar cvf sam.tar *

  3. Open "sam ->Printers and Plotters->LP Spooler->

     Save/Restore Spooler Configuration"

  4. Go to "Actions"

  5. Click on 'Restore Spooler Configuration'

  6. Don't forget to restart the scheduler

  7. Exit out of SAM

Top

Convert a "nolargefiles" file system to a "largefiles" file system


fsadm -F hfs (or vxfs) /dev/vg00/lvol1

   - Display statistics



fsadm -F hfs (or vxfs) -o largefiles /dev/vg00/lvol1

   - To change it

Top

Mounting CDs


mount /dev/dsk/c?t?d? /cdrom

exportfs -i -o ro /cdrom



  (On other server)

mount -r hostname_of_server_above:/cdrom /cdrom

Top
PFS mount

Add "/dev/dsk/c?t?d? /SD_CDROM pfs-rrip xlat=unix 0 0" to 

the /etc/pfs_fstab file.



  c?t?d? = The CD device

  SD_CDROM = Mount point



Run "nohup /usr/sbin/pfs_mountd & ; nohup /usr/sbin/pfsd"



  Note:

  THE ORDER IS VERY IMPORTANT pfs_mountd MUST BE STARTED FIRST!



Check to be sure pfs started all the correct processes, use the

following command and should see the output below if everything

is correct:



    # ps -ef | grep pfs

    root 17456 17455 0 15:15:24 ttyp1 0:00 pfsd.rpc

    root 17453 17452 0 15:15:18 ttyp1 0:00 pfs_mountd.rpc

    root 17455 16772 0 15:15:23 ttyp1 0:00 pfsd

    root 17452 16772 0 15:15:18 ttyp1 0:00 pfs_mountd

    root 17475 16772 2 15:15:32 ttyp1 0:00 grep pfs



Now mount the cd using the following syntax, where cXtXd0 is the

CD-ROM device file on your machine. Replace the X with the

correct numerical information from your machine.



    pfs_mount /SD-CDROM

      - If the /etc/pfs_fstab was made.



    pfs_mount -o xlat=unix /dev/dsk/c?t?d0 /SD_CDROM

      - To mount the CD in Rock Ridge format.



    pfs_mount -o xlat=unix /dev/rdsk/c?t?d0 /SD_CDROM

      - if not /etc/pfs_fstab was not made.



Only use pfs_umount to dismount the CD-ROM.



    # pfs_umount /SD_CDROM



Note:

A reboot will be required if at anytime the umount command is issued

on the pfs mounted CD-ROM instead of using the pfs_umount command.

Top

Kernel stuff


Make a new kernel in SAM but do not "put into place". Then do:



   mv /stand/system /stand/system.prev

   mv /stand/build/system.SAM /stand/system

   /usr/sbin/mk_kernel   (10.20 or 11.00)

   reboot



NOTE:

Ok... so I don't really know why you would want to do this. I've

always let SAM put the kernel into place and rebooted.

Top
Other Kernel stuff

Boot from desired kernel.



   To boot normally from the previous kernel, type:

   "hpux (;0)/stand/vmunix.prev" and [return].



   To boot in "single user" mode from the previous kernel, type:

   "hpux -is (;0)/stand/vmunix.prev" and [return].



   To boot in "lvm maintenance" mode from the previous kernel,

   type "hpux -lm (;0)/stand/vmunix.prev" and [return].



   Note:

   To boot from some other kernel, replace the kernel file

   name "vmunix.prev" with the name you gave your alternate

   kernel. 



(optional)

After the system is booted, rename the kernel files so the next

time the system is rebooted normally correct kernel files will be

loaded.



   The kernel files are :



   /stand/vmunix

      - A file containing the kernel itself.



   /stand/system

      - A file containing the kernel configuration.



   /stand/dklm/*

      - A directory containing a few files and directories for

        kernel configuration purposes (for HP-UX 11.0 and up only).



Backup the current default kernel files:



   mv /stand/vmunix /stand/vmunix.bak

   mv /stand/system /stand/system.bak

   mv /stand/dlkm /stand/dlkm.bak (for HP-UX 11.0 and up only)



   NEXT



   Install the previous kernel to be booted to the default file

   name values :



   cp /stand/vmunix.prev /stand/vmunix

   cp /stand/system.prev /stand/system

   cp -R -p /stand/dlkm.vmunix.prev/* /stand/dlkm

     (for HP-UX 11.0 and up only)

Top
Check Kernel parameters

kmtune -l   or   sysdef

Top

Set the stinkin date


date -u mmddhhmmyy

    - month (mm), day (dd), hour (hh), minute (mm), year (yy)

Top

32 or 64 bit supported server


grep `/usr/bin/model` /etc/.supported_bits

   - Check /etc/.supported_bits



getconf KERNEL_BITS

   - See what an 11.x server is running



     or



swlist -l bundle | grep Runtime

   - To see what version has been loaded.

Top

.profile thang - put into /.profile and create link


The /.profile thing:



   # custom homedir for root users

   UID=`id | cut -d'=' -f2 | cut -d'(' -f1`

   [ "$UID" = "0" ] && {

       USER=`who am i | cut -d' ' -f1`

       echo "Setting up root environment for $USER"

       [ -L /home/root.$USER ] && {

          export HOME=/home/root.$USER

          . ~/.profile

       }

   }



The link:



   ln -s /home/dburton /home/root.dburton

Top

NTP stuff

Learn about NTP (time): http://www.ntp.org

ntpq -p

   - To check ntp



ntpdate -d 

   - To do other checking



In /etc/ntp.conf:



   ################################################

   # Server(s) we hit on in order to

   # "serve" everybody else in Domainname.com

   #

   # 12/21/2001 - drb

   ################################################



   server  1.1.1.1   version 3    prefer  # ntp.server.com

   server  1.1.1.2   version 3            # ntp.server2.com



   peer    1.1.1.3   version 3            # ntp.server3.com

   peer    1.1.1.4   version 3            # ntp.server4.com

   peer    1.1.1.5   version 3            # ntp.server5.com

   peer    1.1.1.6   version 3            # ntp.server6.com



   ################################################

   # Drift file.  Put this in a directory which the daemon can

   # write to. No symbolic links allowed, either, since the

   # daemon updates the file by creating a temporary in the

   # same directory and then renaming it to the file.

   ################################################



   driftfile /etc/ntp.drift       # path for drift file



   ################################################

   # Note that statsdir requires a trailing slash

   ################################################



   statsdir /var/spool/ntp/

   statistics  loopstats  clockstats  peerstats

   filegen peerstats  file peerstats  type day enable

   filegen loopstats  file loopstats  type day enable

   filegen clockstats file clockstats type day enable

Top

OmniBack stuff


Robotarm stuff:

  uma -ioctl /dev/rac/c?t?d?



  /usr/sbin/mc -p /dev/rac/c?t?d? -s D1 -d S1 -r IDSM

    s = Source (the drive in the library).

    d = Tape source

    r = Print out status



omnidb -version

   - To get version info



omnisv.sh stop

   - Stop OmniBack  (or do /sbin/init.d/omni stop)



omnisv.sh start

   - Start OmniBack (or do /sbin/init.d/omni start)



omnidb -session

   - List all sessions in the database



omnidbutil -info

   - List database space usage



omnidbutil -extendinfo

   - Best info on specific database files



omnidbutil -extend /var/opt/omni/db/cdb -maxsize 2048

   - Add an "fvers.dat" file with it's maximum size of 2 gig.

   - Total of 4 "fvers.dat" files can be made.



omnidbutil -extendfilenames /var/opt/omni/db/cdb -maxsize 2048

   - Add an "fnames.dat" file with it's maximum size of 2 gig.

   - Total of 2 "fnames.dat" files can be made.



To clean up the database a bit:



   1. Delete items from the OmniBack "Monitor" GUI window

   2. Verify that no OmniBack sessions are running

   3. Strip the database using "omnidb -strip"

   4. More cleaning using "omnidbutil -clear"

   5. Do a purge using "omnidbutil -purge -detail -days ?"

      purge  = Purge stuff

      detail = Out of date file versions and names are removed

      days   = Data older then "?" days are removed



Copy the OmniBack database to another filesystem:



   mkdir /new_omni_database_location

   Create the new filesystem and mount it.

   cd /var/opt/omni/db

   find . -xdev -depth -print | cpio -pxdm \

       /new_omni_database_location

   ln -s /var/opt/omni/db /new_omni_database_location



The syntax for the exclude option in

/etc/opt/omni/datalist/filename is:



      Disk:/path   or  /path



   For Host backup, the syntax used is:

      /path		for Unix (/blahdeblah)

      Drive:\path	for NT (c:\blah\blah.log)

      Volume:\path	for NetWare (sys:\blah\blah.log)



Stuff placed in the /etc/opt/omni/NOTIFICATION file:



   NOTIFICATION "Device Error" 

   { -event "DeviceError" 

   -object "*" 

   -email "backup" 



   NOTIFICATION "Tape Mount Request" 

   { -event "MountRequest" 

   -object "*" 

   -email "backup" 

   } 



   NOTIFICATION "DB Space Low" 

   { -event "DbSpaceLow" 

   -object "*" 

   -email "backup" 

   } 



   NOTIFICATION "Backup Finished" 

   { -event "EndOfSession" 

   -object "*" 

   -email "backup" 

   }

Top

Recreate device files


insf -e

   - Use the "-e" option to re-install device files

Top

Setting/Resetting some system parameters


set_parms hostname

set_parms timezone

set_parms date_time

set_parms root_passwd

set_parms ip_address

set_parms addl_netwrk

Top

Swap


swapinfo -a

   - Get info



swapon /

   - Opens entire system to swap.

Top

Find stuff


find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -ld {} \;

   - Find set-owner-id and set-group-id files.



find / -type f -name core -exec rm {} \;

   - Find core files (not directories).



find . -user user_name | xargs chown new_user_name

   - Find then change files (and possibly the current directory)

     from one user name to a new user ID.



find / -name "*" -exec grep -l -i fsck {} \;

   - Grep "fsck" (or any other named item) in all files and list

     out the path to that file.

Top

Move (copying) /usr


cd /usr

find . -print | cpio -dlmpuvx /usr2

  d = Do directories

  l = Do links

  m = Keep time

  p = Pass along

  u = Copy inconditionaly

  v = verbose

  x = Save device special files

Top

Backups


fbackup -0 -f /dev/rmt/c?t?d?BEST -I /tmp/index -v

frecover -f /dev/rmt/c?d?t?BEST -v -I /tmp

  0 = Or "1" - (0 = full, 1 = incremental)

  f = Device file to use

  I = Directory to place index

  v = Verbose



mt -t /dev/rmt/c?t?d?BEST rew

  rew   = Rewind tape.

  offl  = Rewind tape and go off line.

  fsf 5 = Go forward five setmarks on the tape.

  bss 2 = Go backwards two setmarks on the tape.



tar cvf /path/file_name (or device_file_name) /path/target_to_copy

  c = Copy

  x = Restore

  v = Verbose

  t = Index

  r = Add to the end of list



tar cvf - ? | gzip -9> filename.tar.gz

   - To copy files to a tarball and gzip at the same time.

     NOTE:

     The question mark (?) is really supposed to be there.

Top

Command line stuff


while (true) ; do command ; sleep 2 ; done



for x in 1 2 3 ; do pvdisplay "/dev/dsk/c3t1d${i}" ; done | more



cp /etc/skel/.[A-z]* /home/new_user



Top

NIS stuff

Using netgroup info:



  for i in `netgrouplist net_group_list ; do something ; done

     - Use an NIS list to do something.



  export -i -o rw=@net_group_list /users

     - A /etc/hosts.equiv entry



  +@admin_access::-24:-24:::

     - Add to /etc/passwd to let ONLY the admins in that are on

       this list.

Top

Errors and such


Getting this at bootup:



"Corrupted tracing and logging header

      Internal error (210)"



The fix, run:



  /usr/sbin/nettl stop

  rm /usr/adm/nettl.log00

  /usr/sbin/nettl start

Top

Hitachi/Controler time out


ioscan -fun

   - To get Hitachi controller



pvdisplay /dev/dsk/c?t?d? | grep Timeout

   - To check timeout, should be 60



pvchange -t 60 /dev/dsk/c?t?d?

   - To change timeout value to 60



scsictl -a /dev/rdsk/c?t?d?

   - To check queue depth, should be 2



scsictl -m queue_depth=2 /dev/rdsk/c?t?d?

   - To change it to the value of 2

Top

Get statistics and info


ipcs -mqsabcopt

   - Interprocess communication facilities



vmstat -dnS 30 20

   - Drive info every 30 sec, for 20 times



iostat 30 20

   - Same as vmstat



sar -A -o /tmp/sar_info 30 20

   - Have "sar" collect data every 30 sec, 20 times.



sar -A -f /tmp/sar_info

   - Read the data from a given file

     (normally in /var/adm/sa/sa##).



Sar cron entry:

0 * * * * /usr/lbin/sa/sa1 600 6

   - Samples every 600 sec, 6 times.



cstm -f cstm.cfg

   - Where the cstm.cfg file has the following in it:



         savemap /prod/config/hostname.map 

         sall

         map

         il

         cds

         /prod/config/hostname.config

         exit



lssf /dev/dsk/c*

   - Get disk info

Top

Give root a REAL ksh shell at bootup


Change the "/sbin/sh" line for root in the /etc/passwd file to

"/sbin/ksh" then do this:



   cp -p /bin/ksh /sbin/ksh

Top

Check /etc/passwd and /etc/group files


Check the /etc/passwd and /etc/group files



  "pwck"  and  "grpck"

Top

Man Page Stuff


Run "catman" to build the "/usr/share/lib/whatis" file.



Then you can run the "man -k [some command] to see what

manual sections the command is in. For example, if you run

"man -k mkdir", it will show that "mkdir" is in

sections 1 and 2.



To see section 2 you would run "man 2 mkdir".

Top

Unix (Sun) Stuff


Support number: 1-800-USA-4SUN (800-872-4786)



/usr/ccs/bin/what /usr/dt/lib/lubXm.s0

   - Get motif version info.



Free up /var...



   cd /var/sadm ; find . -name save

      - Blow away "save" files



Change openwin logo to our logo...



   Make a tif file and copy to:



      /usr/openwin/server/etc/Solaris.im8.Z



/var/sadm/patch

   - Patch location



Other worth while commands:

  scsiinfo -p

  boot -r

  sysdef -d

  devinfo

  prtconf

  proctool    - Like Glance on HP

  probe-scsi  - Like "ioscan" on HP

  admintool   - Like SAM on HP



  NOTE:

  Check the Rosetta Stone for other commands similar 

  to HP commands.

Top

Scripts


Nothing yet........

Top

PC Stuff


Ok, so I can NEVER remember this stinkin line so I'm

putting it here. Just because....



pkzip -& -r -P a:\file_name.zip c:\some\directory

   - Zip files to multiple floppies:

Top

Links to other interesting Unix sites

HP ITRC: http://us-support.external.hp.com/
HP Documentation: http://docs.hp.com/index.html
HP Security: ftp://ftp.itrc.hp.com/export/patches
HP Freeware: http://hpux.cs.utah.edu/, or http://hpux.connect.org.uk/, or http://hpux.ee.ualberta.ca/
Build an HP-UX 10.20 or 11.00 bastion host: http://people.hp.se/stevesk/bastion.html

One of the best web links for UNIX class servers, located at: http://www.introcomp.co.uk/unixadmin.html

The Rosetta stone for Unix commands: http://bhami.com/rosetta.html

A big organizational chart of The Birth of Unix: http://perso.wanadoo.fr/levenez/unix/history.html

Learn about NTP (time): http://www.ntp.org

Top

Home Page

Hit Counter