{"id":1188,"date":"2018-03-02T15:28:05","date_gmt":"2018-03-02T21:28:05","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=1188"},"modified":"2018-03-02T15:28:05","modified_gmt":"2018-03-02T21:28:05","slug":"lvm-removing-vg-with-missing-disk","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/lvm-removing-vg-with-missing-disk\/","title":{"rendered":"LVM Removing VG with missing disk"},"content":{"rendered":"
If you removed a disk from a server and forgot to cleanly remove the configuration you may experience something similar.<\/p>\n
Below shows what happens with lvremove:<\/p>\n
\r\n# lvremove --force --verbose \/dev\/vg02\/u01\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n There are 1 physical volumes missing.\r\n Archiving volume group "vg02" metadata (seqno 2).\r\n Releasing logical volume "u01"\r\n Aborting vg_write: No metadata areas to write to!\r\n<\/pre>\nSome people seem to have success with vgreduce commands but I ended up making a fake device and extending the VG in order to cleanup the LV.<\/p>\n
\r\n# lvs\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert\r\n opt vg01 -wi-ao---- 995.00g \r\n u01 vg02 -wi-----p- 248.00g \r\n\r\n# dd if=\/dev\/zero of=\/tmp\/tmp.raw bs=1M count=100\r\n100+0 records in\r\n100+0 records out\r\n104857600 bytes (105 MB) copied, 0.0763176 s, 1.4 GB\/s\r\n\r\n# losetup -f\r\n\/dev\/loop0\r\n\r\n# losetup \/dev\/loop0 \/tmp\/tmp.raw \r\n\r\n# vgextend vg02 \/dev\/loop0\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n Physical volume "\/dev\/loop0" successfully created.\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n Volume group "vg02" successfully extended\r\n\r\n# vgremove vg02 --force\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n Logical volume "u01" successfully removed\r\n Volume group "vg02" successfully removed\r\n\r\n# pvremove \/dev\/loop0\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n Labels on physical volume "\/dev\/loop0" successfully wiped.\r\n\r\n# losetup -d \/dev\/loop0 \r\n# rm \/tmp\/tmp.raw \r\n\r\n# lvs\r\n LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert\r\n opt vg01 -wi-ao---- 995.00g \r\n# vgs\r\n VG #PV #LV #SN Attr VSize VFree\r\n vg01 1 1 0 wz--n- 999.99g 4.99g\r\n# pvs\r\n WARNING: Device for PV ore6TE-2ues-rc5q-mkCN-hEHE-C4Av-paaxEH not found or rejected by a filter.\r\n PV VG Fmt Attr PSize PFree\r\n \/dev\/sdb vg01 lvm2 a-- 999.99g 4.99g\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"If you removed a disk from a server and forgot to cleanly remove the configuration you may experience something similar.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1188","post","type-post","status-publish","format-standard","hentry","category-lvm"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=1188"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1188\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}