Recipe 12.4. Installing GRUB with grub-install

 < Day Day Up > 

12.4.1 Problem

Recipe Recipe 12.3 does not work on your Debian, Gentoo, or other Linux system, because the GRUB files are installed into /usr/lib/grub. Or maybe you just want a simpler method for installing GRUB without a floppy disk.

12.4.2 Solution

Use GRUB's built-in installation script, grub-install.

First, install GRUB, or upgrade to the latest version. To get the version number, use:

$ grub  version grub (GNU GRUB 0.94)

Then run grub-install. When you have a separate /boot partition, you must specify it:

# grub-install  root-directory=/boot  /dev/hda

Otherwise, all you need is the device name for the drive:

# grub-install  /dev/hda

Then run:

# update-grub

This creates a new menu.lst. When you reboot, the GRUB menu will appear and your system will boot normally.

12.4.3 Discussion

update-grub probably won't create a complete menu.lst on a multiboot system, but it will enable you to boot into Linux. Then you can add your other operating systems to menu.lst.

12.4.4 See Also

  • grub-install(8)

  • info grub

  • The GRUB Manual (http://www.gnu.org/software/grub/manual/grub.html)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net