LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 02-24-2006, 03:43 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,979

Rep: Reputation: 290Reputation: 290Reputation: 290
LVM2: Renaming VGs and LVs, combining VGs


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?

I would like to attempt:
Code:
CURRENT:
vg0->lv00
vg0->lv01
vg1->lv10
vg1->lv11
Code:
FUTURE:
new_vg2->old_lv00
new_vg2->old_lv01
new_vg2->old_lv10
new_vg2->old_lv11
 
Old 02-24-2006, 04:59 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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.

Last edited by uselpa; 02-24-2006 at 05:01 PM.
 
Old 02-25-2006, 08:19 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,979

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Thanks for the reply.

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 ...

Gee, I wonder what those commands do?!

 
Old 02-26-2006, 08:12 AM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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 :-)
 
Old 06-29-2007, 09:52 PM   #5
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Rep: Reputation: 36
Quote:
Originally Posted by uselpa
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
 
Old 06-30-2007, 12:33 PM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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?
 
Old 06-30-2007, 02:02 PM   #7
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Rep: Reputation: 36
Quote:
Originally Posted by uselpa
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.

Thanks,
bgoodr
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM problems (VGs found, but not LVs) jimisola Linux - Software 2 12-11-2005 11:59 AM
squid with LVS-------------------- pal Linux - Networking 8 02-13-2005 04:32 AM
problem after LVS server---------------- pal Linux - Networking 0 01-13-2005 03:45 AM
Routing and LVS Mikhail_16 Linux - Networking 3 07-22-2004 02:00 PM
LVS Question ? Viper Slackware 4 11-04-2002 06:25 PM


All times are GMT -5. The time now is 06:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration