Installing grub in place of lilo
I want to install grub on my Debian box, currently it uses lilo. What do I need to do when I've installed grub to make lilo not boot on restart? (or to not get some sort of weird bootloader clash).
|
Welcome to LQ!!
Assuming that GRUB 0.97 is in you repositories, you should be able to simply install it with the package manager. To set up: grub ##opens the grub shell root (hd0,0) ## tells GRUB where its files are (ie the location of /boot) (I assumed first partition of the first drive) setup (hd0) ## puts GRUB in the mbr of drive #1 (LILO will automatically be removed.) |
I think apt-get will do everything automatically.
Install grub and splash images with apt-get or synaptic. #su #grub-install /dev/sda (will install to MBR) |
You still need to write the configuration file menu.lst.
Show us your /etc/lilo.conf if you want a conversion. |
Quote:
Quote:
|
pixellany,
The grub-install isn't a command in Grub prompt. It is a shell script to be issued in a Bash terminal. Thus it is issued inside the Linux and so the root would be already known. The root+setup is done outside the Linux and one can do several distros at the same time. The root+setup is more robust than grub-install because the latter is restricted by what the kernel can detect whereas the former is a loose cannon. As an example Linux now with 2.6.28 kernel can break 15 partitions limit in a hard disk and I have booted Linux distro from a partition sda130. An earlier kernel can have udev detecting only the first 15 partitions. Grub at a Grub prompt (before a Linux is loaded) can see everything and more partitions than a kernel can detect. We are going to have a lot of fun with partitions as potentially there isn't a limit. |
Examine all documentation very, very carefully.
|
sundialsvcs,
Quote:
Any Linux can be booted by Grub even without being installed inside. A Grub floppy, Grub CD or some Live CD with Grub instead of isolinux can boot any installed Linux even there is no boot loader inside. |
Thanks for the feedback guys!
Quote:
Quote:
|
Please clarify exactly what you have done. eg did you run "apt-get install grub"? Some quick Googling suggests that this should put all the files in the right place, but I can't find anything definite. ( A little voice is telling me that there is another step......)
On my machine, I have: /usr/lib/grub /usr/sbin/grub /usr/share/bug/grub /usr/share/doc/grub /usr/share/recovery-mode/options/grub /usr/lib/grub has all the files (maybe needs to be copied to /boot?) /usr/share/doc/grub has a sample menu.lst Not clear how you could have run the grub setup command if everyting was not in the right place...??? |
I first ran
apt-get install grub /dev/hda1 and then I looked for the config file, and didn't find it in /boot/grub/menu.lst, so I got all into a tizzy and in the confusion ran the grub command and then boot+setup. Hopefully I've merely overwritten some grub stuff with the grub stuff that was put there already by "apt-get install grub /dev/hda1" But I only did this because I don't know why the menu.lst isn't present. I did "find / menu.lst | grep menu.lst" and that found /usr/share/doc/grub/menu.lst But shouldn't it be either in /etc or /boot (I read somewhere that unusualy, grub stores the config file in /boot to keep its files all together). Anyway I sisnced rebooted the server and now it won't boot at all. :( |
I think you wanted "apt-get install grub". The package manager typically knows where to put things, and I don't know what "/dev/hda1" would do.
Do you have any of the directories that I listed? (To get back into the system, you'll need to boot up with a live CD) |
To install Grub a minimum of two files stage1 and stage2 are needed. They may be find in
Red Hat, Fedora /usr/share/grub/x86_64-redhat/stage1 /usr/share/grub/i386-redhat/stage1 Mandriva /lib/grub/i386-mandriva/stage1 Mandrake /usr/local/lib/grub/i386-pc/stage1 /usr/lib/grub/i386-pc/stage1 Suse /usr/lib/grub/i386-suse/stage1 Gentoo, Knoppix, Mepis, Xubuntu, Ubuntu, Kubuntu, Debian /lib/grub/i386-pc/stage1 Frugalware, Kanotix /usr/lib/grub/i386-pc/stage1 This is what I recommend (1) Get any Live CD that has Grub, boot it up, mount hda1 (may be called sda1 in newer Linux). If the Live CD has Grub the two essential files of stage1 and stage2 will be found in /boot/grub or /usr/lib/grub/i386-pc etc. Code:
mkdir /mnt/hda1 Code:
mkdir /mnt/hda1/boot/grub Code:
title Iternet dude gave this Grub conversion of my Debian in hda1 known to Grub as (hd0,0) Code:
grub Code:
mount /dev/hda1 /mnt/hda1 If Grub has been setup and does not find a menu.lst in /boot/grub or /grub directory it will defaults to a Grub prompt. There is no installed PC operating system that cannot be booted up manually in a Grub prompt. The booting instructions are exactly those in menu.lst except you need one extra statement of Code:
boot |
or use the super grub disk for menu based install
|
|
All times are GMT -5. The time now is 05:47 PM. |