Showing posts with label GRUB. Show all posts
Showing posts with label GRUB. Show all posts

Tuesday, May 28, 2013

GRUB ( The Grub bootloader )

GRUB stands for GRand Unified Bootloader. It's meant as a alternative to the widely-used LILO (LInux LOader). In many ways, it is superior to LILO. One such advantage of GRUB is that if the configuration file is incorrect or corrupted, you may still be able to boot your system. It does require a basic familiarity with using GRUB in Interactive mode.



Few methods to deal with GRUB Issues :


To restore Grub to the MBR:

$ su
< password >
# grub-install /dev/hda

To setup Grub or add new entries:

Note:

Grub uses its own naming structure for drives and partitions, in the form of (hdn,m), where n is the hard drive number, and m the partition number, both starting from zero. This means, for instance, that partition hda1 is (hd0,0) to Grub, and hdb2 is (hd1,1). Grub doesn't consider CD-ROM drives to be hard drives, so if you have a CD on hdb, for example, and a second hard drive on hdc, that second hard drive would still be (hd1).

Note that GRUB does _not_ distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.


Setup Grub:

# grub

First, tell Grub where to find the 'stage files' -- you can use Tab to show the alternatives: ( in this example hda4 )

root (hd0,3)

Now tell Grub to install into the MBR of hda:

setup (hd0)

And close with:

quit

Make or adapt the menu.lst: ( And new entries )

# vi /boot/grub/menu.lst

# Begin /boot/grub/menu.lst

# By default boot the first menu entry.

default 0

# Allow 30 seconds before booting the default.

timeout 30

# Use prettier colors.

color green/black light-green/black

# The first entry is for Linux.

title Linux
root (hd0,3)
kernel /boot/vmlinuz root=/dev/hda4 ro

# If you want, a second entry for RedHat

title RedHat
root (hd0,2)
kernel /boot/kernel-2.4.20 root=/dev/hda3 ro
initrd /boot/initrd-2.4.20

# You wish to include Windows ?

title Windows
rootnoverify (hd0,0)
chainloader +1

Emergency

If things go really wrong and you get only a grub prompt you can still boot . . . .

For Windows:

grub> root noverify (hd0,0)
grub> chainloader +1
grub> boot

For Linux ( on hda4 like in example above ):

grub> root (hd0,3)
grub> kernel /boot/vmlinuz root=/dev/hda4 ro
grub> boot



Thursday, February 21, 2013

Super Grub2 Disk and Rescatux


Super Grub2 Disk

GRUB2 is a complete rewrite of GRUB, and Super GRUB2 Disk is a complete rewrite as well. As Super GRUB2 Disk uses GRUB2, the differences between GRUB Legacy and GRUB2 also apply to the different versions of Super GRUB Disk.
Perhaps the most notable difference between Super GRUB Disk based on grub legacy and Super GRUB2 Disk is that Super GRUB2 Disk does not write to the disk at all, and so cannot rewrite the MBR. Super GRUB2 Disk can only be used to boot a broken system, it cannot fix it directly. Though once a system is booted, re-installing grub is usually just a matter of running “grub-install /dev/sda”.
While there are some features of Super GRUB Disk based on GRUB legacy that will never be included in Super GRUB2 Disk, the opposite is also true. For instance, Super GRUB2 Disk supports booting OSX, loop booting from iso files, booting an OS from USB without USB support in the BIOS, and other features that are not possible with GRUB legacy.








Rescatux


Rescatux is a GNU/Linux rescue cd (and eventually also Windows) but it is not like other rescue disks. Rescatux comes with Rescapp. Rescapp is a nice wizard that will guide you through your rescue tasks.



About Rescatux and Super Grub(2) Disk

Super Grub Disk was a tool for fixing GRUB1 (version 0.9X) or booting into your system and it’s deprecated. You can still find its downloads although they are a bit hidden in Super Grub Disk page.
Super Grub2 Disk, contrary to Super Grub Disk, is not able to fix neither GRUB1 (version 0.9X) or GRUB2 (version 1.XX or 2.XX). However you can use it to boot into many systems including Windows, GRUB1 and GRUB2 based ones.
Rescatux is a Debian based live cd that lets you fix your GRUB1 and GRUB2 installations (as per Super Grub2 Disk lacks) but does much more.