{"id":607,"date":"2023-02-09T23:11:37","date_gmt":"2023-02-09T12:11:37","guid":{"rendered":"https:\/\/www.samontab.com\/web\/?p=607"},"modified":"2023-03-03T10:59:11","modified_gmt":"2023-03-02T23:59:11","slug":"fixing-out-of-memory-error-when-loading-initial-ramdisk-and-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00-while-booting-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/www.samontab.com\/web\/2023\/02\/fixing-out-of-memory-error-when-loading-initial-ramdisk-and-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block00-while-booting-ubuntu-22-04\/","title":{"rendered":"Fixing out of memory error when loading initial ramdisk and Kernel Panic &#8211; not syncing: VFS: Unable to mount root fs on unknown-block(0,0) while booting Ubuntu 22.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If while booting Ubuntu, it stops and shows you this error:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nout of memory error when loading initial ramdisk\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Or this one:<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nKernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">It means that there&#8217;s an issue with the Linux initial RAM disk(initrd) in that particular kernel you&#8217;re trying to boot to. This might happen because of a recent upgrade, or other reasons. Let&#8217;s fix it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While restarting, on the grub menu, select &#8220;<strong>Advanced options for Ubuntu<\/strong>&#8220;. After you select that, you will be able to see all the kernels installed in your system. Try with a different one until you&#8217;re able to boot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;re in a working system, we&#8217;re going to change some configurations for initrd:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/initramfs-tools\/initramfs.conf\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Change the following setting:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nMODULES=dep\nCOMPRESS=xz\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Save the file(CTRL+O) and close the editor(CTRL+X).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now you need to know which version of the kernel is the one having issues. You can list all the installed kernels with this command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndpkg --list | grep linux-image\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The name should be something like this: &#8220;5.15.0-58-generic&#8221;. Now update the initrd for that kernel(remember to change it to whatever your system has, the one that doesn&#8217;t work):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo update-initramfs -u -k 5.15.0-58-generic\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">You can also try different compression algorithms and check the current size of the image with this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nls -ltrh \/boot\/initrd.img* \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Now simply update grub:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo update-grub\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Restart and you should be able to boot into the system without issues.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enjoyed the article?<\/p>\n\n\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If while booting Ubuntu, it stops and shows you this error: Or this one: It means that there&#8217;s an issue with the Linux initial RAM disk(initrd) in that particular kernel you&#8217;re trying to boot to. This might happen because of a recent upgrade, or other reasons. Let&#8217;s fix it. While restarting, on the grub menu, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/comments?post=607"}],"version-history":[{"count":0,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}