Synchronize lvcb information of vgda and LV Headers

Source: Internet
Author: User
In Aix, The lvcb information of LV is located at 512 bytes of each LV header, and a copy of all LV lvcb is also available in vgda, if the lvcb of the LV header is inconsistent with the lvcb in vgda, how can we synchronize it? However, this situation is rare, but it only provides a way of analyzing problems.
If there is an inconsistency, the general commands cannot be synchronized, and synclvodm certainly cannot. This command can only synchronize vgda-> ODM. It does not modify vgda information, the putlvcb command is found. The following is an example: 1. Create a jfs2 LV, lvtest, and lvid vgid.3, create a file system on the LV, and mount
Point is/test, and several files can be created after Mount. 2. dd If =/dev/lvtest of =/dev/rmt0 BS = 4096 back up lvtest data to tape, recover later. 3. Create a new LV and lvtest1 in the same volume group. The lvid of the LV is vgid.4, which is the same as that of lvtest. 4. rmfs/test, lvtest is also deleted. 5. Test FS is restored from the tape to lvtest1, dd If =/dev/rmt0 of =/dev/lvtest1 BS = 4096 6. Modify/etc/filesystems to add/test file systems, note that Dev has changed 7. Mount/test may report an error, prompting that the mount is normal after fsck-p 8 and fsck-P are executed, no data loss 9. lslv lvtest1 found that lvid is vgid.4 10, dd If =/dev/lvtest1 COUNT = 1 bs = 1024
The lvid of the LV header is found to be vgid.3, because the lvcb information of the lvtest from the tape is changed, that is, the lvcb information of lvtest1 is changed to 11, synclvodm failed 12, and exportvg.
Importvg, not yet. It is strange that lvcb of lvtest1 has been changed, but there is no error in importvg, and/etc/filesystems
There is no/Test File System's entries in the file. This is easy to understand, because no CRFs operation has been performed since step 1, so no. How can we restore it? 13. Use the putlvcb command, first use readvgda-V
/Dev/hdisk # view the lvcb information recorded in the vgda area of the volume group, find the lvcb information of lvtest1, and find that lvtest1 only records lvid, LV
Type. You need to add other parameters, modify lvid 14, use the putlvcb command to update the lvcb of the LV header, and automatically update the vgda information in the vgda, the putlvcb command writes the control block information into Block 0
The
Logical volume lvname. Only the fields specified are written. putlvcb can
Be
Used to write a new control block or update an existing one. 15. Modify lvid, putlvcb-I vgid.4 lvtest1 add mount point, putlvcb-L/test lvtest1 add jfs2 Log Device, putlvcb-F log =/dev/loglv02 lvtest1 is necessary, you can also modify the type, putlvcb-T jfs2 lvtest1 16, use the readvgda command to view the Modification result 17, if the modification is successful, exportvg
Importvg, you will find that the/etc/filesystem file can have a specified entries, directly Mount/test successfully, the above several problems are analyzed, such as lslv importvg
Most LVM commands read vgda information (importvg imports vgda information to the ODM), while only a few commands obtain information from lvcb, more specifically, modifying the lvcb information will be performed at the same time in the vgda and LV headers, while reading lvcb will be read from vgda. In addition, it is recommended that you do not use dd to back up the file system, if the bare device is not, it is best not to use dd. The preceding environment is aix5302, An SSA disk, and a single-disk volume group.

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.