this is obsolete doc -- see http://doc.nethence.com/ instead

HP/UX 11iv3 LVM recovery procedure 

 

 

Introduction 

LVM is used by default nowerdays, when installing HP/UX. But LVM still isn't mentioned in the official Recovery Procedure (http://docs.hp.com/en/5992-6584/apes02.html). Here's the catch ! 

 

Note. using 11iv3 ioscan -fnkC (old school /dev/dsk, not /dev/disk, eventhough we're using Integrity) 

 

 

Get to the Recovery Shell 

Boot with your HP/UX 11iv3 install DVD and preferably the exact same version you used for system installation. Then choose, 

Run an Expert Recovery Shell
Would you like to startup networking at this time? NO
x.  Exit to shell

Note. in case you need to get back to that menu, type "menu", not "exit" 

 

 

Mount the root filesystem 

Load the LVM tools, 

loadfile lvm_wrapper pvck vgimport vgexport vgchange vgdisplay lvmcmd

Note. to load as much possible about LVM (unneeded), 

#loadfile lvchange lvcreate lvdisplay lvextend lvlnboot lvm_wrapper lvmcmd lvreduce lvremove lvrmboot vgchange vgcreate vgdisplay vgexport vgextend vgimport vgreduce vgremove vgscan pvchange pvck pvcreate pvdisplay pvmove

Note. those won't load (not found) : lvmadm lvmerge lvmpcmd lvmrc lvsplit lvsync vgmodify pvremove 

 

Search and check the PVs, 

ioscan -fnkCdisk
pvck /dev/dsk/c0t0d0s2

Note. you need to have access to all VG's the physical volumes to get Quorum and import the VG. 

Note. we prefer old school /dev/dsk path, not /dev/disk 

 

Import and enable the VG, 

vgimport vg00 /dev/dsk/c0t0d0s2
ls -l /dev/vg00
vgchange -a y vg00
vgdisplay -v

Note. /dev is a symlink to /RAMFS1/dev, but that doesn't matter 

Note. if you forget to enable the VG, you'll get a "Cannot open /dev/vg00/rlvol3: No such device or address" when trying to fsck it. 

 

Load the VxFS tools, 

loadfile /sbin/fs/vxfs/fsck /sbin/fs/vxfs/mount

 

Check the root filesystem and mount it, 

ls -l /dev/vg00/rlvol3 /dev/vg00/lvol3
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol3
mkdir /ROOT
/sbin/fs/vxfs/mount /dev/vg00/lvol3 /ROOT

Note. you may add "-o full" to the fsck command 

 

 

Chroot in it and mount the rest 

Get into the system, 

loadfile chroot
chroot /ROOT /sbin/sh

 

Check the remaining filesystems, 

cd /etc
cat fstab
fsck -y /dev/vg00/rlvol1
fsck -y /dev/vg00/rlvol4
fsck -y /dev/vg00/rlvol5
fsck -y /dev/vg00/rlvol6
fsck -y /dev/vg00/rlvol7
fsck -y /dev/vg00/rlvol8

note. 'rlvol3' is already mounted 

note. don't check the 'rlvol2' swap 

mount it all, 

mount -a
bdf

 

Setup your environment, 

/usr/local/bin/bash
export HOME=/home/root
cd ~/

 

Make LVM work properly inside the chroot, 

cd /etc
rm -f lvmtab
vgscan

 

 

Fix things on Integrity 

Check the partition table, 

ll /dev/rdsk
idisk -p /dev/rdsk/c0t0d0

install EFI utilities, 

/sbin/fs/fsdaemon -f 0 -w &
ps -ef | grep fsdaemon
mkboot -lcv /dev/dsk/c0t0d0
mkboot -el /dev/dsk/c0t0d0

install boot programs on device, 

mkboot -l /dev/rdsk/c0t0d0

configure autoboot, 

mkboot -a "boot /stand/vmunix" /dev/rdsk/c0t0d0

check, 

efi_ls -d /dev/dsk/c0t0d0s1
efi_ls -d /dev/dsk/c0t0d0s1 EFI/HPUX
efi_cp -u -d /dev/dsk/c0t0d0s1 EFI/HPUX/  AUTO /tmp
cat /tmp/AUTO
rm -f /tmp/AUTO
lifls -C /dev/dsk/c0t0d0s2

note. EFI is in slice 1 

note. LIF is in slice 2 

note. "mkboot -l" for LVM 

 

Define a primary boot device, 

ioscan -fnkCdisk
setboot -p 0/0/0/0.0.0 -b on

check, 

setboot

 

Update the BDRA (Boot Data Reserved Area) on bootable PVs, recover missing links to logical volumes, 

lvlnboot -R

define root, boot, swap and dump volumes, 

lvlnboot -r /dev/vg00/lvol3
lvlnboot -b /dev/vg00/lvol1
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2

check, 

lvlnboot -v

note. carefull, only run lvlnboot -R before -b as the former removes the boot lv config. 

 

Generate "/stand/rootconf" for maintenance mode, 

lvlnboot -c

check, 

ll /stand/rootconf

 

Sync and reboot, 

sync
cd /
reboot

Note. using "reboot" directly instead of "shutdown" since we're in recovery mode 

 

 

References 

http://sl-workstations.web.cern.ch/sl-workstations/documentation/SAGpart-4.html