Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 01-03-2010, 10:12 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 14

Rep: Reputation: 0
Question Red Hat Linux Enterprise V5 /LVM2 & LVM cleanup process


I am in a situation where i am stuck with a LVM cleanup process. Although i know a lot about AIX LVM , but this is first time i am working with Linux LVM2.

Problem is that i created two RAID arrays on storage , which appeared as mpath0 & mpath1 devices ( multipath) on RHEL. I created logical volumes and volume groups and every thing was fine till i decided to clean the storage arrays and ran following script
cat /scripts/numbers | while read numbers
lvremove -f /dev/vg$numbers/lv_vg$numbers
vgremove -f vg$numbers
pvremove -f /dev/mapper/mpath$numbers\p1

Please note that numbers was a file in same directory, having numbers 1 and 2 in separate line.

Scripts worked well and i was able to delete definations properly ( however i now think i missed one parted command to remove the partition defination from mpath device.

When i created three new arrays , i got devices from mpath2 to mpath5 on linux and then i created vg0 to vg2.

By mistake , i ran above script again for cleanup purpose and now i got following error message

Cant remove physical volume /dev/mapper/mpath2p1 of volume group vg0 without –ff[/B]

Now after doing mind search , i now realize that i have messed up ( particularly because mpath devices did not map in sequence to vg devices and mapping was like mpath2 --- to ---- vg0 and onwards )

Now how i can cleanup the lvm definations? should i go for pvremove -ff flag or investigate further?

Can anybody help me providing any step by step procedure ? I am not concerned about data , i just want to cleanup these pv/vg/lv/mpath definations so that lvm can be cleaned up properly and i can start over with new raid arrays from storage?

Thanks in advance!!
Old 01-03-2010, 01:21 PM   #2
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Have you tried doing it manually? lv by lv, pv by pv?


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
Red Hat enterprise Linux v5-Keeps prompting for username & password while loggin in Ckteo Linux - Newbie 9 11-21-2010 03:42 AM
LXer: Adding new functions to Red Hat Enterprise Linux: A process primer LXer Syndicated Linux News 0 01-16-2009 09:30 AM
LXer: Adding new functions to Red Hat Enterprise Linux: A process primer LXer Syndicated Linux News 0 10-18-2008 03:21 AM
LXer: Red Hat to launch Red Hat Enterprise Linux 5 before March LXer Syndicated Linux News 0 12-30-2006 09:03 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:45 AM.

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