TechRepublic : A ZDNet Tech Community

Edit boot stanzas in GRUB

Tags: Linux, Vincent Danen, Grub, stanza, kernel, Linux Tips Newsletter

  • Save
  • Print
  • Recommend
  • 45

Takeaway: Learn to use the GRUB boot manager to manipulate boot commands.

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

GRUB is a boot loader for Linux and other operating systems that's growing increasingly popular. It's even becoming the standard for numerous distributions.

Unlike LILO, the other popular boot loader, GRUB is extremely flexible. GRUB allows you to manipulate boot commands during the booting process, which can be quite a help during troubleshooting.

When you start the computer and the GRUB boot manager appears, you can halt the loading of the default boot stanza by pressing [Esc]. Then highlight any stanza, and enter E to edit it.

GRUB will offer a list of options for the specific stanza, taken straight from the /boot/grub/menu.lst file. For example, you may see something like the following:

root (hd0,0)
kernel /vmlinuz ro root=/dev/hdc5 vga=788 noapic acpi=ht
initrd /initrd.img

Use the cursor to highlight each line, and enter E to edit the line.

The advantages are obvious: If you install a kernel that hangs, you can edit the file and provide the name of an alternate kernel, or alternate options for the kernel, without first rebooting and modifying a configuration file, which you would have to do if using LILO.

Once you've edited the file to suit your needs, enter B to boot the entry. If you change your mind about editing a particular entry, press [Esc] to return to the main menu.

  • Save
  • Print
  • Recommend
  • 45

Print/View all Posts Comments on this article

Linux single hkphooey | 03/04/05
how inaccurate Jaqui | 03/05/05
Not on my machine using grub v 0.94-25 stress junkie | 03/05/05
depends on the changes. Jaqui | 03/05/05
MBR apotheon | 03/19/05
No need for LILO in MBR on dual-boot TheMonster | 01/19/06
Grub Binary Dumphrey | 10/24/06

What do you think?

White Papers, Webcasts, and Downloads

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET

SmartPlanet

Click Here