LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2012, 04:29 PM   #1
jgonzales6266
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
LVM - I added a new partition to the WRONG Volgroup


RHEL 5.5 / LVM2
I created a new partition /dev/sdb2 and added it to the wrong VolGroup. It isn't being used; I stopped as soon as I did it! How can I remove it and add it to the correct group?

The group it is in now is VolGroup00 and has the root file system in it...

Thank you!

I was able to remove the partition using the LVM GUI. I would still love to get the correct procedure for CLI.

Last edited by jgonzales6266; 06-07-2012 at 04:47 PM. Reason: Update
 
Old 06-07-2012, 06:57 PM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
If it's empty it's just two commands (as root, of course)
Code:
vgreduce VolGroup00 /dev/sdb2
then
Code:
pvremove /dev/sdb2
If it was in use, it's no big deal. You'd just have an extra step of pvmove'ing the data off of that PV before doing the above.

That would be
Code:
pvmove /dev/sdb2 /dev/<dest-volume>
There is a bug in LVM (per Red Hat) where it can hang using the above command IF there are multiple LV's on the PV.
It doesn't always hang, but to be on the safe side in that case you could move each LV individually.

List what is on the PV first.
Code:
pvdisplay --maps /dev/sdb2
Then,
Code:
pvmove -n <LV name> /dev/sdb2 /dev/<dest-volume>
for each Logical Volume.
 
  


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
move VolGroup-lv-home to VolGroup-lv-root dmb2002man Linux - Newbie 11 08-19-2011 09:22 AM
[SOLVED] command to add a volume in an existing LVM VolGroup x201s Linux - Newbie 3 05-25-2011 05:51 AM
Two LVM VolGroup's, same name, one is system disk - what to do? ffingers Linux - Hardware 11 05-12-2010 03:59 PM
mouting LVM. /dev/VolGroup and knoppix Tux Fedora 1 09-04-2006 11:43 PM
Added second harddrive as a partition, but now the partition size is wrong.. mlsbraves Linux - General 5 08-17-2005 09:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration