Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hp education services education.hp.com 50 LVM Problems Version C.00 H4264S Module 6 Slides.

Similar presentations


Presentation on theme: "Hp education services education.hp.com 50 LVM Problems Version C.00 H4264S Module 6 Slides."— Presentation transcript:

1 hp education services education.hp.com 50 LVM Problems Version C.00 H4264S Module 6 Slides

2 © 2001 Hewlett-Packard Company H4264S C.00 51 LVM — Logical Volume Manager LVM provides: Disk grouping Logical partitioning Ability to span disk drives Bad block replacement Disk mirroring (optional product) Logical Volumes Physical Volume B B S Physical Extent S S SR U R V VV O O O T T T H H H Volume Group B = boot V = var S = swap O = opt R = root T = tmp U = usr H = home

3 © 2001 Hewlett-Packard Company H4264S C.00 52 LVM Disk Layout User Data Area Bad Block Relocation Pool Volume Group Reserved Area LIF Volume Boot Data Reserved Area Physical Volume Reserved Area LIF Header (8 blocks) Physical Volume Reserved Area Volume Group Reserved User Data Area Bad Block Relocation Pool Bootable Disk Non-bootable Disk Area

4 © 2001 Hewlett-Packard Company H4264S C.00 53 Physical Volume Reserved Area (PVRA) The PVRA stores information about the LVM disk configuration (starting addresses and sizes): LVM identification field, signifying the LVM record is present and valid Unique physical volume ID, checked by LVM when it generates new physical volumes Physical volume number Last physical sector number Size of each physical extent on the LVM disk The locations of the other LVM data structures on the disk The start of the user data Physical Volume Reserved Area VGRA User Data Area Bad Block Relocation Pool

5 © 2001 Hewlett-Packard Company H4264S C.00 54 Volume Group Reserved Area (VGRA) The volume group reserved area (VGRA) holds data describing the volume group that contains the disk: Volume Group Descriptor Area (VGDA) –How many LVs are in the VG? –How many PVs are in the VG? –PE to LE mapping Volume Group Status Area (VGSA) –Tracks validity and availability of PVs –Tracks current state of each PE PVRA Volume Group Reserved Area User Data Area Bad Block Relocation Pool

6 © 2001 Hewlett-Packard Company H4264S C.00 55 LVM Repair Tools — Overview Primary Commands: vgcfgrestore vgscan vgexport vgimport Other Commands: lvlnboot ISL> hpux -lm ISL> hpux -lq

7 © 2001 Hewlett-Packard Company H4264S C.00 56 Backing Up and Restoring LVM Configuration Information /sbin/vgcfgbackup /sbin/vgcfgrestore /usr/bin/fbackup /usr/bin/frecover Physical Volume Reserved Area Volume Group Reserved Area User Data Area Bad Block Relocation Pool

8 © 2001 Hewlett-Packard Company H4264S C.00 57 LVM Recovery after Disk Replacement lvol1 lvol2 lvol3 lvol4 lvol5 c2t5d0c2t3d0c2t4d0 lvol1 lvol2 New Disk lvol4 lvol5 c2t5d0c2t3d0c2t4d0 # vgchange -a n /dev/vg02 # vgcfgrestore -n /dev/vg02 /dev/rdsk/c2t4d0 # vgchange -a y /dev/vg02

9 © 2001 Hewlett-Packard Company H4264S C.00 58 Corrupted PVRA/VGRA Structures on the Boot Disk LVM maintenance mode puts the system into single-user mode. LVM maintenance mode is used to repair damaged LVM data structures. ISL> hpux -lm ISL> hpux -lm (56/52.6.0;0)/vmunix If the PVRA or VGRA structures are corrupted, the volume group cannot be activated. A special way to boot the system (LVM maintenance mode) can be used to bypass the normal LVM structures.

10 © 2001 Hewlett-Packard Company H4264S C.00 59 LVM Maintenance Mode The /dev/vg00 volume group is not activated. The root and boot logical volumes are mounted, even though the vg00 volume group is not active. This mode allows the LVM header information to be restored to the boot disk: # vgcfgrestore -n /dev/vg00 /dev/rdsk/c0t6d0 # reboot -n CAUTION: While in LVM maintenance mode, do not bring the system into multiuser mode.

