I am loading Linux (Debian Lenny) on VirtualBox but there is apparently something wrong with the GRUB. When I start the system, a grub menu appears:
Then I run the following commands:
root (hd0,0)
kernel /vmlinuz root=/dev/hda1 ro quiet
initrd /initrd.img
boot
After the system boots, how should I continue to repair the grub file?
Any advice would be appreciated!
Best Answer
First (for future visitors), if you can't manage to boot into your system, pop in a Debian rescue CD or USB drive, mount your root partition at
/mnt
, and open a terminal and runso that you can type commands in your installed system. If you have a separate
/boot
partition, typemount /boot
to mount it.You should have a file called
/boot/grub/menu.lst
. If you don't, runupdate-grub
to create an initial file. The file contains “magic” comments, which theupdate-grub
command transforms into actual Grub directives. Look for the following two lines (which begin with a#
) and edit them if they don't match what worked for you:Once you've edited these lines, run
update-grub
(again, if you had to run it once to create the file).If you prefer to write
menu.lst
manually (which is only necessary in odd setups), here's how the section to boot Linux would look like: