Operating System - HP-UX
1752661 Members
5959 Online
108788 Solutions
New Discussion юеВ

Re: recovery procedure + lvm

 
pbraun
Advisor

recovery procedure + lvm

Hi,

I'm wondering, how to mount the logical volumes from the Install Media recovery shell. I wasn't able to load e.g. "vgchange" from HP-UX CORE MEDIA SYSTEM RECOVERY :
MAIN MENU > s. Search for a file : vgchange
gives
**** The file 'vgchange' was not found in the SYSCMDS archive. ****

LVM is used by default when installing HP/UX. Why isn't LVM mentioned in the Recovery Procedure ?
http://docs.hp.com/en/5992-6584/apes02.html

Thanks...
10 REPLIES 10
R.K. #
Honored Contributor

Re: recovery procedure + lvm

Hi..

What commands did you use?

Have you tried do this:

1) loadfile chroot
2) chroot /ROOT /sbin/sh
3) vgchange -a y /dev/vg00
4) fsck -p
5) mount -a

Regds..

Don't fix what ain't broke
pbraun
Advisor

Re: recovery procedure + lvm

Hi RK,

I used those commands/procedure :
- Boot with HP/UX 11iv3 install DVD
- Run an Expert Recovery Shell
- Would you like to startup networking at this time? NO
... entering HP-UX CORE MEDIA SYSTEM RECOVERY
- r. Recover an unbootable HP-UX system

INFORMATION to verify:
Device file used for '/'(ROOT) is c0t0d0.
The hardware path to disk is 0/0/0/0.0x0.0x0.

this obviously won't work. Not an LVM path, not even a slice. And if I continues, it tries to fsck /dev/rdsk/c0t0d0. Not good

RK, following your procedure,
loadfile chroot ==> OK
chroot /ROOT /sbin/sh ==> how could I chroot into /ROOT if there's none ? I need to mount the logical volumes first, before chroot in it.

Thanks

sujit kumar singh
Honored Contributor

Re: recovery procedure + lvm

hi


what does loadfile vgchange suggest?
regards
sujit
R.K. #
Honored Contributor

Re: recovery procedure + lvm

May be this will clear things more.

# loadfile /sbin/fs/vxfs/mount /sbin/fs/vxfs/fsck
# /sbin/fs/hfs/fsck /dev/vg00/rlvol1
# /sbin/fs/vxfs/fsck -o full /dev/vg00/rlvol3

# mkdir /ROOT
# /sbin/fs/vxfs/mount /dev/vg00/lvol3 /ROOT
# /sbin/fs/vxfs/mount /dev/vg00/lvol1 /ROOT/stand
# /sbin/fs/vxfs/mount /dev/vg00/lvol4 /ROOT/opt
# /sbin/fs/vxfs/mount /dev/vg00/lvol5 /ROOT/tmp
# /sbin/fs/vxfs/mount /dev/vg00/lvol6 /ROOT/usr
# /sbin/fs/vxfs/mount /dev/vg00/lvol7 /ROOT/home
# /sbin/fs/vxfs/mount /dev/vg00/lvol8 /ROOT/var

/ROOT should now represent your original file system layout. you should confirm that the logical volumes are mounted to the correct mount points. Then, you may chroot(1M) into /ROOT if needed.

# loadfile chroot
# cd /ROOT
# chroot /ROOT /sbin/sh

Please remember that your system is currently booted using a generic recovery kernel.
This kernel may be incompatible with executables that reside inside your root VG. Never try to bring the system up to Multi User Mode from this state! Even basic LVM or VxFS commands are known to make trouble under such conditions.
Don't fix what ain't broke
R.K. #
Honored Contributor

Re: recovery procedure + lvm

>># /sbin/fs/hfs/fsck /dev/vg00/rlvol1

Obviously not hfs. Mistake in last thread.
Don't fix what ain't broke
pbraun
Advisor

Re: recovery procedure + lvm

Thanks for your help RK, but there's no /dev/vg00 directory available from the Recovery Shell. Therefore I can't fsck nor mount the logical volumes.

