<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: grub]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?grub</link>
<description></description>
<pubDate>Tue, 03 Apr 2007 16:17:43 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[grub]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?grub</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: howto</div><hr/><div class="wiki">
<p>
Examples of grub usage (as a reminder mostly)</p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#install">Dobrica Pavlinušić's random unstructured stuff (install)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] install} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#lvm_gotchas">Dobrica Pavlinušić's random unstructured stuff (LVM gotchas)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] LVM gotchas} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#fallback">Dobrica Pavlinušić's random unstructured stuff (fallback)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] fallback} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="install">install</h1>
<p>
Sometimes, <tt>grub-install</tt> won't owerwrite MBR. If that happends, first reinstall MBR and then grub:</p>
<pre>
install-mbr /dev/sda
grub-install /dev/sda
</pre>
<br /><p>
If you forget to make <tt>/boot/grub/menu.lst</tt> (as I did), you will have to do a <strong>lot</strong> of typing in grub console, so be sure to also run</p>
<pre>
update-grub
</pre>
<br /><h2 id="lvm_gotchas">LVM gotchas</h2>
<p>
There is also corner-case when you have <tt>lvm</tt> compiled into kernel and <tt>/boot</tt> partition on LVM. grub will be confused, and simplest solution that I found so far is to move <tt>/boot</tt> to partition. If you don't have any free space handy, you might try to move swap to LVM and <tt>/boot</tt> onto swap partition.</p>
<h1 id="fallback">fallback</h1>
<p>
After you have installed grub, you might want to configure fallback kernels. First configure different kernels, with fail-safe one as last one:</p>
<p>
<tt>/boot/grub/menu.lst</tt></p>
<pre>
default         saved

fallback        1 2

title           OpenVZ 2.6.18-028test010
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test018 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test018
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-028test007.2-ovz-enterprise
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test007.2-ovz-enterprise root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test007.2-ovz-enterprise
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-3-686
root            (hd0,2)
kernel          /vmlinuz-2.6.18-3-686 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-3-686
savedefault
boot
</pre>
<br /><p>
Here is simplier alternative:</p>
<pre>
default         0

fallback        1

title Debian GNU/Linux
root (hd0,0)
kernel /boot/vmlinuz root=/dev/md0 reboot=warm

title Debian GNU/Linux, with the old kernel
root (hd0,0)
kernel /boot/vmlinuz.old root=/dev/md0 reboot=warm
</pre>
<br /><p>
Then setup reset to default kernel (0) upon successful boot. On debian, you can just add following line in /etc/rc.local:</p>
<pre>
grub-set-default 0
</pre>
<br /><p>
You might also want to run this once by hand, so that first boot is in first kernel (most recent one presumably).</p>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>howto</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?grub</guid>
<pubDate>Tue, 03 Apr 2007 16:17:43 -0000</pubDate>
</item>
</channel>
</rss>