Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
My system has been running well for a long while, so I figure it's time to hose it up with another dumb experiment!
Anyone know how to rename LVM2 volume groups? Rename logical volumes? And the biggie: combine two different VGs into a single VG without losing any existing LVs or data? The LVM HowTo doesn't appear to broach these subjects (maybe because they're impossible/not_recommended?) I know I could backup existing stuff, recreate VGs and LVs from scratch, and restore. But that's cheating. Is there a way to rename and combine?
On renaming: I did that with vgrename and lvrename. The only trick there was is that beforehand you have to set them unavailable (vgchange -a n / lvchange -a n) and available again afterwards.
Well, it looks like my original question qualifies as the "bonehead question of the year". I'm very familiar with the LVM HowTo, so that's the first place I looked to find out how to do what I wanted. No mention of renaming or merging commands that I can remember. So I assumed no such commands existed (I know, I know, an assumption is the first step towards a screw-up!)
But head on over to the /sbin directory, snoop around and what do you find? vgrename, lvrename, vgmerge ...
I can understand your assumption that when it's not in the HOWTO, it can't be done. But it turns out that those HOWTOs often get you started, but rarely aim at being complete. And very often you have the answer to your questions on your own machine. For example, in a shell, press "lv<tab><tab>" and start discovering.
Good lock, and be careful. LVM commands are very powerful :-)
On renaming: I did that with vgrename and lvrename. The only trick there was is that beforehand you have to set them unavailable (vgchange -a n / lvchange -a n) and available again afterwards.
On combining two VGs into one: I think you can't.
I'm having similar difficulties, but I don't want to combine VG's. I just want to rename one of the two volume groups that have the same name so that I can get access to the data. Can you describe why you say "The only trick there was is that beforehand you have to set them unavailable (vgchange -a n / lvchange -a n) and available again afterwards"? Other posts seem to indicate that you have to execute this command, but do not explain why:
Code:
vgrename -a y
Namely, what is the significance of a Volume Group being "active"?
Thanks,
bgoodr
What I meant is that you need to do, in that order
1) vgchange -a n
2) vgrename
3) vgchange -a y
and the same for lv*
My vgrename does not have a -a option anyway.
According to `man vgchange`, -a "makes the volumes known or unknown to the kernel".
Did you try to rename a VG or LV? Did you have any problem?
Not yet, I am doing a lot of things with some help on my thread at FedoraForum.
I'm after understanding the answer to why to do those things, not just to do them, as I'm not convinced they are safe to do on my drive... at least, not yet.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.