Instalando grub desde livecd de Ubuntu This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error. (This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.) Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds. When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later) Code: sudo grub This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands Code: find /boot/grub/stage1 This will return a location. If you have more than one, select the installation that you want to provide the grub files. Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands) Code: root (hd?,?) Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1) Next enter the command to install grub to the mbr Code: setup (hd0) Finally exit the grub shell Code: quit That is it. Grub will be installed to the mbr. When you reboot, you will have the grub menu at startup. Now the explanation. Sudo grub gets you the grub shell. Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup. So root (hd?,?) tells grub it's files are on that partition. Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr. Quit will exit you from the grub shell. sudo grub find /boot/grub/stage1 (Use the output from this command in the next command) root (hd0,1) setup (hd0) quit HOWTO Restore GRUB You have windows 98 and linux on the same hard disk and you choose GRUB as boot loader.At boot time you see a menu to choose windows or linux. But one day you reinstall windows 98 and it rewrites your MBR and the menu has gone, now you only can boot windows. What to do: Put the redhat boot disk you created on the installation on the floppy drive, boot the system and run grub command Remember that for grub (hd0,1) means hda (primary controller master), second partition. Now we need to tell grub where are the grub files: If you know where they are, type something like: root (hd0,1) else if you have no idea, type: find /boot/grub/stage1 and then the root command with the correct parameters: setup (hd0) to install it on hd0, that is MBR of the first HD. type quit and reboot. The menu will appear again. If you want to make some changes to the boot menu, you must edit the file: /boot/grub/menu.lst A sample menu.lst file is this: default=0 timeout=5 splashimage=(hd0,1)/boot/grub/splash.xpm.gz title Red Hat Linux (2.4.18-14) root (hd0,1) kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi initrd /boot/initrd-2.4.18-14.img title Red Hat Linux (2.4.18-openmosix3) root (hd0,1) kernel /boot/vmlinuz-2.4.18-openmosix3 ro root=/dev/hda2 hdc=ide-scsi initrd /boot/initrd-2.4.18-openmosix3.img title WindowsME rootnoverify (hd0,0) chainloader +1 Let's see another case You have windows ME and Red Hat Linux 8.0 with ext3 filesystem on the same hard disk. But you bought a brand new bigger hard disk and used Norton Ghost to copy the partitions to the new disk. The problem is that when you boot, you could not see the grub menu :[ To repair it: If you didn't create the boot disk, boot with the Red Hat Linux CD number 1 and choose rescue mode typing: linux rescue Now you need to repair the ext3 filesystem because now it's bigger than before and the journal file must be created again First, check the filesystem: fsck.ext3 /dev/hda2 Now, create again the journaling ext3 file: tune2fs -j /dev/hda2 Now mount the root filesystem on /mnt/sysimage and run grub mount -t ext2 /dev/hda2 /mnt/sysimage cd /mnt/sysimage cd sbin grub Once started, GRUB will show the command line interface. First, set the GRUB's root device1 to the boot directory, like this: grub> root (hd0,1) If you are not sure which partition actually holds these files, use the command find, like this: grub> find /boot/grub/stage1 This will search for the file name /boot/grub/stage1 and show the devices which contain the file. Note added by: John Neuhaus If you are using a separate /boot partition, as the official documentation says: "... if you have the partition /boot and you install GRUB images into the directory /boot/grub, GRUB recognizes that the images lies under the directory /grub but not /boot/grub" Then if 'find /boot/grub/stage1' does not find the file, try 'find /grub/stage1' Once you've set the root device correctly, run the command setup: grub> setup (hd0) This command will install GRUB on the MBR in the first drive. Making a GRUB boot floppy disk When you need to reinstall GRUB you can boot with your distro CD and enter in rescue mode, but you can avoid this and reinstall GRUB faster by just making a GRUB boot floppy disk. You can create this disk right now and it will help you in the future, when problems knock your door. You will need to know where are the files stage1 and stage2, in Red Hat they are on: /usr/share/grub/i386-redhat/ Other distributions keep it on /usr/lib/grub/i386-pc/ and if you don't know where it is, just find it: find / -name 'stage1' Once located, enter into the directory, put a floppy disk on the drive (do not mount it) and type: cd /usr/share/grub/i386-redhat/ dd if=stage1 of=/dev/fd0 bs=512 count=1 dd if=stage2 of=/dev/fd0 bs=512 seek=1 Now your GRUB disk is created. Remember that this disk is not mountable, it's just a boot image, so if you want to verify it by mounting, errors will appear. Just try to boot with this disk to check if it's working.