<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#000000" text="#ffffff">
Alan McKinnon wrote:
<blockquote cite="mid200603070108.55998.alan@linuxholdings.co.za"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">Also if you try to install grub to the wrong /boot partition it
will not make the system unbootable, it will simply fail to install
because it can't find the stage2 file.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I don't understand what you mean here. Does grub-install not keep it's 
stages in /lib/grub/<arch>, and copy stage 1 and stage1_5 to the MBR 
and boot sector, and stage2 to /boot/grub? At boot time stage1 loads 
stage1_5, which loads stage2 from /boot/grub

  </pre>
</blockquote>
<br>
Actually, stage1_5 gets installed to the free space between the MBR and
the first partition.  No boot sectors get touched. <br>
<br>
<blockquote cite="mid200603070108.55998.alan@linuxholdings.co.za"
 type="cite">
  <pre wrap="">On unbootable, this will indeed be the case if grub was installed to 
the / partition, and the bootloader is set up with root(x,y) pointing 
to the /boot partition. But this matters naught if the user did a 
default install.

  </pre>
</blockquote>
<br>
If you install grub with grub-install while /boot is not mounted, then
it will set up the menu.lst to issue the root command pointing to the
root fs, and your /boot partition will just never be used for
anything.  Essentially, you won't have a /boot partition, just a spare
unused one.  If you manually edit menu.lst and change the root to the
unused partition, then yea, you've broken your boot up, but you can
still hit escape during boot and tell grub to use the correct root.  <br>
<br>
<blockquote cite="mid200603070108.55998.alan@linuxholdings.co.za"
 type="cite">
  <pre wrap=""></pre>
  <pre wrap=""><!---->It's /boot/boot -> ./ on the partition holding /boot. Again, it's for 
dual-boot systems with more than one distro. To this day I still 
often make the mistake of getting --root-directory=/path/ wrong and 
grub presents me with a completely blank screen. Usual solution = 
reboot with Knoppix, re-run grub-install. With a minimalist grub 
backup on / I instead usually get a grub shell, which can boot. Then 
I don't have to search for the Knoppix cd (which is never handy when 
I need it). The symlink is a gentoo-ism that catches the occasional 
wrong --root-directory path. Since I started using it my grub-install 
failures are zero, one symlink does no harm and when I get it wrong 
it still gives the result I want

  </pre>
</blockquote>
<br>
I see how that would help you now.  If you specify
--root-directory=/boot then grub will look for a directory named boot
in the /boot partition, which your symlink provides.  Why bother
specifying --root-directory at all though?  I've never needed to.  I
believe if you omit the parameter then grub looks for /boot and if it
isn't there, then just installs to the root ( of the /boot partition
).  In other words, it's smart enough to figure it out if you don't try
to outsmart it ;)<br>
<br>
<blockquote cite="mid200603070108.55998.alan@linuxholdings.co.za"
 type="cite">
  <pre wrap=""></pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">as root:
mount --bind / /mnt/test
cd /mnt/test/boot/
      </pre>
    </blockquote>
    <pre wrap="">Why make an alias with the bind mount?  Just skip the mount and cd
to /boot.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
My bads, the order is wrong. 'cd /boot ; ln -s . boot' is issued 
before 'mount'. And it's --rbind, not --bind

The --rbind is to get to the files under /boot on the root partition. 
They are hidden once /boot is mounted

  </pre>
</blockquote>
But you never mounted anything over /boot.  Maybe you just forgot to
show that?<br>
<blockquote cite="mid200603070108.55998.alan@linuxholdings.co.za"
 type="cite">
  <pre wrap=""></pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">ln -s . boot
mkdir -p grub
cp /boot/vmlinuz-xxxxxx ./
cp /boot/grub/menu.lst grub/
      </pre>
    </blockquote>
    <pre wrap="">That is trying to copy /boot/vmlinuz-xxx onto itself, which isn't a
good idea.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Nope. It will copy a file from the real /boot partition to the / 
partition at /mnt/test/boot. mount --rbind does not bind sub-mounts

  </pre>
</blockquote>
<br>
If you mounted something over /boot then yes, it would copy from the
/boot partition to the /boot directory in the root partition, but I
think you got --bind and --rbind backwards.  --bind binds a single
mount point, --rbind includes all mount points under that one.  The r
is for recursive. <br>
<br>
<br>
Again though, what good does having hidden copies of /boot files in the
root fs do you?  <br>
<br>
<br>
</body>
</html>