{"id":3006,"date":"2013-08-20T17:03:56","date_gmt":"2013-08-20T17:03:56","guid":{"rendered":"http:\/\/really.zonky.org\/?p=3006"},"modified":"2013-08-25T11:48:42","modified_gmt":"2013-08-25T11:48:42","slug":"linux-logical-volumes-not-active","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=3006","title":{"rendered":"Linux Logical Volumes Not &#8220;Active&#8221; ?"},"content":{"rendered":"<p>Every so often I come across an old Linux box that doesn&#8217;t take kindly to being rebooted. Without console access, it is hard to see what is going on, but the Linux kernel gets stuck trying to mount the root file system. There are many possible fixes for this, but they all have one thing in common \u2026 a work-around has to be performed to get the box up and running.<\/p>\n<p>The console gets stuck in a &#8220;mini-root&#8221; environment loaded when the\u00a0<em>initrd<\/em> image is loaded and before the real root file system is mounted which means a lot of commands are not available, but\u00a0<em>lvm<\/em> should be available. First of all, run\u00a0<em>lvm lvscan<\/em> to get a list of the logical volumes that need activating :-<\/p>\n<pre>(initramfs) lvm lvscan\r\n  inactive          '\/dev\/sys\/root' [332.00 MiB] inherit\r\n  inactive          '\/dev\/sys\/usr' [8.38 GiB] inherit\r\n  inactive          '\/dev\/sys\/var' [2.79 GiB] inherit\r\n  inactive          '\/dev\/sys\/swap_1' [7.05 GiB] inherit\r\n  inactive          '\/dev\/sys\/tmp' [380.00 MiB] inherit\r\n  inactive          '\/dev\/sys\/home' [16.00 GiB] inherit\r\n  inactive          '\/dev\/sys\/opt' [24.00 GiB] inherit<\/pre>\n<p>For each volume group (the second column, middle word), run: <em>lvm lvchange -ay ${volume-group-name}<\/em>. In the case of my example :-<\/p>\n<pre>(initramfs) lvm vgchange -ay \/dev\/sys\r\n  7 logical volume(s) in volume group \"sys\" now active<\/pre>\n<p>At which point you should be able to press ^D (or enter <em>exit<\/em>) to continue the boot process.<\/p>\n<p>A slighter better work-around involves changing the Grub configuration to add a delay to the kernel parameters. This sections assumes that you are <em>not<\/em> using Grub Legacy!<\/p>\n<p>Start by editing <em>\/etc\/default\/grub<\/em> and changing the variable <em>GRUB_CMDLINE_LINUX<\/em> to include &#8220;rootdelay=20&#8221; :-<\/p>\n<pre>GRUB_CMDLINE_LINUX='console=tty0 console=ttyS0,19200n8 <strong>rootdelay=20<\/strong>'<\/pre>\n<p>Finalise by running <em>update-grub<\/em>. This adds a 20s delay to the boot process so is hardly an ideal solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every so often I come across an old Linux box that doesn&#8217;t take kindly to being rebooted. Without console access, it is hard to see what is going on, but the Linux kernel gets stuck trying to mount the root file system. There are many possible fixes for this, but they all have one thing <a href='https:\/\/really.zonky.org\/?p=3006' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[209,226],"tags":[43,1117,485,1115,1116],"class_list":["post-3006","post","type-post","status-publish","format-standard","hentry","category-linux-it","category-working-notes","tag-linux","tag-lvchange","tag-lvm","tag-root","tag-unbootable","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-Mu","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3006"}],"version-history":[{"count":6,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3006\/revisions"}],"predecessor-version":[{"id":3014,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3006\/revisions\/3014"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}