Why did these commands make my system boot to grub?

I started another thread about this to get help booting into openSUSE after Fedora rewrote my bootloader and deleted all other entries. I managed to fix it but I never did find out why the following commands caused my system to boot to the grub shell instead of the grub menu.

grub
root (hd0,3)
setup (hd0)
quit
reboot

Can anyone explain to me why these commands caused my system to boot directly to a grub shell? It’s as if there were no /boot/grub/menu.lst files for it to use, but after I got everything back to normal, the files were still there.

If it helps, this is how the drive was setup before and now, except Fedora was on /dev/sda4 and has since been deleted.

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2             263       13316   104856255   83  Linux
/dev/sda3   *       13317       14621    10482412+  83  Linux

When you are in the grub shell, you can execute commands, as if they were being read from a menu.lst file. To start the menu, try the following command:

grub> configfile (hd0,1)/boot/grub/menu.lst

Thank You,

Thanks for the reply, but that wasn’t my question. My question is why did the above commands cause my system to boot into a grub shell?

Difficult to say now that you’ve deleted /dev/sda4. Do you recall the setup command displaying some messages about finding various pieces of GRUB on /dev/sda4? If not, then it wasn’t setup properly and GRUB would not have been able to boot past stage 1.5.

root (hd0,3) would have gave an error, your fdisk does not have any sda4 entire. Not sure just what setup (hd0) would do, likely use the booted system for root.(?) Not knowing just what you were booted into when you ran the commands or what is on each partition can not even guess.

According to his post, it had a sda4 but it’s been deleted now.

setup (hd0) is a GRUB command that finds the pieces of GRUB (boot block, stage1.5, stage2) and writes the necessary information into the MBR. See GRUB doco.

Thanks for the replies. I created /dev/sda4 as a primary partition on which to install Fedora. After the install and the first reboot, Fedora was only option that grub gave me to boot to. At first, I tried running the ‘repair installation’ option from the openSUSE dvd, but I kept getting an error when I got to the section about repairing the bootloader.

So I tried the commands I posted at the beginning of this thread that I found on another thread about getting openSUSE to boot after grub has been altered.

I meant to use hd0,2 because that was how my orignal setup was, but I entered hd0,3 by mistake. Regardless, after I entered those grub commands, I couldn’t boot into anything. All I got was the grub shell. But if Fedora was installed on hd0,3, and booting fine, why did those commands screw everything up?

I finally figured out what the correct grub commands were to boot one of my openSUSE kernels and then used YaST to create a new bootloader. Then I deleted /dev/sda4 and installed Fedora as a guest in VirtualBox.