Structure information of HPUX LVM

Source: Internet
Author: User
The structure information of hpux lvm is abbreviated as follows:
1. VG
Volume Group
2. lv
Logical volume
3. PV
Physical Volume
4. PVG
Physical volume group
5. pe
Physical extent
6. Le
Logical extent
7. FS
File System
8. vgra
Volume group reserved area
9. vgda
Volume group descriptor Area
10. vgsa
Volume group status area
11. MCR
Mirror consistency record
12. pvra
Physical volume reserved area
13. bdra
Boot data reserved arealvm structure information
The structure information of LVM is stored in the reserved area (pvra, vgra) Starting with each LVM hard disk. This area is called the LVM header ). The following figure shows the structure of the LVM Disk:
1. Non-boot disk
| ---------------- |
| Pvra |
| ---------------- |
| Vgra |
| ---------------- |
|
|
|
| User data |
|
|
|
| ---------------- |
| Bad block pool |
| ---------------- |
2. BOOT disk
| ---------------- | -----
| LIF header |/
| ---------------- |/
| Pvra |/
| ---------------- |/
| Bdra | -- & gt; 2912 K
| ---------------- |/
| LIF volume |/
| ---------------- |/
| Vgra |/
| ---------------- | -----
|
|
|
| User data |
|
|
|
| ---------------- |
| Bad block pool |
| ---------------- |
Note:
A. the LVM header on the boot disk is always 2912kb. For non-boot disks, the LVM header size is not fixed. It depends on the configuration parameters PVS/VG (-P max_pv), PES/PV (-e max_pe), and LVS/VG (-l max_lv) of VG, but in general, the LVM header size of a non-boot disk is always smaller than that of the boot disk. In addition, the vgra of VG must not be larger than the size of a separate block.
B. The itanium systems System (ux11.20, 11.22, 11.23) has a MB EFI zone at the beginning of the hard disk. For details about this part, refer to the relevant chapters of the anteng system.
Pvra, bdra, and vgra
1. pvra
Pvra is unique for each PV in VG, including:
<1> lvmrec describes PV with PV-ID, VG-ID, PV quantity in VG, PE size; vgra, bdra (if any), bbdir, the start point and space size of the user data and bad block pool. If serviceguard cluster is configured, information about the cluster ID and cluster lock area is also included.
<2> bbdir (Bad Block directory, used to maintain bad block pool information)
2. bdra (generated only when the pvcreate-B command is used) contains the startup information, for example:
<1> Start PVS information in VG
<2> boot/SWAP/root LVS (Major/minor numbers, etc.) Information
3. For any PV in the same VG, vgra is the same, including:
<1> vgda uses the following information to describe VG:
A. VG-ID, limited max_lv, max_pv, max_pe
B. Information of each LV: LV flags, size, schedule strategy, number of mirrors, Stripes, stripe size, etc.
C. Each PV information: PV-ID, PV size, PV flags, extent mapping, etc.
<2> vgsa contains the missing PVS information (missing PVs) and stale extents information.
<3> mcrs is used to process mirror write cache handling.
Lif header and LiF volume (LIF volume)
Lif is the abbreviation of logical interchange format. For each boot disk, the LIF header occupies the 8kb space at the beginning of the hard disk. It contains the directory of the LIF volume (LIF volume) located after bdra. You can use the lifls (1 m) command to display:
# Lifls-L/dev/rdsk/c1t6d0
Volume isl10 data size 7984 directory size 8
Filename type start size implement created
========================================================== ======================================
ISL-12800 584 306 0 00/11/08 20:49:59
Auto-12289 896 1 0 00/11/08 20:49:59
HPUX-12928 904 848 0 00/11/08 20:50:00
Pad-12290 1752 1580 0 00/11/08 20:50:00
Label bin 3336 8 0 99/10/08 02:48:02
Lif volume (LIF volume) contains the files required for starting: isl, HPUX, label, and auto (for automatic boot ). You can view the relevant sections of the Guide to obtain the detailed description of the LIF file.
PV-ID and VG-ID
Any PV has a unique 8-bit (byte) Long identifier, Which is PV-id. The VG-ID is the only PV that belongs to the VG, and it is also 8-bit long. They are all stored in pvra. You can use the LVM command to display the complete LVM header:
# LVM-p-D/dev/rdsk/c1t2d0 | more
......
......
/* The physical volume ID. */2000252410 965817345
I. e. pvcreate (1 m) was run on CPU with ID 2000252410 At Wed Aug 9
12:35:45 2000
/* The volume group ID. */2000252410 965817462
I. e. vgcreate (1 m) was run on CPU with ID 2000252410 At Wed Aug 9
12:37:42 2000
......
If LVM commands are not available in a HP-UX version, you can also use the commands that any HP-UX system can use to read PV-ID and VG-ID
1. Use the XD (1) command to get PV-ID and VG-ID
# XD-j8200-n16-tu/dev/rdsk/c1t2d0
0000000 2000252410 965817345 2000252410 965817462
PV CPU-ID PV timestamp VG CPU-ID VG timestam
You can see the following information from the above information:
<1> pvcreate and vgcreate run on a system with the systemid (uname-I) of 2000252410.
<2> the timestamp (timestamp) of pvcreate execution is 965817345 (seconds after Jan 1st 1970 UTC)
<3> the timestamp of vgcreate execution is 965817462 (117 seconds later)
2. Use the ADB (1) command to get PV-ID and VG-ID
<1> Get PV-ID
# Echo "0d8200? Uy "| ADB/dev/DSK/c1t2d0
2008: 2000252410 2000 Aug 9 12:35:45
<2> Get VG-ID
# Echo "0d8208? Uy "| ADB/dev/DSK/c1t2d0
2010: 2000252410 2000 Aug 9 12:37:42
Vgcfgbackup (1 m)
A copy of the LVM header is stored in the file system (/etc/lvmconf/*. conf ). Any changes to the LVM structure, such as lvcreate, lvchange, and vgextend through LVM commands, will automatically call the vgcfgbackup (1 m) command to save the changes once.
You can also run the vgcfgbackup (1 m) command at any time to save it manually:
# Vgcfgbackup vgxy
Volume group configuration for/dev/vgxy has been saved in/etc/lvmconf/vgxy. conf
The saved file is binary, but you can also use the-L option of vgcfgbackup to display the hard disk contained in VG:
# Vgcfgbackup-l-N vgxy
Volume group configuration information in "/etc/lvmconf/vgxy. conf"
VG name/dev/vgxy
---- Physical volumes: 1 ----
/Dev/rdsk/c1t6d0 (bootable)
If the LVM header is mistakenly written or crashed, you can use the vgcfgrestore command to restore the information.
Generally, when a hard disk breaks down, you can run the vgcfgrestore command to write the backup information back to the New Hard Disk:
# Vgcfgrestore-N vgxy/dev/rdsk/c1t6d0
Volume group configuration has been restored to/dev/rdsk/c1t6d0
Note:
A. If you have modified the LVM configuration and do not want to update the backup file, you can use commands related to LVM to connect to the "-a n" parameter. The previous configuration can be found in/etc/lvmconf/*. conf. Old.
B. vgcfgrestore does not restore the LIF volume (LIF volume), which must be restored using the mkboot command.
/Etc/lvmtab and vgscan (1 m)
The/etc/lvmtab file contains all the vgs used and the PVS information they contain. Vgchange (1 m) is used to activate VG. Lvmtab is a binary file. However, you can use the strings (1 m) command to display the content:
# Strings/etc/lvmtab
/Dev/vg00
/Dev/DSK/c2t0d0
/Dev/vgsap
/Dev/DSK/c4t0d0
/Dev/DSK/c5t0d0
/Dev/DSK/c4t1d0
/Dev/DSK/c5t1d0
/Dev/vg01
/Dev/DSK/c6t0d0
Note: This is only the "visible part" of the lvmtab file ". It also contains VG-IDs, all vgs, and the number and status of PVS in each VG. Additional strange characters printed by the strings command can be considered unimportant and ignored.
All vgs in lvmtab will be automatically activated when the system starts. The script is/sbin/lvmrc, and the related configuration file is/etc/lvmrc.
If you think the lvmtab information is no longer reliable, you can use the vgscan (1 m) command to regenerate the file. However, we recommend that you back up the file before doing so:
# Cp/etc/lvmtab/etc/lvmtab.20060226
# Vgscan-V
You can ignore all warning messages.
Note:
A. If you directly use vgscan to create a new lvmtab file without deleting lvmtab, whether the file is successful depends on the file content. Of course, you can also delete the lvmtab file and then use the vgscan command to generate a new one. However, note that, in this case, the activated VG is not included in the new file.
B. In the system with serviceguard configured, vgscan may fail. You can install patches to solve the problem. Alternatively, you can delete the/dev/slvmvg file before using the vgscan command.
C. When the system is using data replication products, such as businesscopy/XP, continousaccess/XP, EMC srdf, or EMC timefinder, vgscan may add some unexpected PVS in vgs
D. vgscan does not pay attention to the optional path (alternate links). It is likely to switch the path (refer to the relevant chapter of "PV links) [/td] [/tr] [/table] [/td] [/tr] [/table] In vgda (volume group discriptor Area) what is the result of setting a large max_pe value using the vgcreate command on XX? Because a small value or the default max_pe value will usually limit adding a large disk to the volume group in the future, it is best to set max_pe To a large number? Vgda grew by an order of magnitude. What is the result of setting max_pe to a greater limit? In the past, this parameter was used to set the PE size. The maximum PV value is maxpeperpv. The default value is 4 MB, the maximum number of PES multiplied is 65535 (65535*4 = 262140m, or 256 GB). The disk size is a GB hard disk. in LVM, a PV (physical volume, physical volume) corresponds to only one physical hard disk, and one or more PVS form one VG (volume group, volume group ), from a VG, several LV (logical volume) can be virtualized. The real file system is created on the LV and the file system can be built on the LV, you can also directly use it without creating a file system, which is called a raw device ). Because data is read and written directly to the device, the raw device performs better than the file system. Many database systems are directly stored on bare devices, but the manageability is poor.
How does the LVM system know the actual hard disk to which data is stored in a certain LV? In an LVM system, a PV is composed of several PEs (physical extent), and an LV is composed of several le (logical extent, the PE and Le have a direct correspondence relationship, which is stored in a table called "PE/Le ing table. The translation table is stored on the LVM disk and loaded into the memory only when the VG is activated. PE is created when a volume group is created. The size is specified by the-S parameter of vgcreate. The default value is 4 MB. The PE size of all PVS in the same VG is the same, regardless of whether the actual disk size and model are the same. When a LV is created, the LVM system creates a Le and automatically maintains the corresponding PE/le table, so that the Le in each LV can find the corresponding PE, to know which hard disk the data should be written. Generally, when creating an LV, the system allocates its available PV in the order that the physical hard disk is attached to the VG. For example, c0t5d0 is the first hard disk to be attached to VG. By default, the available PVS in c0t5d0 will be used for allocation, unless otherwise specified when the lvextend command is used.
When the-S parameter of vgcreate is used, the PE size must be an integer multiple of 2. Generally, the default value is 4, this indicates that all logical volumes created on the volume group are expanded or reduced in 4 MB increments. Because of the kernel, the PE size determines the maximum size of the logical volume. The 4 mb pe determines that the maximum size of a single logical volume is 256 GB, if you want to use a logical volume larger than GB, specify a larger PE when creating the volume group. The PE size ranges from 8 KB to 512 MB. Why 4 instead of 8, 16 ...? There are several limits on LVM.
· One LV can only belong to one VG (do not think about lvol9 first getting space from vg00, and then getting space from vg01)
· A pv is either independent or belongs to only one VG (as a raw device when it is independent, and the performance is relatively high)
· The vgcrete-l parameter limits the maximum number of LV instances that can be created in a VG. The maximum value is 255.
· The vgcreate-p Parameter limits the maximum number of PVS that a VG can accommodate. The limit is 255.
· The Kernel Parameter maxvgs limits the maximum number of VG instances in the system. The default value is 10. The maximum value is 256:
Set max_pe to the maximum value of 65535.
Set max_pv to the maximum value of 255.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.