I'm booting with the VSOE 11iv3 sept 2008 install media, DVD1. And it's an HPVM virtual machine but that shouldn't matter. I tried with other VM guests, no changes : no LVM.

Should I use another system recovery ? Are there any ?
pbraun
Advisor

Re: recovery procedure + lvm

Hi Sujit,

sorry I didn't saw your post at first. Indeed "loadfile vgchange" works ! I came much further, I'm now stuck at the fsck/mount step (see below).

Load the LVM tools,
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

Search and check the PV,
ioscan -fnkCdisk
pvck /dev/dsk/c0t0d0s2
gives,
pvck: using default blocksize
pvck: /dev/dsk/c0t0d0s2: LVM checksums usable

Import the VG,
vgimport vg00 /dev/dsk/c0t0d0s2
ls -l /dev/vg00
gives,
Creating "/etc/lvmtab".
Creating "/etc/lvmtab_p".
vgimport: Volume group "/dev/vg00" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
Also, upon first activation of an imported bootable volume group, make
sure to run lvlnboot(1M) command in recovery mode (-R option) to resync
the information on the disk

Load the VxFS tools and check for the LV,
loadfile /sbin/fs/vxfs/fsck /sbin/fs/vxfs/mount
ls -l /dev/vg00/rlvol8 /dev/vg00/lvol8
gives,
brw-r----- 1 root sys 64 0x000008 Nov 11 23:52 /dev/vg00/lvol8
crw-r----- 1 root sys 64 0x000008 Nov 11 23:52 /dev/vg00/rlvol8
fsck,
/sbin/fs/vxfs/fsck /dev/vg00/rlvol8
gives,
vxfs fsck: V-3-20003: Cannot open /dev/vg00/rlvol8: No such device or address
file system check failure, aborting ...
Note. /dev is a symlink to /RAMFS1/dev, but that doesn't matter

Any more hints to finish up that LVM recovery procedure ?

Thanks
pbraun
Advisor

Re: recovery procedure + lvm

I just forgot to enable the VG :-)

works !!!

here's the update :

Import and enable the VG,
vgimport vg00 /dev/dsk/c0t0d0s2
ls -l /dev/vg00
vgchange -a y vg00

Load the VxFS tools and look for the LVs,
loadfile /sbin/fs/vxfs/fsck /sbin/fs/vxfs/mount
ls -l /dev/vg00/rlvol8 /dev/vg00/lvol8
vgdisplay -v
note. /dev is a symlink to /RAMFS1/dev, but that doesn't matter
fsck,
/sbin/fs/vxfs/fsck -y -o full /dev/vg00/rlvol3
/sbin/fs/vxfs/fsck -y -o full /dev/vg00/rlvol1
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol4
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol5
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol6
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol7
/sbin/fs/vxfs/fsck -y /dev/vg00/rlvol8
note. don't fsck the "rlvol2" swap
mount,
mkdir /ROOT
/sbin/fs/vxfs/mount /dev/vg00/lvol3 /ROOT
/sbin/fs/vxfs/mount /dev/vg00/lvol1 /ROOT/stand
/sbin/fs/vxfs/mount /dev/vg00/lvol4 /ROOT/opt
/sbin/fs/vxfs/mount /dev/vg00/lvol5 /ROOT/tmp
/sbin/fs/vxfs/mount /dev/vg00/lvol6 /ROOT/usr
/sbin/fs/vxfs/mount /dev/vg00/lvol7 /ROOT/home
/sbin/fs/vxfs/mount /dev/vg00/lvol8 /ROOT/var

Thank you both !
pbraun
Advisor

Re: recovery procedure + lvm

There are errors in my last post on the lv paths to mount the filesystems : I inverted some LVs versus mount points. It's easyer and probably safer to mount '/' only, chroot in it and then "mount -a" as suggested by RK in the second post of the current thread.

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

loadfile chroot
chroot /ROOT /sbin/sh

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

cd /etc
cat fstab
mount -a
bdf

The full procedure on my documentation web site :
http://pbraun.nethence.com/doc/sysutils_hpux/hpux_lvm_recovery.html

Thanks again