Operating System - HP-UX
1834448 Members
2322 Online
110067 Solutions
New Discussion

Can someone tell me what LVM commands update /etc/lvmtab?

 
SOLVED
Go to solution
Jeff.Z
Frequent Advisor

Can someone tell me what LVM commands update /etc/lvmtab?

Hi,

As far as i know, only vgscan/vgimport make changes to lvmtab. How about the regular LVM commands?

vgcreate, vgextend, vgreduce, vgremove, vgsync
lvcreate, lvextend, lvreduce, lvremove...
pvcreate, pvremove, pvmove

can't find any info in Man pages. Any ideas, appreciate.

Thanks,
Jeff
18 REPLIES 18
Pete Randall
Outstanding Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

The only command that updates lvmtab is vgscan.


Pete

Pete
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Well I would think that vgcreate would add entries to lvmtab.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Court,

Yes, I believe vgcreate should add sth. in lvmtab as lvmtab contains info about VGs/PVs. But, how about vgextend and other commands like vgcfgrestore? Thanks.

Jeff
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Any particular reason you want to know this?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

oh yes, when i remove 'ghost disk' using vgreduce -f, the system suggests me to

1. Save /etc/lvmtab to another file.
2. Remove /etc/lvmtab.
3. Use vgscan -v to recreate /etc/lvmtab.
4. NOW use vgcfgbackup(1M) to save the LVM setup.

Should vgreduce update lvmtab automatically?
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

I think the reasoning has to do with covering your ###. If something were to go awry you could always restore your old lvmtab. vgreduce -f will remove the pv entries of the missing drives from the lvmtab file.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Court,

yes, vgreduce -f will remove the pv entries of the missing drives from the lvmtab file. That's what i want cuz we have no old lvmtab there and 'Cur PV' > 'Act PV' in vgdisplay. Thanks.

Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Sorry, but now I am confused. Can you explain your exact issue and what it is you want to achieve.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Sorry about the confusing...

The 'ghost disk' case has been solved already. We do things like this,

...
# lvreduce -k -m 0 /dev/vg07/odata 0
# vgreduce -f vg07

After 'vgreduce', we got some instructions from the system like this

1. Save /etc/lvmtab to another file.
2. Remove /etc/lvmtab.
3. Use vgscan -v to recreate /etc/lvmtab.
4. NOW use vgcfgbackup(1M) to save the LVM setup.

I did that and everything is ok now. But from what i understand, 'vgreduce' should update /etc/lvmtab automatically same thing as you mentioned what 'vgcreate' did. And i want to know what LVM commands update /etc/lvmtab. Is this clear? Thanks.

Pete Randall
Outstanding Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Oops - my bad. Obviously I wasn't thinking. Sorry.


Pete

Pete
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

crystal.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Here is a list of what modifies lvmtab.

vgcfgrestore, vgcreate, vgexport, vgextend, vgimport, vgreduce, vgremove, vgscan

I do not believe that any lv/pv commands modify the lvmtab file. Hope that helps.

"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Actually, scratch vgcfgrestore off that list.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?


COOL! Thanks. my last question is, 'vgreduce' modifies lvmtab, why we still need to do the vgscan to re-create /etc/lvmtab following the vgreduce? And we can easily find this kinda suggstions at the very bottom of vgreduce(1M) also. Wired.


Court Campbell
Honored Contributor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

You know what. Maybe the -f option only updates the kernel lvm structures. And that would be why you need to recreate the lvmtab file after a forced removal. I don't have a box to test on. Hopefully someone with more knowledge can answer that question.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor
Solution

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Actually, just compare your old lvmtab to your new one and that should answer your question.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

Supper! Thanks a bunch.
Jeff.Z
Frequent Advisor

Re: Can someone tell me what LVM commands update /etc/lvmtab?

clear now, thanks Court.