Você está na página 1de 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 tape mkrs -v -q -tdat -f /dev/rmt/... -r /dev/dsk/... -m700 # make a bootable tape, force series 700 fbackup -0 -i / -f /dev/rmt/...

Backup w/ Copyutil 1. Boot from Support CD (press ESC to interrupt normal boot)
2. 3. ISL> ODE

4. 7.

5. 6. ODE> COPYUTIL

Using fbackup/frecover
frecover -V /tmp/fb.volhd -N -v -f /dev/rmt/0m frecover -r -N -v -f /dev/rmt/0m >/tmp/fb.log 2>&1 frecover -r -X -v -f /dev/rmt/0m into local directory frecover -x -X -i /bin+ -v -f /dev/rmt/0m object into local directory # read backup volume header # lists backup # restores backup tree # extract a specific

Disks
Adding a new disk (filesystem)
HP-UX 9.x Maximum size: 4GB-1k = 4194303.

1. Connect the disk and use SAM or ioscan 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 a 9000/715:
3. mediainit /dev/rdsk/c201d1s0 4. /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/715 3. 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:

lifls /dev/rdsk/c201d1s0

A bootable disk reports something like:


FS EST IOTEST SWAP ODE PERFVER ISL MAPFILE XDIAG AUTO SYSLIB PAD HPUX MAPPER

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 to determine 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 to specify the blocksize. Recipe to copy to disk first, then to tape:
dd if=/dev/rmt/0mn of=install.lif bs=2k rewind dd if=/dev/rmt/0m of=install.tar bs=10k dd if=install.lif of=/dev/rmt/0mn bs=2k rewind dd if=install.tar of=/dev/rmt/0m bs=10k # note: 0mn to suppress # note: 0m to allow rewind # insert copy tape # note: 0mn to suppress # note: 0m to allow rewind

If you have two tape drives:


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

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, blocksizes ! tar tf scratchfile # verify format dd < scratchfile > /dev/rmt/0m ibs=512 obs=10240 # target tape, blocksizes ! tar tf /dev/rmt/0m # verify format mind the proper tar mind the proper tar

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


19742+0 records in 394840+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 <sys/privgrp.h> #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-bit executables 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

Create shared libraries, HP-UX 10.20:


cc -Aa +z ld -o libxxx.sl -b *.o

Force linking against archive libraries, HP-UX 10.20:


cc cc ... -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 /usr/sbin/kmupdate shutdown -r -y now # list of kernel parameters

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 versatile SYSKOMP-ID-BOX may be 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 ID=3 at an 9000-715 # example for SCSI

Or use SAM for that. 4. Run the menu driven


5. /etc/updist 6. Change Source or Destination 7. From CD-ROM to local system 8. Destination /netdist 9. Codeword .... .... .... .... # from the HP license sheet 10. Hardware ID ddddAnnnnn # entered via ID box

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.: may report
dd read error: I/O error 1544+0 records in 1544+0 records out 5. dd if=/dev/dsk/c7d0s0 of=pascal.ddimg

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

6. Access the software:


7. lifls -l /dev/dsk/c7d0s0 # list filesets on IB floppy 8. lifcp -r /dev/dsk/c7d0s0:A98518A - | cpio -idumvx # example to extract to current directory

Troubleshooting
SAM responds with SAM task controller initialization failed. rc = 1402 message Further symptom: SAM is very slow and refuses most tasks, leaving it essentially useless. This problem and its confusing message may be due to the system's date earlier than some SAM files'.
touch /usr/sam/lib/*/*.LL

solved the problem for me. See also SAM's error log, /usr/sam/log/samlog, for more information. Maximum number of processes per user exceeded (can't fork etc.). Use SAM to modify the maxuprc parameter (e.g. to 256). This parameter is dynamic (i.e. doesn't require reboot) on HP-UX 11.x. Programs running out of memory Use SAM - Kernel Configuration to modify the maxdsiz parameter (e.g. from 67108864 to 268435456, i.e. from 64 to 256MB). This parameter is static (i.e. a kernel rebuild/reboot will follow) on HP-UX 11.0. file: table full Increase kernel parameter nfile. I chose to change nproc: (20+8*MAXUSERS) => (20+16*MAXUSERS) Root password lost 1. During boot press ESC to get into boot admin menu 2. Select single user mode (admin, monitor, etc., model dependent)
3. boot pri isl 4. ISL> hpux -is 5. passwd root to change root password

Can't login via VUE/CDE

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)

Você também pode gostar