• Want to help us with this year's BoS Trials?
    Let us know before 30 June. See this thread for details
  • Looking for HSC notes and resources?
    Check out our Notes & Resources page

Editing GRUB loader in real-time (1 Viewer)

Slidey

But pieces of what?
Joined
Jun 12, 2004
Messages
6,600
Gender
Male
HSC
2005
Yo, so I need some help editing GRUB loader's commands in real-time.

It loads up, gives a list of operating systems, but they're loading at the wrong disk - I installed on the disk when it as hd2 and now it is hd0. I can edit the commands fine but whenever I press escape, it reverts to hd2. Basically how do I save?

Please don't tell me I have to go into Linux and edit some config files. That's kind of the point - I can't boot linux.

I suppose I could boot linux one command at a time but that'd be a pain in the ass.
 

Flaming Ninja

Student. Playa. Ninja.
Joined
Nov 18, 2004
Messages
93
Location
Eastern Suburbs, Sydney
Gender
Male
HSC
2006
I dual-booted Ubuntu on my Vista system, and GRUB wouldn't work at all (it couldn't find the operating systems). I couldn't figure out what was happening, but I finally tried switch my HDD positions on the motherboard, and everything worked. I think it's a bug in the Ubuntu installer. But yeah, you could try switching the HDDs. Other than that, I'm not too Linux-savvy.
 

Gecko

New Member
Joined
Oct 29, 2006
Messages
3
Gender
Male
HSC
2007
What distro of Linux are you using?

From: http://www.linuxquestions.org/linux...dia/HOWTO_GRUB_BOOTLOADER_AND_TROUBLE_SHOOTER

TROUBLESHOOTING GRUB AT BOOT MENU
1) Assumes you a menu item that no longer boots or you get to a screen that says grub at a prompt or command line. Press C for commands and press enter.
2) To find available hard drives.....and then partition info
root (hd then press tab I get 2 responses as I have 2 drives hd0 and hd1
I now type
$ root (hd0, then press tab your responses about what grub finds may be
hd0,0 ext2
hd0,1 reiserfs
etc
hd0,5 filesystem type unknown partition type 0x82 (my swap file)
You may of course get fat vfat type responses or ntfs responses for Microsoft types.

3) To find my kernel.
$ find /boot/vmlinuz and press enter
The response was (hd0,0) for me but you can have more if you have a multiboot linux system.
I tried to trick grub by command root (hd1) and then using the find command but grub still gave the correct response.....what a beauty...

4) To find my initrd
$ find /boot/initrd.gz
response for me was (hd0,0)

ALTERNATIVELY now that you know that hd0,0 is your /boot partition (in this example)
$ root (hd0,0)
$ kernel /boot/ and press TAB to show files in boot folder and I find my initrd.gz listed

The info you have just gained can now be used to either create commands to boot your linux kernel or to edit a line or two that contained some error without having to load rescue cds etc
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top