Thursday, 24 November 2011

Recover OS using Ignite Backup

HP-UX have a software to backup the OS called "Ignite". It bundled with OS installed. The easy way to make a OS backup is using tape data cartridge. Just plug the tape to tape library, and run command "make_tape_recovery -AI".

To restore OS using recovery tape, go to MP (management processor) and boot to tape (Sequential media) and follow the intructions.

To simplify manage the archive of OS backup, we can utilize "Ignite Server". We can make OS backup to disk (via network) in another server (Ignite Server).The command is "make_net_recovery -s ignite_server -x inc_entire=vg00″.

To recovery OS using ignite server (Client and Ignite server in same IP subnet):

1. Boot the failed system to Ignite server (boot lan install or boot lan.ip_ignite_server install)
2. Do not interact with ISL
3. Select "Install HP-UX" and follow the instructions to fill about server configurations (network, hostname, etc)

4. Select recovery configurations to use
If clients to use is different subnet, we must use a boot helper server. the boot helper server have same subnet with client server. to setting up boot helper:

* for example: IP Ignite server is 10.2.2.1 & GW 10.2.2.254, OS to be restored is restore01 and target client is client01 (10.2.3.1 & GW 10.2.3.254)

1. Make sure the boot helper server have Ignite software with same version with client & Ignite server
2. Point the installation to Ignite server
# instl_adm -t 10.2.2.1
3. To verify the correct configuration in boot helper, run command instl_adm -d
4. Specify the temporary ip address at boot helper that client can use to boot. Edit /etc/opt/ignite/instl_boottab

5. Copy the CINDEX & recovery directory from source (OS to be restored) to target client (server use to restore).
at Ignite Server:
# cd /var/opt/ignite/clients/restore01
# find CINDEX recovery | cpio -pvdma ../client01
# edit CINDEX file at target client (/var/opt/ignite/clients/client01/CINDEX)
- make a full path for system_cfg, control_cfg & archive_cfg. (/var/opt/ignite/clients/client01/../…..)

6. Boot to boot helper or direct to ignite server

Add SWAP in HP Unix : How to ?

How to add SWAP in hp Unix

To create swap, you need a contiguous space on a disk/LUN.
Create vg01:

pvcreate /dev/rdsk/c25t0d0
pvcreate /dev/rdsk/c25t2d0
vgcreate -s 8 -p 128 /dev/vg01 /dev/dsk/c25t0d0 /dev/dsk/c25t2d0
vgchange -a y /dev/vg01

lvcreate -C y -L 16384 -n lvswap /dev/vg01

/usr/sbin/swapon -f -p 3 /dev/vg01/lvswap

add to /etc/fstab:

/dev/vg01/lvswap … swap pri=3 0 0

Unix- LVM commonly asked Interview questions..

Regular tasks
I) How to create a Volume Group (VG).
II) How to create a Logical Volume (LV) and mount the file system.

III) How to add a disk to a Volume Group
IV) How to increase the size of a logical volume without OnlineJFS
V) How to remove a Logical Volume
VI) How to reduce the size of a logical volume without OnlineJFS (advanced JFS)
VII) How to remove a disk from a volume group
VIII) How to remove a volume group
IX) How to increase the primary swap
X) How to create a secondary boot disk LVM Mirroring
XI) How to mirror a logical volume

How to relate a failing disk(lun) with its remote port (nport_id)

This is only for legacy HDW paths.

After a problem we had today with our SAN, we where loosing link(milisenconds) to only 1 path
of the four we have:

LVM: Performed a switch for Lun ID = 0 (pv = 0x00000000c0f9c000), from raw device 0x1f170600 (with priority: 0, and current flags: 0x40) to raw device 0x1f0f0600 (with priority: 1, and current flags: 0x0).

from syslog we get the raw device major/minor numer: 0x1f170700

With the minor we get to know our disk:
root:/> ls -l /dev/dsk | grep 170700
brw-r----- 1 bin sys 31 0x170700 May 4 2010 c23t0d7

From the disk the HDW path:
root:/> lssf /dev/dsk/c23t0d7
sdisk card instance 23 SCSI target 0 SCSI LUN 7 section 0 at address 0/0/4/0/0.97.11.19.24.0.7 /dev/dsk/c23t0d7

From the HDW path the san(port info)
0/0/4/0/0 ---> HBA
97.11.19 ---> san(n_port id) info
24.0.7 ---> scsi target lun

Now we need to convert these numers into hex 97.11.19:

97 -> 61
11 -> 0b
19 -> 13

And finally with fcmsutil we can find the nport id using our hex conversion 610b13:
root:/> fcmsutil /dev/td0 get remote all | grep -e 610b13 -e Port
Target N_Port_id is = 0x610b13
Port Type = N_PORT
Target Port World Wide Name = 0x50050763030846e2

So Now you can tell your SAN admins which is the wwn of the failing port.

Check Failed stats:
root:/> fcmsutil /dev/td0 devstat all | grep -E '(Nport|Failed)'
Device Statistics for Nport_id 0x610b13
Failed Open of previously opened device 6
Device Statistics for Nport_id 0x613713
Failed Open of previously opened device 5
Device Statistics for Nport_id 0x750b13
Failed Open of previously opened device 6

Bootup/Shutdown in HP unix

shutdown -r 0 –> reboot
shutdown -h now –> shutdown and halt
shutdown 0 –> shutdown to single user mode
reboot 0 –> reboot
init 1 – single user mode
hpux -is boots single user mode

1. Interupting the boot process:
a. Configuration Menu
b. Information Menu
c. Service Menu

2. GSP Mode
a. From the console hit
b. Hit at the GSP console login (default is no password)
c. Now low level commands can be entered
ps –> power status

To reboot to single user mode:

1. shutdown -r 0
2. hit during 10 sec window to interrupt reboot
3. enter:
4. interact with ipl? yes
5. hpux -is (i=init, s=single user)

Configure disk to use for veritas volume manager (VxVM)

1. Detect new disk -> dfsadm, cfgadm -c configure control_number
2. Labeling disk -> format, choose disk number, label
3. Configure disks
# vxdisksetup -i disk_name
or using vxdiskadm -> choose 1. Add or initialize one or more disks
4. make diskgroup
# vxdg init dg_name disk_name=device_name
* vxdg init backupdg backupdg01=Disk_24
5. make volume
# vxassist -g backupdg maxsize
2096883712
# vxassist -g backupdg make backuplv 2096883712
*size=output from vxassist -g dg_name maxsize
6. Start volume
# vxvol -g backupdg startall
7. Make Filesystem
# mkfs -F vxfs /dev/vx/rdsk/backupdg/backuplv
8. Mounting Filesystem
# mkdir /backup
# mount -F vxfs /dev/vx/dsk/backupdg/backuplv /backup
9. Edit /etc/vfstab

Verify the latest standard patch bundles

HP-UX 11i v1
# swlist -l bundle BUNDLE11i HWEnable11i GOLDBASE11i GOLDAPPS11i

HP-UX 11i v2
# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE QPKAPPS

HP-UX 11i v3
# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE

Verify latest available patches

After installing the latest standard patch bundles, that are delivered on a six month schedule, you need to check for the latest available patches for your products. Using any of the available tools to perform patch assestments of your systems will give you detailed information on the patches available.