Slashdot Mirror


The Boot Loader Showdown

Francesca writes "What utility do practically all Linux users use, regardless of their job or expertise? A boot loader. In this article from IBM, see how a boot loader works, meet two popular loaders -- LILO (LInux LOader) and GNU GRUB (GRand Unified Boot loader) -- and review the pros and cons of each." From the article: "Most simply, a boot loader loads the operating system. When your machine loads its operating system, the BIOS reads the first 512 bytes of your bootable media (which is known as the master boot record, or MBR). You can store the boot record of only one operating system in a single MBR, so a problem becomes apparent when you require multiple operating systems. Hence the need for more flexible boot loaders."

15 of 349 comments (clear)

  1. Huh? by Anonymous Coward · · Score: 4, Insightful

    What kind of study would fail to include THE single most popular and widespread bootloader in the world?

    That would be...Windows Boot Manager.

    1. Re:Huh? by TheRaven64 · · Score: 4, Informative

      The windows bootloader can boot other OSes as well. Just dd the first 512 bytes of a partition to a file and add that file as a valid target in C:\boot.ini (or use the bootpart utility to do it for you).

      --
      I am TheRaven on Soylent News
  2. AMD64 by Snoolas · · Score: 4, Interesting

    I use AMD64 Gentoo, dual booting with Windows XP Pro. Of course, LILO doesn't work with AMD64, so I have to use Grub. The bad part here is that Grub hangs whenever I try to get it to load Windows. I don't think it likes a 32 bit kernel image. So.... I have to go into the BIOS and change primary boot drives everytime I want to switch. I want a bootloader that can do that for me, or at least a way to make Grub do it. (Of course, I never really boot into Windows...)

    1. Re:AMD64 by Svenne · · Score: 5, Informative

      Of course, LILO doesn't work with AMD64

      Yes it does. It's working just fine for me, thank you very much. I'm using Ubuntu AMD64 with LILO, since I couldn't quite get the hang on GRUB which was installed by default.

      --

      Slagborr
    2. Re:AMD64 by JBMesserly · · Score: 4, Informative

      Is your Windows XP on a secondary drive? If so, you may need to add these two lines to your Windows XP entry in your menu.lst/grub.conf file:

      map (hd0) (hd1)
      map (hd1) (hd0)

      With those lines added, your Windows entry will look something like this:

      title Windows XP
              map (hd0) (hd1)
              map (hd1) (hd0)
              rootnoverify (hd1,0)
              makeactive
              chainloader +1

      Those two lines do some magic that makes Windows think it's on the primary drive, allowing it to boot up.

  3. Linux bios by goombah99 · · Score: 4, Informative
    or why not skip the entire boot loader and go straight to a linux bios

    then microsoft could write a winLoader to load windows if you wanted to dual boot your linux machine :-)

    seriosly for anyone who uses linux clusters or is otherwise uninterested in Dual boot, it makes sense to flash you roms and get it over with.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  4. Could a micro-OS bootloader aid security? by G4from128k · · Score: 4, Interesting

    Given all the concern with rootkits, backdoors, worms, spyware, et al, it would seem that a nonflash-ROM bootloader could provide a secure micro-OS that in turn checks and helps maintain the integrity of the main OS. A boot-time diagnostic and some key read-only API code segments (encompassing access to crucial functions such as encryption, hash calculation, memory access, disk access, UI access, network access, etc.) would help ensure that the main OS was not compromised and was less susceptible to malware.

    A small OS, even one with a GUI, can fit in less than a MB. Perhaps a heavily secured, stripped-down copy of some stable version of *nix could provide a high-integrity read-only core underlying a more sophisticated, extensible, and flexible full-featured OS.

    --
    Two wrongs don't make a right, but three lefts do.
  5. Re:Okay...How do I install these things... by Kalak · · Score: 4, Informative

    Backup our data, etc.

    Boot off of the Windows CD, and go into the recovery console. I always forget which command, so I do both:
    fixmbr
    fixboot

    --
    I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
  6. Re:Useful tool, but necessary article? by buckhead_buddy · · Score: 4, Interesting
    I think boot loaders in general will become a much bigger topic for the technically ignorant because:
    • Mac OS X will bring some of the most tech-phobic users to Intel in mid-2006 and much will be talked about setting up one's computer to boot different OS's if there is no "Red Box" included.
    • Boot loaders are a big security point of failure and may rise again as a popular exploit if easier targets like Word Macros ever die off. IMHO knowledge is better protection than ignorance though.
    • Declining interest in boot loaders could solidify Microsoft's goal of being the only OS people want to use. Open Source boot loaders aim for versatility; Microsoft aims for extreme ease of use and zero versatility. If the first chapter of every linux install book is how to troubleshoot your boot loader; this is great at maintaining Windows monopoly.
    Boot loaders aren't really sexy, but they are important. Hence any article that tries to build some interest in them is a good thing (even if this one may have some imperfections in it).
  7. It's fixmbr. by game+kid · · Score: 4, Informative

    Just for reference. fixboot fixes something else (NTLDR? first sector of booting partition? I forget...).

    --
    You can hold down the "B" button for continuous firing.
  8. LILO vs GRUB by 93+Escort+Wagon · · Score: 4, Interesting

    GRUB rocks. Its just too easy to render a computer unbootable with LILO (not permanently, of course; but it's still annoying). Why should I have to rewrite the boot sector just because I want to change what I call a particular boot option?

    Interesting to hear of people's GRUB problems with Windows - I've never had an issue with this. My dual boot machines have been 98SE or XP Pro alongside Red Hat or Fedora. GRUB setup works out of the box. I've got to admit I've only used multiple partitions on one disk though - never done it with different OSes on different disks.

    --
    #DeleteChrome
  9. NT Loader by teslatug · · Score: 5, Informative

    The author says "Unlike the Linux boot loaders, the majority of Windows boot loaders will not allow you to load Linux."

    I don't know what he calls a majority, but the NT loader (used by Windows NT, 2K, XP, 2003) can boot Linux. It's just that Microsoft is being a pain about it. You have to first dd the first 512 bytes of your partition, save those to a file, and create an entry in boot.ini which points to that file.
    For example:
    dd if=/dev/hda1 of=/mnt/cpart/linux.mbr bs=512 count=1

    [Boot Loader]
    Timeout=5
    Default=multi(0)disk(0)rdisk(0)partition(4)\WINNT
    [Operating Systems]
    multi(0)disk(0)rdisk(0)partition(4)\WINNT="Microso ft Windows 2000 Professional" /fastdetect
    C:\linux.mbr = "Linux"

  10. Let's see some more bootloaders! by SanityInAnarchy · · Score: 5, Informative

    I don't have the links, but Google is your friend:

    XOSL -- Xtended Operating System Loader

    Pros:
    - an actual GUI in a bootloader
    - support for loading keystrokes into the keybuffer, which gives it indirect support for simpler keystroke-based bootloaders like Lilo -- it can "type" in a kernel name for Lilo to load.
    - relatively easy to install from Win98 -- I believe it can even use a FAT partition to store its stuff on.
    - Password protection, can boot a default entry after a timeout.
    - Entirely configurable from inside the bootloader -- and it's user-friendly, due to the built-in windowing system.

    Cons:
    - Not much direct support for anything. While it can load Linux through Grub or Lilo, and it can boot CDs through SmartBootManager, it's really a very simplistic x86 bootloader with a very advanced GUI.
    - Support for booting a default requires a timeout, meaning that 90% of the time, when you're just booting the default OS, you have to wait an extra few seconds or press a keystroke -- and if you don't want to boot the default OS, you have to hit a key at just the right time to select a different one.
    - Doesn't seem to be configurable outside the bootloader, meaning if you download a howto on configuring XOSL, you have to print it out and reboot in order to configure.

    GRUB: Grand Unified Bootloader

    Pros:
    - Only bootloader I know of that supports the Multiboot spec, which unfortunately is a "standard" supported by only one bootloader (Grub) and one OS (Hurd) -- but it's still pretty cool that Grub could, in theory, insert kernel modules on boot, eliminating most initrds.
    - Contains a built-in commandline and actual FS support, so a mistyped or forgotten menu entry is no problem -- type it in manually to boot, then fix the menu entry from your main OS, not a rescue disk.
    - Powerful menu system -- the "configfile" command allows for multiple nested menus. Password protection.
    - Config file is readable an Unix-ey, and is a plain Unix text file parsed directly by Grub -- no need to type a command after each kernel update.
    - Supports booting from PXE (giving multiple netbooted images as a menu)
    - Supports booting from CD, allowing an easy menu to access multiple kernels and tools like memtest86.

    Cons:
    - Like XOSL, it lacks actual support for booting from CDs or net. You can install it to a CD or Net, in which case you can probably also boot stuff from the hard drive, but if it's run from the hard drive, it can't boot CD or net.
    - Lacks XOSL's keybuffer feature (which is probabyl unique), meaning if you want to use SmartBootManager to boot a CD, you will see the Grub menu, and then the SBM menu.
    - Since it groks FSes, you may need a separate /boot partition if it doesn't natively support your / partition.
    - Commandline, while useful, really only protects you from typos in grub.conf. It doesn't protect you from forgetting to install Grub to the MBR in the first place, or reinstalling if the stage 1.5 files got physically moved around.
    - Like XOSL, booting a default requires a timeout.

    NTLDR -- NT Loader

    Pros:
    - Already installed on Windows NT based OSes.
    - Supports NTFS, and can boot most x86 boot images if they are available on the boot NTFS partition.
    - Plain-text config file.

    Cons:
    - No native support for anything but NT and chainloading (x86 boot images)
    - Menu system is bad. It seems locked into a 30 second timeout, and like XOSL and GRUB, you have to have the timeout to have a default.
    - No native support for booting other partitions -- this can be accomplished by putting Grub or another bootloader into an image file, but it's not a trivial process, especially considering you have to redo it often.
    - Not open source. It has limitations, and you can't do a damn thing about it.

    Lilo -- Linux Loader

    Pros:
    - Dirt simple. No flashy menus or windows or FS support -- it just loads a kernel and goes.
    - Plain text config file, with a simple command t

    --
    Don't thank God, thank a doctor!
    1. Re:Let's see some more bootloaders! by Gallvs · · Score: 4, Informative

      It seems locked into a 30 second timeout

      Actually the NT bootloader timeout is configurable inside the boot.ini file:

      [boot loader]
      timeout=n
  11. The best thing about GRUB... by ceswiedler · · Score: 4, Informative

    The best thing about grub is that as long as it's correctly loaded onto your MBR (not particularly difficult) you don't really need a config file at all. Anything which can go in the config file can be typed at the command-line. That's really useful in a bootloader, which otherwise can be particularly difficult to fix when you make a boneheaded mistake. GRUB has saved me several times with this feature. It's also handy when you want to boot into a different runlevel or whatever, it's easy to edit the kernel parameters before booting.

    The other best thing is that you don't need to do much when you do something like install a new kernel or initrd; just update the config file (and you really don't even need to do that, see above). With Lilo you have to remember to run /sbin/lilo to update the MBR.

    The worst thing about GRUB is that it was written for the Hurd, and has a Hurd-centric view of disks which can be difficult to work with in other operating systems.