LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Boot loader (https://www.linuxquestions.org/questions/linux-general-1/boot-loader-265097/)

snehal_29in 12-10-2004 11:46 PM

Boot loader
 
Hi,

Is there any 1 can tell me that ho can i change my boot loader

now i m having LILO and i want to change to grub than what should i do

i have installer lilo in /dev/hda1 not in MBR of HDD in my MBR partition magics,s boot loader it shows me 1 option win98 and linux . in linux it loads Lilo

now i want to change my boot loader
please tell me what should i do

thanks
in advance

gd2shoe 12-11-2004 01:34 AM

The basic steps involved:

Make sure you have GRUB. If you have a /boot/grub directory with stuff in it, then you're fine. If not, try to see if your distro can install it for you (you might want to add your distribution to your user settings so that we don't have to guess). If it can't/won't, then you should be able to pick it up here: http://www.gnu.org/software/grub/gru...wnload.en.html

2nd, you need to put together a /boot/grub/menu.lst file useing information from your /etc/lilo.conf file. To just make it work, you shouldn't need much. You can tweak it later. Just find the section that talks about your linux boot and write down the line that mentions your kernel and initrd (if you have one). Hopefully there will be a menu.lst for you to edit and configure (post here if there isn't, sometimes it's called grub.conf). Add the following:

title Linux
kernel (hd0,0)/vmlinuz root=/dev/hda2 vga=0x317 splash=silent desktop resume=/dev/hda7 showopts
initrd (hd0,0)/initrd

This is mine. Use the information you got from /etc/lilo.conf to build yours. (hd0,0) is GRUB's way of saying /dev/hda1.

The last step is to actually change the boot loader in the hda1 boot sector from lilo to grub. This isn't hard, but I don't remember the exact command off hand. I will need to look it up.

gd2shoe 12-11-2004 02:19 AM

This isn't the way that I've done it before, but it looks like the easiest:

grub-install '(hd0,0)'
(modified to use the first partition boot sector instead of the mbr)

You will want to back up the boot sector first, in case something goes wrong. You can back this up to a file with:

dd if=/dev/hda1 of=WhateverBackupFile bs=512 count=1

This is assuming a 1/2 kilobyte boot sector (I think it is, but I'm not sure). I also think you can make it into a boot floppy with:

dd if=/dev/hda1 of=/dev/fd0 bs=512 count=1

If you try this, you will want to test it before you rely on it. You will know that it works if it boots lilo before boot magic. Again, this is to the best of my remembrance. I would enjoy being corrected if I'm wrong.



P.S. Both GRUB and LILO can give control to Win98. In GRUB you add 3 lines to your menu.lst:

title Windows 98
root (hd0,1)
chainloader +1

(Assuming 98 is in the second partition)

gd2shoe 12-11-2004 02:21 AM

P.P.S If you don't have a bootable floppy for linux, then either try to find an FAQ for it (shouldn't be hard to find) or download a live CD like knoppix (linux that boots and runs from the CD drive).


All times are GMT -5. The time now is 12:22 AM.