Replace a failed vg00 disk

As long as a server utilizes hot-swappable hard drives and all logical volumes in vg00 are properly mirrored, there are three possible scenarios and associated required courses of action I have run into.

1)  PA-RISC server running HP-UX 11.00 or 11.11 without the OLAR patches for LVM and the kernel.

# for i in `vgdisplay -v vg00 | awk 'BEGIN{ ORS=" " }{ if ($0 ~ /LV Name/) print $3 }'`; do lvreduce -m 0 $i /dev/dsk/FAILED_DISK; done
# vgreduce vg00 /dev/dsk/FAILED_DISK

Replace disk
# ioscan -fnC disk
# insf
# pvcreate -B /dev/rdsk/FAILED_DISK
# vgextend vg00 /dev/dsk/FAILED_DISK
# mkboot /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/GOOD_DISK
# for i in `pvdisplay -v /dev/dsk/GOOD_DISK | grep 'current.*0000 $' | awk 'BEGIN{ ORS=" " }{ print $3 }'`; do lvextend -m 1 $i /dev/dsk/FAILED_DISK; done
# lifls /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/FAILED_DISK
# vgdisplay -v /dev/vg00
# setboot

2) PA-RISC server running HP-UX 11.11 with the OLAR patches or greater.

# pvchange -a N /dev/dsk/FAILED_DISK
Replace disk
# ioscan -fnC disk
# vgcfgrestore -n vg00 /dev/rdsk/FAILED_DISK
# pvchange -a y /dev/dsk/FAILED_DISK
# mkboot /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/FAILED_DISK
# setboot

3) Itanium server

# pvchange -a N /dev/dsk/FAILED_DISK
Replace disk
# ioscan -fnC disk
# echo "3
HPUX 100%
HPSP 400MB" > /tmp/pdf
# idisk -f /tmp/pdf -w /dev/rdsk/FAILED_DISK
# idisk /dev/rdsk/FAILED_DISK
# vgcfgrestore -n vg00 /dev/rdsk/FAILED_DISK
# pvchange -a y /dev/dsk/FAILED_DISK
# mkboot -e -l /dev/rdsk/FAILED_DISK
# echo "boot vmunix -lq" > ./AUTO
# efi_cp -d /dev/rdsk/FAILED_DISK ./AUTO /efi/hpux/auto
# lvlnboot -R /dev/vg00
# lvlnboot -v

For more information:
HP-UX: When Good Disks Go Bad


Find RAM information in HP-UX

This will print out all sorts of information regarding RAM, including how many DIMMs you have, what size they are, and where they are plugged in. It will even print information about the Page Deallocation Table (PDT).

# echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

Forward X over SSH through an intermediary host

One of the many useful features of SSH is X forwarding, which allows you to run a program on a remote host and have the GUI for that application display on your workstation as if it were running locally.  But what if you need to run a program on host2, which is only accessible through an intermediary host, host1?

SSH’s ability to forward arbitrary ports to the rescue!

First, log into host1 with X forwarding enabled:

$ ssh -X user@host1

Next, from host1, log into host2 as such:

$ ssh -R 9000:localhost:9000 user@host2

Reset failed login counter on AIX

Check account status
# lsuser <user>

Reset failed login counter
# chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s <user>

Fail over a ServiceGuard package

# /usr/sbin/cmviewcl
# /usr/sbin/cmhaltpkg <pkg name>
# /usr/sbin/cmrunpkg -n <node> <pkg name>
# /usr/sbin/cmmodpkg -e <pkg name>
# /usr/sbin/cmviewcl

Remove an old STD/BCV pair from a Timefinder device group

# symmir –g <Device group> cancel <STD device name> BCV ld <BCV device name>
# symbcv –g <Device group> disassociate dev <BCV device ID>
# symld –g <Device group> remove <STD device name>

Resetting a lost root password on RHEL 4

Step 1: At the console, press Ctrl-Alt-Del. This should initiate a semi-graceful reboot.

Step 2: After the OS is down, the system will start to reboot.

Step 3: Once BIOS stuff is done, the GRUB screen will appear for a couple of seconds. Press any key at this screen to interrupt the boot process.

Step 4: If you interrupt the process in time, you will be presented with a menu. Highlight the top option and press E.

Step 5: Highlight the line that starts with “kernel” and press E to edit that line.

Step 6: Add the word “single” to the end of the line.

Step 7: Hit Enter. That will take you back to the previous screen. Hit B to boot. This will start the boot process into single user mode.

Step 8: Once the OS is up in single user mode, you will be presented with a prompt.

Step 9: At this prompt, use the “passwd” command to change the root password. After this is done, use the “reboot” command to reboot.

Step 10: The system should boot back into normal mode with the new root password.