{"id":1167,"date":"2017-03-02T15:23:36","date_gmt":"2017-03-02T13:23:36","guid":{"rendered":"\/\/www.mcgill.org.za\/stuff\/?p=1167"},"modified":"2017-03-02T15:39:29","modified_gmt":"2017-03-02T13:39:29","slug":"udevadm-trigger-is-not-permitted-while-udev-is-unconfigured","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/1167","title":{"rendered":"udevadm trigger is not permitted while udev is unconfigured (workaround)"},"content":{"rendered":"<p>Today I fixed an unbootable ubuntu installation: it said:<\/p>\n<blockquote><p>lvmetad is not active yet<\/p><\/blockquote>\n<p>It then dumped to an <em>initramfs<\/em> shell, in which <code>lvm pvs<\/code> reported nothing but errors.\u00a0 <code>\/proc\/partitions<\/code> showed nothing that looked like the root filesystem.  Running <code>udevadm trigger<\/code> produced the following response:<\/p>\n<blockquote><p>udevadm trigger is not permitted while udev is unconfigured<\/p><\/blockquote>\n<p>However, nothing explained why <strong>udev<\/strong> was unconfigured.<\/p>\n<p>The cause of this is that the <strong>udev<\/strong> package contains a wrapper script for <strong>udevadm<\/strong> which is supposed to exist only during the installation of <strong>udev<\/strong>.\u00a0 This script is not actually capable of doing anything, but stops <strong>udevadm<\/strong> messing things up during an upgrade.<\/p>\n<p>When <strong>udev<\/strong> remains unconfigured at the time that <strong>update-initrd<\/strong> is run, then the generated <strong>initrd<\/strong> image contains a copy of a non-working <strong>udevadm<\/strong> command.\u00a0 This command cannot be used to activate user devices, and so things like hard disks, partitions, filesystem and LVM partitions fail to exist.\u00a0 The boot loader could not find its LVM, because it couldn&#8217;t find the device that the LVM is on, because it didn&#8217;t load the driver for the controller for that device.<\/p>\n<p>The fix is to help the <strong>udevadm<\/strong> upgrade to complete (or at least not be totally broken), and then re-generate the <strong>initramfs<\/strong> with working code:<\/p>\n<pre>root@urk:\/bin# <strong>cp udevadm.upgrade udevadm<\/strong>\r\n\r\nroot@urk:\/bin# <strong>update-initramfs -k all -c<\/strong>\r\nupdate-initramfs: Generating \/boot\/initrd.img-3.13.0-32-generic\r\n\r\nroot@urk:\/bin# <strong>apt-get -f install<\/strong>\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\n0 upgraded, 0 newly installed, 0 to remove and 162 not upgraded.\r\n8 not fully installed or removed.\r\nAfter this operation, 0 B of additional disk space will be used.\r\nSetting up udisks2 (2.1.7-1ubuntu1) ...\r\n<em>\/\/ etc\r\n<\/em><\/pre>\n<p>When <strong>udev<\/strong> is unconfigured, the <strong>udevadm <\/strong>script is just a wrapper that says to refuse to run the actions <strong>trigger <\/strong>(look for new devices) and <strong>settle<\/strong> (wait for existing devices):<\/p>\n<pre>#!\/bin\/sh\r\n\r\nif [ \"$1\" = \"trigger\" ]; then\r\n\u00a0\u00a0\u00a0 echo \"<strong>udevadm trigger is not permitted while udev is unconfigured.<\/strong>\" 1&gt;&amp;2\r\n\u00a0\u00a0\u00a0 exit 1\r\nfi\r\n\r\nif [ \"$1\" = \"settle\" ]; then\r\n\u00a0\u00a0\u00a0 echo \"<strong>udevadm settle is not permitted while udev is unconfigured.<\/strong>\" 1&gt;&amp;2\r\n\u00a0\u00a0\u00a0 exit 1\r\nfi\r\n\r\nexec \/bin\/bash -c \"exec -a \\\"\\$0\\\" \/bin\/udevadm.upgrade \\\"\\$@\\\"\" \"$0\" \"$@\"\r\n\r\n<\/pre>\n<p>The fact that the script uses both <strong>\/bin\/sh <\/strong>and <strong>\/bin\/bash<\/strong> says that it was done without certain types of required forethought.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I fixed an unbootable ubuntu installation: it said: lvmetad is not active yet It then dumped to an initramfs shell, in which lvm pvs reported nothing but errors.\u00a0 \/proc\/partitions showed nothing that looked like the root filesystem. Running udevadm &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/1167\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[113,25,53,190,51,216],"class_list":["post-1167","post","type-post","status-publish","format-standard","hentry","category-stuff","tag-bugs","tag-code","tag-debian","tag-stuff","tag-ubuntu","tag-udev"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=1167"}],"version-history":[{"count":5,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1167\/revisions"}],"predecessor-version":[{"id":1424,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1167\/revisions\/1424"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=1167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=1167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=1167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}