Meanings and functions of PVID in Aix

Source: Internet
Author: User

PVID is the serial number used by the odm lvm In the AIX system to identify PV. The operating system uses PVID to identify PV, just like the ID card of each of us.

After PV is added to the system, you can generate PVID in two ways.

1, ipvmgr-V
2. If lspv does not have a PVID, run chdev-l hdiskn-A Pv = yes.

That is to say, when the system can recognize the hard disk and recognize it as PV (that is, the LVM component. The system allocates the PVID to the hard disk, and the system's ODM library stores the PVID.
The PVID generation principle is the time stamp when the motherboard serial number + PV is formed. Apart from writing PVID to the ODM library, the PVID is also written to the hard disk header information (the first few bytes of the 0 sector) and vgda.

To make a disk into a physical volume, the PVID is placed onto the disk. thepvid is an combination of the machine's serial number (from the systems eproms) and the date the PVID was generated. this combination ensures the extremely low chance of pvids being duplicated. when the system is booted, the disk configurator looks at the PVID residing on the disk and compares it with an entry in the ODM. if an entry is found, then the disk is given the hdiskx number in the ODM that is associated with the PVID. if there is no matching entry, then the next name in the pool of 'free' hdisk names is allocated to the physical volume.

You can use lquerypv-H hdisk0 to view the PVID of PV.

Ibm150: [/] # lquerypv-H/dev/hdisk0
000af70de396426b0000000000000000
Ibm150: [/] # lspv
Hdisk0 000af70de396426b datavg
Hdisk1 000af70d5c816fc2 rootvg
Hdisk2 000af70d4d50358c rootvg

We can see that the first digit of the PVID of the three PVS is the same (that is, the serial number of the motherboard), and the last digit is different.

You can modify the PVID using the following methods:
Chdev-l hdisk1-A Pv = clear PVID of the PV disk Header
Chdev-l hdisk1-A Pv = yes to redefine PVID

If PV has been added to the volume group, you must first varyoffvg and exportvg
After performing the preceding steps, the PVID of PV will change. Only the PVID of the disk header is modified, and the PVID in vgda is not modified.

When PV is already a member of a volume group, do not modify the PVID

Because when PV is added to a volume group, the PVID is written to vgda. If you modify the PVID of the volume group without authorization, the newly generated PVID cannot match the pvid in the vgda of the volume group. In this way, importvg cannot be implemented, and varyonvg cannot be created. data may be lost!

When importvg is used, the ODM will read vgda on PV. If the pvid on the vgda does not match the PVID on its own disk, an error will occur!

Note: After PV is added to the volume group, PVID exists in at least two locations on the hard disk, one is in the hard disk header and the other is in vgda. The pvids of these two locations are generally the same, but the changes to the PVID may cause inconsistency, which may lead to data loss.

You can use
# Lqueryvg-ATP hdisk0 view PVID in PV vgda

Ibm150: [/] # lqueryvg-ATP hdisk0
Max LVS: 256
PP size: 25
Free PPS: 85
LV count: 3
PV count: 1
Total vgdas: 2
Conc allowed 0
Max PPS/1016
Max PVs: 32
Conc autovar 0
Varied on Co 0
Logical: 000af70d00004c000000010000e00004781. 1 loglv00 1
000af70d00004c00000000000e00004781. 2 lv00 1
000af70d00004c00000000000e00004781. 3 lv02 1
Physical: 000af70de396426b 2 0
Total packets: 542
LTG size: 128
Hot spare: 0
Auto Sync: 0
VG permissio 0

Of course, in case of modification, there is still a way to restore the data!
1. Volume group repair (recommended)
1. First, delete the definition of the original volume group from the system's ODM database:
# Exportvg vgname

2. Check the vgda area information on the hard disk to obtain the name and definition of the logical volume:
For example:

# Lqueryvg-ATP hdisk2
Max LVS: ------ 256
PP size: ------ 26
Free PPS: ----- 538
LV count: ----- 2
PV count: ----- 1
Total vgdas: -- 2
Conc allowed -- 0
Max PPS per --- 1016
Max PVs: ------ 32
Conc autovar -- 0
Varied on Co -- 0
Logical: ------ 0003f62a4154c00000000f52f1737c5. 1 -- datalv1 1
--------------- 0003f62a4874c00000000f52f1737c5. 2 -- datalv2 1
Physical: ----- 0003f62a2f135f0e ------------ 2 ---- 0
Total PPS: ---- 542
LTG size: ----- 128
Hot spare: ---- 0
Auto Sync: ---- 0
VG permissio -- 0

3. Create a table file corresponding to the logical volume name. The first field is the name of the logical volume in the vgda area, and the second field is the new logical volume name in the new volume group, which can be the same or different. To fix the content of the original volume group, generally, the logical volume name remains unchanged.

For example:

# Vi/tmp/lvname
Datalv1: datalv1
Datalv2: datalv2

4. Create a new volume group on the hard disk to retain the data structure of the original volume group.

# Recreatevg-y vgname-l lv_file hdisk_name...
For example:
# Recreatevg-y testvg-L/tmp/lvname hdisk2

5. If there is a file system in the volume group, you also need to modify/etc/filesystems to make the corresponding file system load point consistent with the original. First, modify the/etc/filesystems file. If not, perform the following steps.
Or:

If mountpoint is different after re-import, you can modify the LV attribute through Smitty chlv, that is, modify the logical volume label to make it the same as the mount point.

Why Modify/etc/filesystem?

After recreatevg, the system automatically creates a directory/fs. All file systems are loaded to/FS, and the original mountpoint is based on.

 

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.