{"id":726,"date":"2020-06-09T18:54:23","date_gmt":"2020-06-09T18:54:23","guid":{"rendered":"https:\/\/server-help.org\/?p=726"},"modified":"2022-02-09T17:22:31","modified_gmt":"2022-02-09T17:22:31","slug":"volume-group-not-found","status":"publish","type":"post","link":"https:\/\/server-help.org\/index.php\/2020\/06\/09\/volume-group-not-found\/","title":{"rendered":"Volume Group not found"},"content":{"rendered":"\n<p>In this guide we will work on some recovery steps, that could help you to recover the Volume Group, after reboot.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/server-help.org\/wp-content\/uploads\/2020\/06\/C904150911.png\" alt=\"\" class=\"wp-image-727\" width=\"916\" height=\"210\" srcset=\"https:\/\/server-help.org\/wp-content\/uploads\/2020\/06\/C904150911.png 987w, https:\/\/server-help.org\/wp-content\/uploads\/2020\/06\/C904150911-300x69.png 300w, https:\/\/server-help.org\/wp-content\/uploads\/2020\/06\/C904150911-768x177.png 768w\" sizes=\"(max-width: 916px) 100vw, 916px\" \/><\/figure>\n\n\n\n<p>When you reboot Server after extending \/ shrinking your Server Logical Volume, and something goes wrong, after the reboot, Server shows you this message, and you start in initramfs shell (Rescue shell) in this shell you have very limited commands to use.<\/p>\n\n\n\n<p>Our main commands that we are going to use, all related  to \/sbin\/lvm, if you tried (pvs, vgs, vgdisplay, etc&#8230;) all will give you one result (Command not Found). Therefore, we need to use \/sbin\/lvm to execute the following commands.<\/p>\n\n\n\n<p>So, first we need to get UUID for our drive, to get UUID use blkid command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># blkid\n\/dev\/sda1: UUID=\"8a9e79ec-3936-4e74-bb40-e120cf395dae\" TYPE=\"xfs\" PARTUUID=\"27795bc1-01\"\n\/dev\/sda2: PARTUUID=\"27795bc1-02\"<\/code><\/pre>\n\n\n\n<p>So \/dev\/sda2 is showing Partial UUID (PARTUUID), and the Physical Volume (PV), Volume Group (VG), and Logical Volume (LV) are located \/ stored in \/dev\/sda2 <\/p>\n\n\n\n<p>After getting the UUID, we need to look in <strong>\/etc\/lvm\/archive<\/strong> directory, and look for <strong>VolumeGroupName_xxx.vg<\/strong> file that has the last known valid archived LVM metadata for that volume group.<\/p>\n\n\n\n<p>Then, we start by creating Physical Volume (pvcreate):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/sbin\/lvm pvcreate --uuid \"27795bc1-02\" --restore \/etc\/lvm\/archive\/VolumeGroupName_xxx.vg \/dev\/sda2<\/code><\/pre>\n\n\n\n<p>That will give you an error, that UUID not found in  <strong>VolumeGroupName_xxx.vg<\/strong>, and it will show you the actual UUID, so we need to confirm the UUID of the Physical Volume from  <strong>VolumeGroupName_xxx.vg<\/strong> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat \/etc\/lvm\/archive\/VolumeGroupName_xxx.vg | grep -i \"xxxxxx\"\n                        id = \"xxxxxxx-xxxxxx-xxxxx-xxxxx-xxxxx-xxxxxx-xxxxxx\"<\/code><\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"113\" src=\"https:\/\/server-help.org\/wp-content\/uploads\/2022\/02\/example.png\" alt=\"\" class=\"wp-image-855\" srcset=\"https:\/\/server-help.org\/wp-content\/uploads\/2022\/02\/example.png 779w, https:\/\/server-help.org\/wp-content\/uploads\/2022\/02\/example-300x44.png 300w, https:\/\/server-help.org\/wp-content\/uploads\/2022\/02\/example-768x111.png 768w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/><\/figure>\n\n\n\n<p>Then we perform <strong>pvcreate <\/strong>command again with the correct UUID:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/sbin\/lvm pvcreate --uuid \"xxxxxxx-xxxxxx-xxxxx-xxxxx-xxxxx-xxxxxx-xxxxxx\" --restore \/etc\/lvm\/archive\/VolumeGroupName_xxx.vg \/dev\/sda2\nWriting physical volume data to disk \"\/dev\/sda2\"\nPhysical volume \"\/dev\/sda2\" successfully created<\/code><\/pre>\n\n\n\n<p>After that, we restore the Volume Group (VG):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vgcfgrestore vg00\nRestored volume group vg00<\/code><\/pre>\n\n\n\n<p>Then activate the Volume Group:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vgchange -ay<\/code><\/pre>\n\n\n\n<p>After that you reboot the Server, and your Server should boot into Local mode again normally.<\/p>\n\n\n\n<p>Please note that, sometimes after the reboot, the Operating System asking you to check and repair a Linux filesystem using <strong>fsck <\/strong>command on one of the Logical Volume, you run <strong>fsck <\/strong>command on the Logical Volume, and fix the broken blocks, then reboot Server again, and that should fix everything.<\/p>\n\n\n\n<p><strong>Note: Always remember to Back up your Data, either locally to your PC, or using any Back up solutions.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide we will work on some recovery steps, that could help you to recover the Volume Group, after reboot. When you reboot Server after extending \/ shrinking your Server Logical Volume, and something goes wrong, after the reboot, Server shows you this message, and you start in initramfs shell (Rescue shell) in this&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,4,1],"tags":[],"_links":{"self":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/726"}],"collection":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":4,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"predecessor-version":[{"id":857,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/726\/revisions\/857"}],"wp:attachment":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}