If our GRUB problem is that the menu entries have somehow been messed up, we just need to use a little program called update-grub to rebuild our /boot/grub/menu.lst file.
Again, we boot from a live CD and mount the root partition from the operating system which last installed GRUB (from the previous slide), but this time we need to chroot ourselves into the root directory of the mounted partition before running the update-grub command. The chroot command stands for CHange ROOT. Given a directory, it returns a prompt to us that thinks it's root directory is the specified directory. This allows the tools that we run inside the chroot jail to operate within the specified directory structure as if it were booted into the operating system whose files reside within the specified directory. Before we allow update-grub to change our menu.lst, we always want to save a backup copy. Use the following command
cp /mnt/hda1/boot/grub/menu.lst /mnt/hda1/boot/grub/menu.lst.backupNow, we chroot ourselves into the right directory with the following command
chroot /mnt/hda1Next, we run the command
update-grubWe should now have a new /boot/grub/menu.lst in our chroot environment. You can open it with your favorite (text mode) editor to see if you'd like to tweak it. If it's good, then type exit to leave the chroot environment, then reboot the machine and enjoy your new GRUB menu.
![[logo]](logo.png)