{"id":470,"date":"2010-01-26T15:01:11","date_gmt":"2010-01-26T20:01:11","guid":{"rendered":"http:\/\/yourlinuxguy.com\/?p=470"},"modified":"2010-01-28T07:37:29","modified_gmt":"2010-01-28T12:37:29","slug":"how-i-fixed-my-openfiler-2-3-server-after-updates-broke-it","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=470","title":{"rendered":"How I fixed my Openfiler 2.3 server, after updates broke it&#8230;"},"content":{"rendered":"<p><em>This article is written in a story-like retrospective fashion.\u00a0 (<span style=\"color: #993300;\">Update, 20100128, morning: Now with a happy ending! See below&#8230;<\/span>)\u00a0 It&#8217;s a chain of events that took me from a happy Openfiler user, to and extremely angry Openfiler user, to a cautious Openfiler user.\u00a0 So let&#8217;s begin.\u00a0 &#8220;It was a dark and stormy night&#8230;&#8221;<\/em><\/p>\n<p>It had been almost a year since I patched my Openfiler 2.3 server, and some significant updates had been released in that time.\u00a0 So after planning an outage window, I set out to apply the queued batch of updates (including <code>mkinitrd<\/code> and a <code>kernel<\/code> or two, more on that later).\u00a0 It seemed such a simple task&#8230;.<\/p>\n<p>After the patches were applied, the Openfiler server would not boot.\u00a0 Instead, it spewed out more errors than I could read to the console, ending with a kernel panic.<\/p>\n<p>So I booted to the Openfiler install cdrom, and entered rescue mode with &#8220;<code>linux rescue<\/code>&#8220;.\u00a0 Fortunately, it discovered and mounted all my partitions, and I was able to run with networking in order to reach the package sources or other sources\/destinations if I should need them.<\/p>\n<p>I noticed that the errors I had seen on the console pointed me toward missing drivers in the <code>initrd<\/code>, so I started looking there.\u00a0 While poking around, I think I noticed that the latest update bundle had re-compiled all my <code>initrd<\/code>&#8216;s in <code>\/boot<\/code>. I&#8217;m not actually 100% sure about that now in hindsight, but it&#8217;s not important now.\u00a0 Anyway, I de-constructed one of the <code>initrd<\/code>&#8216;s this way to see what was up:<\/p>\n<p><code> <\/code><\/p>\n<pre>mkdir \/tmp\/temp\r\ncd \/tmp\/temp\r\ncp \/boot\/initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img.gz\r\ngunzip initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img.gz\r\ncpio -i --make-directories &lt; initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img\r\nls -l\r\nls -l lib\/<\/pre>\n<p>Hmm.\u00a0 No drivers there.\u00a0 Should be a bunch of <code>*.ko<\/code> files&#8230;\u00a0 Hmm&#8230;<\/p>\n<p>I decided to roll back;\u00a0 so I ran <code>conary<\/code> to revert to the state before the update\u00a0 (Run &#8220;<code>conary rblist<\/code>&#8221; to figure out the number of the point-in-time to which to roll back, then &#8220;<code>conary rollback (number)<\/code>&#8221; to actually do it.\u00a0 See <a title=\"http:\/\/wiki.rpath.com\/wiki\/Conary:QuickReference\" href=\"http:\/\/wiki.rpath.com\/wiki\/Conary:QuickReference\" target=\"_blank\">this wiki page<\/a> for details).<\/p>\n<p>For some reason, this did not repair all my <code>initrd<\/code>&#8216;s, but it did seem to give me a working <code>mkinitrd<\/code> script (in hindsight, I did not think to analyze it or keep a copy of it&#8230; drat).\u00a0 So I was now able to hand-build a working <code>initrd<\/code> for one of the <code>kernels<\/code> (the most recent before the update) with this command:<\/p>\n<p><code> <\/code><\/p>\n<pre>mv \/boot\/initrd-2.6.29.3-0.3.smp.gcc3.4.x86_64.img initrd-2.6.29.3-0.3.smp.gcc3.4.x86_64.img.bad\r\nmkinitrd \/boot\/initrd-2.6.29.3-0.3.smp.gcc3.4.x86_64.img 2.6.29.3-0.3.smp.gcc3.4.x86_64<\/pre>\n<p>And now, I was able to reboot into this <code>kernel<\/code> with my new working <code>initrd<\/code>&#8230;. and this time I made backups of it in my <code>\/home<\/code> directory!<\/p>\n<p>So I proceeded to re-apply the patches bit by bit.\u00a0 I quickly realized that the dreaded <code>kernel<\/code> update was a requirement as part of the major Openfiler update, so it came back with the re-run of the last few updates anyway.\u00a0 But this time, I was ready.\u00a0 I modified the <code>\/boot\/grub\/menu.lst<\/code> to use my old trusty <code>kernel<\/code> and <code>initrd<\/code>, (<code>default=1<\/code>), and make sure my hand-made <code>initrd<\/code> was in place.\u00a0 Ok, good.\u00a0 Reboot.\u00a0 Right.<\/p>\n<p>Back up in my older <code>kernel<\/code> (phew!), but with my newer <code>kernel<\/code> installed, I troubleshot&#8230;\u00a0 I tried to build my own <code>initrd<\/code> against the new <code>kernel<\/code>, but I kept getting errors like this for each needed module:<\/p>\n<p><code> <\/code><\/p>\n<pre>\/usr\/bin\/strip: \/lib\/modules\/2.6.29.6-0.15.smp.gcc3.4.x86_64\/.\/kernel\/drivers\/rtc\/rtc-lib.ko: File format not recognized<\/pre>\n<p>I dove in to the <code>\/sbin\/mkinitrd<\/code> and found the cause.\u00a0 There are some lines in an &#8220;<code>if<\/code>&#8221; block that optionally call &#8220;<code>strip<\/code>&#8221; if present, and that is where it seems to err out.\u00a0 If &#8220;<code>strip<\/code>&#8221; is not present, it just copies the module, like I want.\u00a0 Hmm.\u00a0 I don&#8217;t know if <code>strip<\/code> was there before or not, or if the <code>mkinitrd<\/code> suddenly has this new &#8220;<code>if<\/code>&#8221; block, and I don&#8217;t care.\u00a0 I commented it out to look like this:<\/p>\n<p><code> <\/code><\/p>\n<pre>for MODULE in $MODULES; do\r\n#\u00a0\u00a0\u00a0 if [ -x \/usr\/bin\/strip ]; then\r\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/usr\/bin\/strip -g $verbose \/lib\/modules\/$kernel\/$MODULE -o $MNTIMAGE\/lib\/$(basename $MODULE)\r\n#\u00a0\u00a0\u00a0 else\r\ncp $verbose -a \/lib\/modules\/$kernel\/$MODULE $MNTIMAGE\/lib\r\n#\u00a0\u00a0\u00a0 fi\r\ndone<\/pre>\n<p>&#8230;and re-built my <code>initrd<\/code> for the latest kernel like this:<\/p>\n<p><code> <\/code><\/p>\n<pre>mv \/boot\/initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img.bad\r\nmkinitrd -f -v \/boot\/initrd-2.6.29.6-0.15.smp.gcc3.4.x86_64.img 2.6.29.6-0.15.smp.gcc3.4.x86_64<\/pre>\n<p>&#8230;and no more errors!\u00a0 Yay!\u00a0 I modified the <code>\/boot\/grub\/menu.lst<\/code> back to use my new <code>kernel<\/code> and <code>initrd<\/code>, (<code>default=0<\/code>), and I re-booted into it with no kernel panic! Yay!<\/p>\n<p>And that&#8217;s my story.\u00a0 I really hope this helps someone out there&#8230;<\/p>\n<p><span style=\"color: #993300;\">UPDATE, 20100127, evening<\/span>:\u00a0 On <a title=\"http:\/\/forums.openfiler.com\/viewtopic.php?id=4740\" href=\"http:\/\/forums.openfiler.com\/viewtopic.php?id=4740\" target=\"_blank\">the Openfiler forums<\/a>, there is talk of a fix.\u00a0 To quote a Rafiu, <em>&#8220;This was due to a strange situation where 64-bit version of binutils was  not built and the group update succeeded regardless.<\/em><\/p>\n<p><em>We have  now resolved this issue. Apologies to all that were affected by it. &#8220;<\/em><\/p>\n<p>I have not yet tested this, but I do see that the latest binutils is in the update list now.\u00a0 More to come&#8230;<\/p>\n<p><span style=\"color: #993300;\">UPDATE, 20100128, morning<\/span>:\u00a0 Yes.\u00a0 The latest set of updates at this time, *including* the correct set of binutils (2.17.50.0.6-7-0.0.2) for 64-bit, worked perfectly, and my server is still running as smoothly as ever after rebooting.\u00a0 Hooray.\u00a0 Though I will never get that Saturday night back that I spent chasing my initrd all over the place, but there you go&#8230;<\/p>\n<p>\ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is written in a story-like retrospective fashion.\u00a0 (Update, 20100128, morning: Now with a happy ending! See below&#8230;)\u00a0 It&#8217;s a chain of events that took me from a happy Openfiler user, to and extremely angry Openfiler user, to a&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=470\">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,88,87],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-advanced","category-mkinitrd","category-openfiler"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-7A","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/470","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=470"}],"version-history":[{"count":7,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/470\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}