[ start | index | login ]

grub

Created by kron. Last edited by retep, one year and 287 days ago. Viewed 2,736 times. #9
[diff] [history] [edit] [rdf]
labels
attachments
Warning! These notes may render your system unbootable, cause data loss and/or complete system failure. Use them as your own risk!

Booting from the grub command line

Booting grub from the command line just means typing in the commands normally found in the grub.conf (or menu.lst).

For example if you were booting a Xen kernel, with a /boot/grub/grub.conf that should look like this:

title Xen
        root (hd0,0)
        kernel /xen.gz dom0_mem=196608
        module /vmlinuz-2.6.11.12-xen0 root=/dev/md1 ro console=tty0 panic=30 max_loop=96
        module /initrd-2.6.11.12-xen0.img

You would type the following to boot the system from the grub prompt:

grub> root (hd0,0)
grub> kernel /xen.gz dom0_mem=196608
grub> module /vmlinuz-2.6.11.12-xen0 root=/dev/md1 ro console=tty0 panic=30 max_loop=96
grub> module /initrd-2.6.11.12-xen0.img

Finally you issue the 'boot' command and it'll start the boot procedure with the kernel etc you specified.

grub> boot

Note: the above notes are based on having a seperate /boot partition. If you do not have a seperate /boot partition, use /boot instead of / before the filenames, e.g. /boot/xen.gz. These notes work fine on a RAID 1 setup as well.

Installing grub on RAID 1

This will install grub onto two RAID 1 disks. In this example they would be the first and second disks.

# grub
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)

Missing stage1 stage2 stage_1_5 files from /boot/grub

In RedHat, they're stored in /usr/share/grub/i386-redhat. All you need to do is copy them into place:

cp /usr/share/grub/i386-redhat/stage1 /boot/grub/
cp /usr/share/grub/i386-redhat/stage2 /boot/grub/
cp /usr/share/grub/i386-redhat/*stage1_5 /boot/grub/

They may also live in /usr/share/grub/i386-pc.

Grub Not Working, Even After A Reinstall: Removing Grub

Sometimes we have found when installing a distro (e.g. Centos4) then re-installing the distro that the boot loader is not installed, or the 'old' one is not overwritten. It appears some distros check for an existing boot loader and don't try to overwrite in.

When this is the case you will just get a grub prompt and no boot options. Further re-installs don't change this.

What you need to do is uninstall the boot loader. You can boot into knoppix and run lilo -U /dev/sda (or hda or whatever). Or if lilo is not readily available then use dd from knoppix: dd if=/dev/zero count=1000 of=/dev/sda (or hda or whatever). This will zero out the first 1000 bytes on the disk removing the partition tables and any boot loader. Do not run this on a disk when you need data from that disk.

no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.