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."
There are pros to Lilo?
It's such a heap of crap. The only reason it's still used is because people were brought up on it.
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.
You can try GAG to see if it works with AMD64.
Taken from Usenet --
/mbr to restore a DOS mbr. That should get rid of Grub, but you
will probably still have a problem booting WinXP.
If you have a WinXP installation CD, just boot it and select the repair option and then do a fixmbr and a fixboot on the boot drive. That should re-install the WinXP mbr and boot sector. You would need something like Partition Magic to reclaim the linux partition for WinXP. I am not sure what to do if you don't have a WinXP installation CD. (Some WinXP installations only have a "recovery" CD). You could try to find a Win98 boot floppy or a DOS boot floppy and then do a fdisk
jimbo
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
If you use i386, then ditch Lilo and GRUB, and use something that works out of the box : GAG
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
You mean without WinGrub? I use it with Windows XP/Fedora Core 4 and love it.
As for LILO...never tried it.
You can hold down the "B" button for continuous firing.
LILO's "compact" option would probably have helped you out here.
"The Devil does not know a lot because He's the Devil, He knows a lot because he's old." -- unknown
It does, actually. Though fixmbr from the Recovery Console is the preferred method.
You have no choice in the matter. The end.
I Browse at +4 Flamebait
Open Source Sysadmin
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.
If you log in as root, you might see a prompt that ends in #.
:-)
If you type # in a Bash shell, the rest of the line is handled as a comment.
But it is convention to tell users to type a command and start it with a # to denote root login. If you type the # however, Bash interprets it as a comment and doesn't do anything
LedgerSMB: Open source Accounting/ERP
You can even boot windows from a non-primary drive, simply put in grub.conf in the windows section:
map (hd0) (hdx)
map (hdx) (hd0)
where hdx is the disk with windows.
You've just described the basic architecture proposed by the TCG. Microsoft is planning to use this architecture in order to implement Palladium (Palladium and the TCG are two different things).
Anyway, this concept can be traced back to the seventies. It's coming alive only now because:
-- security is much more of an issue,
-- it's just damn hard to get it right,
-- it's just damn hard to get everyone to agree on a common spec.
Regards
Nobox: Only simple products.
To load Windows, GRUB just chain-loads the bootloader on the primary Windows partition (what Windows will use as C: drive). That's actually 16 bit code, even on AMD64.
WinXP 64 bit ed may be different, but your post suggests you're using the basic XP.
If I recall correctly a definition like:
root (hd0,0)
chainload +1
should do the trick (adjusting root to match your win32 c: ). I use Fedora, so to be honest it "just works".
*HOWEVER* it sounds like you're trying to boot XP off a secondary disk. If XP thinks that disk is the primary disk (ie you installed XP then rearranged the disks), it'll get really confused when you load its boot sector, and will fail to boot. I don't know if it's an easy thing to fix - I've always just installed windows where I expect it to live (it installs quite happily on a secondary disk).
You might be able to boot the XP cd, run "fixboot" and "fixmbr" from the recovery console, then re-install GRUB from a Linux rescue CD.
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
Anyone remember XOSL? I thought it was great.
Unfortunately the Open Source model didn't work
out so great for it:
http://xosl.sourceforge.net/manifesto.html
No longer active..
Mirror of the Original Site:
http://www2.arnes.si/~fkomar/xosl.org/
The author says "Unlike the Linux boot loaders, the majority of Windows boot loaders will not allow you to load Linux."
o ft Windows 2000 Professional" /fastdetect
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="Micros
C:\linux.mbr = "Linux"
It's better to try something like Smart Boot Manager. It brings up a menu allowing you to boot from any of your listed devices.
I have used it several times when installing Linux on older laptops that do not allow CD-booting.
Grub *seems* to be undeveloped but some brave guys are developing grub-2, which looks much nicer...
http://www.gnu.org/software/grub/grub-2.en.html
It does not need to understand the fs of all systems it is to boot.
At minimum it needs to understand the fs that the stage2 files are stored.
You can then use the chainloader to boot the boot loader on an individual partition. eg the windows bootloader on your c: ntfs partition. ie the way you suggested
Of course if grub knows something about your kernel and the fs it is n, then it can do a lot more for you.
For me the main thing about grub is that it does not need to be configured in advanced, so it make a good rescue disk.
I don't have the links, but Google is your friend:
/boot partition if it doesn't natively support your / partition.
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
- 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!
I've been using grub for ages to dual boot without problems. Your bootloader is obviously misconfigured. My only question here is, how did this get modded up to informative? There is nothing informative about it. All this is, is a user who can't figure out how to configure his bootloader.
BeauHD. Worst editor since kdawson.
Oh yeah, have fun if you use lilo.
instead of:
And that is assuming the windows partition is a FAT32 partition. (No, most people STILL don't use NTFS-write support)
[!] No, I can't see my comments. They are not worthy of +3 moderation.
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.
Well, I don't dual boot but i still use LILO/GRUB. Why? Because every time I recompile a new kernel, I add a new entry to the bootloader menu so I can easily access the old kernel in case something went wrong. Or to add a "safe mode" or such that allows me to avoid to type dozens of params. It's pretty useful.
nbody2002:If you can read this you may be addicted to the internet
Hello:
I'm the author of GAG. The copyright is only for the web page itself, since GAG is 100% GPL. I put the copyright note after a problem with a spanish magazine, who published my personal photo (adding some abusive comments) without my permission.
- Install Linux on any free partition on any drive -- during the install process, dont bother installing a boot record or boot sector anywhere.
-
Copy grldr.exe and menu.lst from http://grub4dos.sf.net/ into c:\ .
-
Edit c:\menu.lst to point to the correct partition, directory, and filenames for any/all of the kernel and initrd's you installed on the linux partition:
-
Addto c:\boot.ini .
Done. Notes: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.
/sbin/lilo to update the MBR.
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
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.