hp how tos

Upload: dharmendra-patel

Post on 05-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 HP How tos

    1/8

    HP-UX FAQs/How-Tos

    Backup

    Tape Backup

    with Ignite-UX (10.x,11.x)

    make_tape_recovery -I -x inc_entire=vg00

    saves the "rootvg".

    HP-UX 9.x

    Create a minimum recovery tape allowing to boot the system, plus a full backup of the root disk:mkrs -v -q -tdat -f /dev/rmt/... -r /dev/dsk/... # make a bootable tapemkrs -v -q -tdat -f /dev/rmt/... -r /dev/dsk/... -m700 # make a bootable

    tape, force series 700fbackup -0 -i / -f /dev/rmt/...

    Backup w/ Copyutil

    1. Boot from Support CD (press ESC to interrupt normal boot)2.3. ISL> ODE

    4.5.6. ODE> COPYUTIL

    7.

    Using fbackup/frecover

    frecover -V /tmp/fb.volhd -N -v -f /dev/rmt/0m # read backup volume headerfrecover -r -N -v -f /dev/rmt/0m >/tmp/fb.log 2>&1 # lists backupfrecover -r -X -v -f /dev/rmt/0m # restores backup treeinto local directoryfrecover -x -X -i /bin+ -v -f /dev/rmt/0m # extract a specificobject into local directory

    Disks

    Adding a new disk (filesystem)

    HP-UX 9.x

    Maximum size: 4GB-1k = 4194303.

  • 7/31/2019 HP How tos

    2/8

    1. Connect the disk and use SAM orioscan to check if it's properly recognized. If not, check

    jumper settings.

    2. Format and verify the disk, query some info. For example assume a disk at ID=1 in a9000/715:

    3. mediainit /dev/rdsk/c201d1s04. /etc/diskinfo -v /dev/rdsk/c201d1s0

    5. If the disk does not appear in /etc/disktab, add the appropriate entries, as explained in

    that file. For SCSI disks the most important one is s0#, the size (in kB) taken from

    diskinfo. Formally required are also ns#,nt#,nc#,, but in my experience they can be

    faked, so that their product yields s0#.

    If the disk should also serve as a boot disk, further entries should be made with s0#

    reduced by the amount foreseen for swap and boot area (combined). Example:6. QUANTUM_FIREBALL1280S_noswap|QUANTUM_FIREBALL1280S_noreserve|

    QU_FIREBALL1280S_noswap|QU_FIREBALL1280S_noreserve:\7. :No swap or boot:ns#32:nt#16:nc#2445:\8. :s0#1251840:b0#8192:f0#1024\9. :se#512:rm#3600:10. QUANTUM_FIREBALL1280S_150MB|QU_FIREBALL1280S_150MB:\

    11. :150 MB swap:ns#32:nt#16:nc#2145:\12. :s0#1098240:b0#8192:f0#1024\13. :se#512:rm#3600:

    14. Create the new filesystem:15. newfs -v -L /dev/rdsk/c201d1s0 QUANTUM_FIREBALL1280S_150MB

    You may wish to protocol some of the listed superblock numbers, for emergency use with

    fsck.

    16.Alternatively, /etc/disktab may be bypassed by using /etc/mkfs, in this case some

    parameters (e.g. the size) have to be specified on the command line:17. /etc/mkfs /dev/rdsk/c201d1s0 1098240

    Anyway, /etc/mkfs is called by /etc/newfs

    Cloning a disk

    HP-UX 9.x

    e.g. onto a larger one. Note however, that boot disks have to be below 2GB (exactly), otherwise an

    IPL bad address error will occur on boot.

    Firstly, perform the steps necessary to add a new disk. Then:

    1. mount the target disk and copy the contents of the source disk:2. mount /dev/dsk/c201d1s0 /mnt # example for SCSI ID=1 in an 9000/7153. fbackup -0 -i / -e /mnt -f - | (cd /mnt; frecover -Xrf -)

    4. If the new disk should be bootable:5. mkboot -v /dev/dsk/c201d1s0

    and check bootability:

    http://www-aix.gsi.de/~kraemer/COLLECTION/HPUX/faqhowto.html#adddiskhttp://www-aix.gsi.de/~kraemer/COLLECTION/HPUX/faqhowto.html#adddiskhttp://www-aix.gsi.de/~kraemer/COLLECTION/HPUX/faqhowto.html#adddisk
  • 7/31/2019 HP How tos

    3/8

    lifls /dev/rdsk/c201d1s0

    A bootable disk reports something like:

    FS SWAP ISL AUTO HPUXEST ODE MAPFILE SYSLIB MAPPER

    IOTEST PERFVER XDIAG PAD

    while a non bootable disk reports an error message.

    In addition modify

    /mnt/etc/checklist

    to reflect the new filesystem to be fsck'ed on boot.

    More references:

    thread on Creating a bootable disk in 9.10

    how todetermine whether a disk is bootable

    usenet thread on can't boot on Micropolis 4110

    Tapes

    9144 tape handling

    Some info is collected here

    Duplicating HP install/support/update DAT tapes

    Install and support tapes contain at least two files, a LIF header with 2kByte records and a tar file

    with 10kByte records (512 bytes times default blocking factor 20). Thus it is indispensable tospecify the blocksize.

    Recipe to copy to disk first, then to tape:

    dd if=/dev/rmt/0mn of=install.lif bs=2k # note: 0mn to suppressrewinddd if=/dev/rmt/0m of=install.tar bs=10k # note: 0m to allow rewind

    # insert copy tapedd if=install.lif of=/dev/rmt/0mn bs=2k # note: 0mn to suppressrewinddd if=install.tar of=/dev/rmt/0m bs=10k # note: 0m to allow rewind

    If you have two tape drives:

    dd if=/dev/rmt/0mn of=/dev/rmt/1mn bs=2k # note: 0mn to suppressrewinddd if=/dev/rmt/0m of=/dev/rmt/1m bs=10k # note: 0m to allow rewind

    http://www.unix.com/hp-ux/71496-creating-bootable-disk-9-10-a.htmlhttp://www.unix.com/hp-ux/71496-creating-bootable-disk-9-10-a.htmlhttp://www.unixguide.net/hp/faq/5.3.11.shtmlhttp://www.unixguide.net/hp/faq/5.3.11.shtmlhttp://groups.google.de/group/comp.sys.hp.hardware/browse_thread/thread/ddbcaead7d7295da/bd33f6eca463e534?hl=de&ie=UTF-8&q=hp-ux+9+copy+boot++disk#bd33f6eca463e534http://groups.google.de/group/comp.sys.hp.hardware/browse_thread/thread/ddbcaead7d7295da/bd33f6eca463e534?hl=de&ie=UTF-8&q=hp-ux+9+copy+boot++disk#bd33f6eca463e534http://www-aix.gsi.de/~kraemer/COLLECTION/HPUX/hp9144a.htmlhttp://www.unix.com/hp-ux/71496-creating-bootable-disk-9-10-a.htmlhttp://www.unixguide.net/hp/faq/5.3.11.shtmlhttp://groups.google.de/group/comp.sys.hp.hardware/browse_thread/thread/ddbcaead7d7295da/bd33f6eca463e534?hl=de&ie=UTF-8&q=hp-ux+9+copy+boot++disk#bd33f6eca463e534http://www-aix.gsi.de/~kraemer/COLLECTION/HPUX/hp9144a.html
  • 7/31/2019 HP How tos

    4/8

    Sometimes such tapes have a third file, a "pseudo-tar", which serves as an extra indicator of the

    end-of-tape. I think it can be ignored.

    Tapes in "update" format are plain tar files. To be copied e.g. with:

    dd < /dev/rmt/0m > scratchfile ibs=10240 obs=512 # source tape, mind theblocksizes !

    tar tf scratchfile # verify proper tarformatdd < scratchfile > /dev/rmt/0m ibs=512 obs=10240 # target tape, mind theblocksizes !tar tf /dev/rmt/0m # verify proper tarformat

    After copying, an integral number of records should be reported, e.g.:

    19742+0 records in394840+0 records out

    Otherwise the blocksize is incorrect or the tapes are not in the HP format.

    Programming

    Query HP-UX version on the shell level

    HP-UX version in reasonable format:echo $(uname -r | sed -e 's/..//' -e 's/\.//')

    Query HP-UX version at cpp level

    #if defined(__hpux)

    #include #if defined(PRIV_PSET)#define _hpux_11i#elif defined(PRIV_SPUCTL)#define __hpux_11x#define OSMAJORVERSION 11#elif defined(PRIV_SERIALIZE)#define __hpux_10x#elif defined(PRIV_SETRUGID)#define __hpux_9x#endif#endif

    Generating 64-bit programs

    Use the native cc compiler's +DD64 option for compilation. On 32-bit systems the 64-bitDevLibs

    (Cross Platform Development Kit) must be installed to create executables. Of course 64-bitexecutables can't be executed on 32-bit systems.

    The native cc compiler implements the 4/8/8 model for (int/long/ptr).

    Shared vs archive libraries

  • 7/31/2019 HP How tos

    5/8

    Create shared libraries, HP-UX 10.20:cc -Aa +zld -o libxxx.sl -b *.o

    Force linking against archive libraries, HP-UX 10.20:cccc ... -Wl,-a,archive_shared

    ld ... -a archive_shared ...

    Miscellaneous

    Running SAM through a telnet session

    A situation which might occur with ancient boxes lacking ssh. SAM requires specific terminal

    characteristics. One may use a VT220 emulation:export TERM=vt220 # for ksh

    Updating the kernel

    mv /stand/build/System.SAM /stand/system # list of kernel parameters/usr/sbin/kmupdateshutdown -r -y now

    Setup a netdist server

    A netdist server is particular convenient to store codeword protected software (provided one has

    codeword and proper license, of course), since it can be copied (unprotected) once and for all times

    from CD to a server disk.

    Prerequisites: CD media, HP-ID-Module, HP license codeword(s) appropriate for the combination

    of hardware ID, CD Part number and product number. A more versatileSYSKOMP-ID-BOXmaybe used in place of the HP-ID-Module.

    1. Prepare a local target directory with enough disk space behind it. Default would be

    /netdist, possibly on an extra disk.

    Note, however, that this directory name will enter into the steering file, MAIN.pkg, and all

    paths have to be consistently named when the server daemon is started (place softlinks if

    necessary).2. If software is to be loaded from CD, mount it:3. mount -r -t cdfs /dev/dsk/c201d3s0 /UPDATE_CDROM # example for SCSI

    ID=3 at an 9000-715

    Or use SAM for that.

    4. Run the menu driven5. /etc/updist6. Change Source or Destination7. From CD-ROM to local system8. Destination /netdist9. Codeword .... .... .... .... # from the HP license sheet10. Hardware ID ddddAnnnnn # entered via ID box

    http://www-aix.gsi.de/~kraemer/COLLECTION/HP9000/syskomp-id-box.htmlhttp://www-aix.gsi.de/~kraemer/COLLECTION/HP9000/syskomp-id-box.htmlhttp://www-aix.gsi.de/~kraemer/COLLECTION/HP9000/syskomp-id-box.htmlhttp://www-aix.gsi.de/~kraemer/COLLECTION/HP9000/syskomp-id-box.html
  • 7/31/2019 HP How tos

    6/8

    11. Select all Filesets

    The installer might ask for the architecture (300/700/800), only one of these can be

    installed in a single updist run. Messages on missing target directories (300/700/800) can

    be ignored.

    Once updist has finished, the contents of the netdist directory (300,700,800,MAIN.*)may be transferred elsewhere.

    12. Start the server daemon with e.g.13. /etc/netdistd -f /netdist/MAIN.pkg -v -c /tmp

    which says that caching should go into /tmp and verbose logging will go into

    /usr/adm/netdist.log. It might be necessary to allow netdistd service in

    /usr/adm/inetd.sec and /etc/services.

    More info with man netdistd

    List software on media

    mount -r -t cdfs /dev/dsk/c201d3s0 /cdrom # CD-ROM @ SCSI ID=3, 9000/715/etc/update -c -s /cdrom

    Dealing with antique software

    Case: old (pre-7.0) Series 300 update media (720kB floppies of 1986 vintage).

    Can't be read by "modern" floppy drives.

    Can't be handled by /etc/update, swlist, et al., comes in Logical Interchange Format (LIF).

    1. Hardware used:o HP 9000 425t (HP-UX 9.1)

    o external HP-IB 9134 compatible disk drive (DD floppy, uses cs80 driver)

    o IB cable

    2. Ensure good working condition:3. SAM - Peripheral devices - View all

    HP-IB devices should be listed with select code 7

    4. Create a floppy image, e.g.:5. dd if=/dev/dsk/c7d0s0 of=pascal.ddimg

    may report

    dd read error: I/O error1544+0 records in1544+0 records out

    but this is probably just "end-of-floppy"

  • 7/31/2019 HP How tos

    7/8

  • 7/31/2019 HP How tos

    8/8

    It might still be possible via VUElite, otherwise use failsafe session or command line login.

    Follow the suggestions of the error message(s), then check proper network setup first. In particular

    IP name resolution defined in /etc/resolv.conf and resolution order, defined in

    /etc/nsswitch.conf, if applicable for the particular HP-UX version.

    Desktop (CDE,VUE) does not start

    Check proper network setup first, in particular IP name resolution defined in /etc/resolv.conf

    and /etc/nsswitch.conf, if applicable for the particular HP-UX version.

    Then check whether one of the following line is enabled* Local local /usr/bin/X11/X :0* Local local@console /usr/bin/X11/X :0

    in one of the following files

    HP-UX 8.x / VUE 2.0: /usr/lib/X11/vue/Vuelogin/Xservers

    HP-UX 9.x / VUE 3.0: /usr/vue/config/Xservers (template in

    /usr/vue/newconfig/Xservers)

    HP-UX >= 10.20 / CDE: /etc/dt/config/Xservers (template in

    /usr/dt/config/Xservers)