1748265 Members
4254 Online
108760 Solutions
New Discussion юеВ

Re: LVM VG map files

 
SOLVED
Go to solution
Kris Knigga
Advisor

LVM VG map files

I'm finding some conflicting information regarding VG map files. In the past, I've always heard and operated under the idea that any time you make any change to a clustered VG (new LV, new PV, whatever) you must generate a map file on the active node (vgexport -p -s -m map vg) and import the VG with the map file on the passive nodes.

Looking at the map file, I only see the VG ID and pairs of minor numbers and LV names. Does this mean that the only time I really need to send out new map files is when I add or delete LVs? Does adding a PV to a VG and then expanding an LV really require this procedure? It seems that the map file wouldn't contain any new information.
6 REPLIES 6
Kris Knigga
Advisor

Re: LVM VG map files

We recently did a PV add and LV expansion, so I just checked out a pre-work map and a post-work map. The checksums are exactly the same.
Rita C Workman
Honored Contributor

Re: LVM VG map files

Here's a thought...

After looking at the mapfile, what about your /etc/lvmtab file. Do we need to have each volume group shown with it's corresponding disk. If you don't run a fresh vgimport after adding disk on the primary node - do you think your lvmtab would be "good" on those other boxes?

So...do you need to keep your volume group and lvmtab in harmony? If they aren't in harmony could you maybe get an error that the volume group is out of sync with the kernel?

And what if you forgot last time, or the other person forgot to import last time you needed to (pesky phone interuptions-oops) what if we needed it last time.

I don't know, guess it's the housekeeper in me - I just like things all neat and harmonious and freshly imported.

/rcw
Shailendran V Naidu
Frequent Advisor

Re: LVM VG map files

Hi Kris,
Rita is right.
Any change you make to the VG structure has to be updated to all the nodes.
Specially:
1) add or remove a disk from a VG.
2) add or remove a LV from a VG.
3) If you use BCVs that do a vgchgid.

for other operations it is not necessary but advisable to re-populate the VG structures.

Other wise you will end up with an inconsistent /etc/lvmtab across the SG nodes.
johnsonpk
Honored Contributor
Solution

Re: LVM VG map files

HI Kris,

>>Looking at the map file, I only see the VG ID and pairs of minor numbers and LV names.

Yes true ,the map file will only have lvol names and vgid(incase of -s used while creatin map).(Even you can import the vg with out refering to the map file but the lvol names in the imported vg will be like lvol1 ..lvol2 ...and offcourse u need to provide the disk details while importing)

>>Does this mean that the only time I really need to send out new map files is when I add or delete LVs?

NO ..You need to do export and import each time you do any lvm related activity

>>Does adding a PV to a VG and then expanding an LV really require this procedure?


Yes since the lvmtab of the other node will not have any info about the newly added disk


>>It seems that the map file wouldn't contain any new information.

The lvm structure is actually resids on the physical volumes and it is getting updated each time you do any lvm activity like creating lv ,adding ,removing pv etc...

Inorder to sync the updated lvm structure with the kernel/system u need a fresh vgexport and import.

Thanks!!
Johnson
Anoop P_2
Regular Advisor

Re: LVM VG map files

Just to add, if the change was just the addition of a new logical volume with out adding any PV, you just need to create a device file using the same major/minor number at the second node using mknod; An import using map file is not necessary.


Kris Knigga
Advisor

Re: LVM VG map files

Ok, so it appears that vgimport does more than just use the information in the map file.

I think the initial source of my confusion was that I sort of assumed that the map file contained a complete VG structure dump, an assumption dashed by actually looking at the map file.

Thanks!