LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Does lilo/grub have to be in the MBR? (http://www.linuxquestions.org/questions/linux-general-1/does-lilo-grub-have-to-be-in-the-mbr-23828/)

wincen 06-19-2002 06:26 PM

Does lilo/grub have to be in the MBR?
 
I was wondering, does lilo have to be installed to the master boot record to boot linux? What about grub? How do other operating systems boot without having a boot loader in the master boot record?

I'm just wondering because the MBR doesn't seem like a safe place to put the boot loader. If something happens to it, and you don't have a boot disk (for whatever reason) your are kinda of screwed.

trickykid 06-19-2002 09:51 PM

No you have several options. Some opt to install the boot loader in the first sector of the / partition.

You can also create a boot disk to boot into Linux instead of installing a boot loader on the actual hard drive.

But even in most cases, even if you don't have a boot diskette, you can always use the cdrom you have that you installed from, most have a rescue option, or you can usually specify your / directory to boot to from the boot: after booting to the cd.

Like my Slack box once got corrupted or something, I didn't have a boot disk so I used the slack cd.

At bootup and at the boot prompt I did something like this to boot up my system:

boot: Linux root=/dev/hda3

LinuzRulz 06-19-2002 09:55 PM

I have had a lot of success with putting lilo/grub in the first of the partition and using system commander to boot to my different OS's.

MrPolite 06-19-2002 10:04 PM

eeeh! dont put it on MBR, it will overwrite system commander. I did it once accidentally and I didnt have the recovery disks, so I reinstalled everything again :D

LinuzRulz 06-19-2002 10:08 PM

Excuse me , I mistyped. I meant to put lilo'grub on the first sector of the /partition

trickykid 06-19-2002 10:14 PM

Nah, nothing wrong with putting Lilo on the MBR if your going to use Grub or Lilo to boot from. I always install mine to MBR and never have any problems, well, maybe once or twice, usually caused by myself. ;)

wincen 06-20-2002 02:35 AM

How do you install lilo on the first sector of the / partition? Is it possible to do this after you've installed linux or must this be done before the installtion begins?

linuxcool 06-20-2002 05:17 AM

wincen, you can install lilo in the first sector of a partition when you install linux.

If you have already installed linux and put lilo in the mbr, you can edit the /etc/lilo.conf file. Look for this line boot= and change it to point to the partition where you want lilo to be installed and then run /sbin/lilo. Also, you'll have to restore the mbr by either running msdos's fdisk /mbr command or from linux /sbin/lilo -u /dev/hd??. Replace the two ?? with the correct hard drive info.

dorward 06-20-2002 08:08 AM

Quote:

How do other operating systems boot without having a boot loader in the master boot record?
They don't - they install their own boot loader there. That is why you have to rerun lilo or grub if you install Windows after Linux, the Windows boot loader gets written over it. Just because it doesn't give you options doesn't mean there is no boot loader.

jglen490 06-20-2002 08:32 AM

Quote:

I'm just wondering because the MBR doesn't seem like a safe place to put the boot loader.
Actually, it's the only place to put SOME bootloader, as far as the BIOS is concerned. If you have a bootloader other than Lilo or Grub (i.e., NT, system commander, etc.), then its executable code is in the Master Boot Record -- that's why it's known as the Master Boot Record. If you have some third party boot loader that's Linux-aware, then that's probably all you need, otherwise it will need to access a Linux boot loader to get the Linux kernel loaded.

In most cases, if you are multi-booting with Linux, all you need is either Lilo or Grub, and my personal choice is Grub ;) .


All times are GMT -5. The time now is 01:00 PM.