{"id":50,"date":"2008-05-19T05:17:33","date_gmt":"2008-05-19T10:17:33","guid":{"rendered":"http:\/\/yourlinuxguy.com\/?p=50"},"modified":"2008-05-10T12:56:56","modified_gmt":"2008-05-10T17:56:56","slug":"how-can-i-repair-a-missing-or-corrupted-initrd","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=50","title":{"rendered":"How can I repair a missing (or corrupted) initrd?"},"content":{"rendered":"<p>Somehow my <code>initrd<\/code> broke (read: disappeared) while installing some critical updates on my OESsp2 server. Not sure how, and I&#8217;m not sure I care, but it ticked me off. The system will not boot without an <code>initrd<\/code>! Arg!<\/p>\n<p>Anyway, while researching, I found <a title=\"article by Sander van Vugt\" href=\"http:\/\/searchenterpriselinux.techtarget.com\/tip\/0,289483,sid39_gci1282890,00.html\" target=\"_blank\">a great write up by Sander van Vugt<\/a>, that I used for reference. For brevity, I&#8217;ve written an adaptation of the required steps below. This really applies to any Linux distro (as long as it uses an <code>initrd<\/code>), mine just happened to be an OESsp2 Linux server.<\/p>\n<p>Boot the system using a &#8220;Live&#8221; Linux cd or something. Any distro will do, as long as you can mount the filesystems. For instance, you can&#8217;t use an old Suse 9.1 Live disk that you have lying around if you happen to have some Reiser filesystems (9.1 did not include Reiser).. believe me, I know&#8230;  \ud83d\ude09 I ended up using the current (at the time of this writing) Opensuse 11 beta that worked great, since it boots &#8220;live&#8221;.<\/p>\n<p>Once booted up, mount all the real disk partitions under a fake root. I&#8217;m using <code>\/media\/disk<\/code> as my fake root (you can use something different, just make sure to change it throughout all the references below). You may or may not have multiple partitions, just be careful to be accurate. Here&#8217;s my example of what I did:<br \/>\n<code>mount \/dev\/cciss\/c0d0p6 \/media\/disk<br \/>\nmount \/dev\/cciss\/c0d0p1 \/media\/disk\/boot<br \/>\nmount \/dev\/cciss\/c0d0p5 \/media\/disk\/var<\/code><\/p>\n<p>Duplicate the <code>proc<\/code> and <code>dev<\/code> environments:<br \/>\n<code>mount -t proc none \/media\/disk\/proc<br \/>\nmount -o bind \/dev \/media\/disk\/dev<\/code><\/p>\n<p>Set your root environment (because <code>mkinitrd<\/code> really prefers to run at its own root):<br \/>\n<code>chroot \/media\/disk<\/code><\/p>\n<p>Fnally, actually fix the <code>initrd<\/code> with the following command:<br \/>\n<code>mkinitrd<\/code><\/p>\n<p>Now reboot. Done!<\/p>\n<p>\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Somehow my initrd broke (read: disappeared) while installing some critical updates on my OESsp2 server. Not sure how, and I&#8217;m not sure I care, but it ticked me off. The system will not boot without an initrd! Arg! Anyway, while&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=50\">Read more<\/a><\/p>\n","protected":false},"author":5,"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":""},"categories":[12,13],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-advanced","category-oeslinux"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-O","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=50"}],"version-history":[{"count":0,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}