lvm2 cleanup process and red hat Enterprise V5

view full story

http://www.linuxforums.org – :confused:Guys 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 #!/bin/sh cat /scripts/numbers | while read numbers do lvremove -f /dev/vg$numbers/lv_vg$numbers vgremove -f vg$numbers pvremove -f /dev/mapper/mpath$numbers\p1 done 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!! (HowTos)