ubuntufilesystemsrhelrhel5

Removing duplicate volume group with missing physical volumes


I was working with some maintenance folks to try and replace a dead hard drive on a station running RHEL5 (old, I know...). Instead of getting some brand new drives, they used some drives from an old server that is no longer operational. The system did recognize this new drive, however this drive contains a volume group that is conflicting with an existing volume group on my system. Additionally, since the duplicate volume group belonged to an old system it is complaining that none of the physical volumes can be located due to different UUID's in the new system.

I need to remove the duplicate volume group. I've tried the following steps already:

  1. vgreduce --removemissing vg01
  2. vgrename *UUID* oldvg (complains about missing physical volumes)
  3. I can't use pvremove because the groups I need to remove don't have a path assigned to them (unknown device) and it doesn't appear that I can use pvremove with a UUID.

TLDR: Two volume groups both with name "vg01". Need to remove the duplicate vg01 as well as it's associated missing physical volumes.

And yes I know this could have all been avoided if we had just used brand new hard drives...


Solution


  • If you really don't care of losing the data on that disk (let's say /dev/sda), you can always zero the disk:

    dd if=/dev/zero of=/dev/sda bs=4K
    

    Pay attention that if you have a large disk, you might use larger bs. (or just wait very long time :) )