LVM: Removing a 'Zombie' (Unavailable) VG

7

1

I have an LVM related problem. We have a server that 'learned' about a foreign volume group through a hard drive that was briefly attached. Now, with that hard drive gone again, all LVM utilities complain about lots of IO errors (read failed) for this missing volume group.

root@coruscant:~# vgs
/dev/mapper/vg_old-lv1: read failed after 0 of 4096 at 2147418112: Input/output error
/dev/mapper/vg_old-lv2: read failed after 0 of 4096 at 0: Input/output error
[...]
/dev/mapper/vg_old-lvn: read failed after 0 of 4096 at 0: Input/output error
VG        #PV #LV #SN Attr   VSize   VFree
real_vg_1     1  36   1 wz--n-   1.73T  1.04T
real_vg_2     1   3   0 wz--n- 111.66G 61.66G

As you can see from the output of vgs, the 'missing' zombie VG is not actually listed in the output of the utilities. I can also not disable it with 'vgchange' or remove it with 'vgremove' -- These tools just return 'volume group not found'.

Any hints on how to remove this 'zombie' VG from the system without rebooting?

System:

  • Ubuntu 8.04LTS, x64, 2.6.24-29-xen,
  • LVM version: 2.02.26 (2007-06-15)
  • Library version: 1.02.20 (2007-06-15)
  • Driver version: 4.12.0

AndiW

Posted 2011-11-04T01:19:39.927

Reputation: 71

Answers

8

The solution for removing ghost LVM-volumes is 'dmsetup'. Do something like:

# dmsetup remove --force /dev/VolGroup01/LogVol00

After that your 'vgs'-command does not display the read errors.

Jari Turkia

Posted 2011-11-04T01:19:39.927

Reputation: 237

1Spot on! Worked for me without using --force. – krlmlr – 2015-03-09T20:55:45.003

The --force was not needed in my case but the command removed the stale LV. – Christian Wolf – 2016-03-18T12:40:55.633

Worked without --force on 14.04 LTS (which still has this problem) – Michel – 2016-07-21T10:36:14.567