11 © 2001 Hewlett-Packard Company H4264S C.00 60 The LABEL File LABEL File Contains pointers to the starting points and sizes of boot relevant logical volumes. Resides in the LIF volume. Information stored within LABEL is used by the secondary loader to load the operating system. # lifls -l /dev/rdsk/c0t6d0 User Data Area Bad Block Relocation Pool VGRA LIF Volume BDRA PVRA LIF Header (8 blocks) Bootable Disk

12 © 2001 Hewlett-Packard Company H4264S C.00 61 Boot Data Reserved Area (BDRA) The BDRA contains the following records about the system's root logical volumes: Root volume group ID Number of disks in root volume group A list of hardware addresses of the LVM disks in the root volume group Information needed to select the correct logical volumes for boot, primary swap, and dump The operating system uses the information in the BDRA to activate the root volume group and mount the root file system. User Data Area Bad Block Relocation Pool VGRA LIF Volume BDRA PVRA LIF Header (8 blocks)

13 © 2001 Hewlett-Packard Company H4264S C.00 62 Corrupt or Missing LABEL File or BDRA The system will not boot. To recover, the system must be booted into LVM Maintenance mode or to the recovery shell. A command called lvlnboot is needed to fix the problem. If the LABEL file or BDRA is corrupt or missing: User Data Area Bad Block Relocation Pool VGRA LIF Volume BDRA PVRA LIF Header (8 blocks)

14 © 2001 Hewlett-Packard Company H4264S C.00 63 The lvlnboot Command lvlnboot: Used to update a corrupted LABEL file or BDRA with valid data. The syntax of the command is: Examples of the command: # lvlnboot -b /dev/vg00/lvol1 # lvlnboot -r /dev/vg00/lvol3 # lvlnboot -s /dev/vg00/lvol2 # lvlnboot -d /dev/vg00/lvol2 lvlnboot [-b|-r|-s|-d] lvol_name

15 © 2001 Hewlett-Packard Company H4264S C.00 64 Using the Recovery Shell to Repair Damage The recovery shell can also be used to repair a corrupted LABEL file or BDRA. The procedure is: 1.Boot from the support media. 2. From the Recovery menu, select Exit to shell (recovery shell). 3.From the Recovery shell, execute the following commands: “Recovery shell to the rescue” # chroot_lvmdisk # cd /ROOT # chroot /ROOT /sbin/sh # vgchange -a y /dev/vg00 # lvlnboot -b /dev/vg00/lvol1... # reboot

16 © 2001 Hewlett-Packard Company H4264S C.00 65 Booting without Quorum Booting without quorum allows your system to come up when: The root volume group does not meet quorum requirement. The disk containing the root file system is functional. ISL> hpux -is -lq Boot Area lvol1 mirror copies lvol2 lvol3 lvol4 /dev/vg00 Crash! Boot Area

17 © 2001 Hewlett-Packard Company H4264S C.00 66 Recovering an lvmtab File The /etc/lvmtab file: Lists all volume groups and the physical volumes that are associated with each volume group Can be viewed using the strings command Contents used by LVM commands Can be recreated using the vgscan command For example: # mv /etc/lvmtab /etc/lvmtab.back # vgscan -pv # vgscan -v # strings /etc/lvmtab

18 © 2001 Hewlett-Packard Company H4264S C.00 67 Last Resort # vgchange -a n /dev/vg02 # vgexport -m /tmp/mapfile /dev/vg02 # mkdir /dev/vg02 # mknod /dev/vg02/group c 64 0x020000 # vgimport -v -m /tmp/mapfile /dev/vg02 \ /dev/dsk/c3t4d0 /dev/dsk/c4t5d0 # vgchange -a y /dev/vg02 # strings /etc/lvmtab # vgcfgbackup vg02 If the volume group still cannot be repaired, as a last resort, try exporting and importing the volume group:


Download ppt "Hp education services education.hp.com 50 LVM Problems Version C.00 H4264S Module 6 Slides."

Similar presentations


Ads by Google