• Welcome to Jose's Read Only Forum 2023.

Setting Up Your Boot Process

Started by Donald Darden, April 30, 2008, 06:55:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Donald Darden

Admit it.  Setting up a boot process seems scary, because ... well, it IS scary.  After all, if you screw it up, you may have to set up your computer system all over again, lose what you have saved under the present configuration, and in the meantime, you will lose access to the internet and a primary support avenue.

BUT, on the other hand, if it doesn't get done, then you can't move forward or get your system to do what you want.  So let's face it, some times we just have to.

Okay, then the first word of advice is MAKE A BACKUP OF EVERYTHING.  In fact, maybe make two or three, because if your PC goes to crap, that backup is all that stands between you and the total loss of everything you had on that PC.  You don't want it to go wrong, and you want to make sure you know how to get it back on your PC after you lose the ability to boot it up as it was (worse case senerio).  I suggest you don't even mess around with backups to CD or DVD, because in the final analysis, they are not as good or as dependable as backing up to another hard drive.  So look at getting an external hard drive that can be attached by USB 2.0, FireWire, or eSATA connectors to your PC.  And find a highly rated backup solution to go along with it, such as True Image, Symantec's Ghost, or another product.

The key to backing up a Windows system is to recognize that it uses a boot loader called NTOSKRNL.EXE, which stands for NT Operating System Kernel executable file, which is what we also might call a boot manager.  It uses a hidden file called BOOT.INI that is always in the root of the CL drive to let you decide which boot process to follow.  Sometimes when you get the boot error that the file NTOSKRNL.EXE is missing, it isn't actually missing, but there might be a problem with the entries in the BOOT.INI file instead, or there may not be a valid boot sector found on the referenced drive, or a number of other possibilities could occur.

It's possible to modify the BOOT.INI file to include non-DOS and non-Windows OS boot choices.  There is a program, mentioned before, called BOOTPART on the Internet that can do this and handle most of the heavy lifting.  Unfortunately, it does not explain itself very well, so you have to read the different help sections carefully and work out for yourself how to use it.

Basically, BOOTPART wants you to identify the partitons that are bootable, then if you want to add them, you specify a binary file where it will copy the boot sector to, and use that as part of the entry that gets added to Boot.ini.  It uses asterics to mark bootable partitons, which you pick by number, and you designate the binary file name and the title that you want to have added to the Boot.ini list.  The designated binary file can have a name like Linux.bin or Ubuntu.bin if you like, but must be built at the root in the C: drive, because at boot time, the BIOS has sole recognition of drives and content, and you don't want to confuse it.

Not too hard to understand, but the instructions are a bit vague in places.

But you already have Windows installed, and right now you are on the verge of adding some distro of Linux to the mix.  Your two big concerns are that you might (1), be unable to get back into Windows, and (2) not be able to get into Linux after you install it.

But if you have backed up Windows (AND YOU HAVE, RIGHT), then the first concern is not as great.  If you elect to use Window's boot manager and boot.ini, you can even breath a sigh of relief, because installing Linux properly will not effect either.
But if you elect to tell Linux to put its boot manager onto the C: drive, which appears as (hd0) to it, or tell it to use the MBR (Master Boot Record), then it will replace your Windows boot manager with its own, and that won't use Boot.ini to identify possible boot routes.  However, the good news is that GRUB, which is the boot manager typically used by Linux today, will automatically recognize where Windows is installed on your PC and preserve that as one of its boot routes when its sets up.  So you are not going to lose the ability to get into Windows as a result of installing Linux.

Unless you foul up somewhere else.  Instead of setting up a Linux partition, you may inadvertently overwrite Windows, or possibly encounter some other problem.  It's this evenuality that the backup protects us from.

Now what GRUB does is set up folders /boot/grub on the designated boot drive, and add an entry for the Linux install that it is running from.  The file /boot/grub/menu.lst is where you find the equivalent of the boot.ini file described for Windows.  There are differences, of course.  Menu.lst includes a lot of commented tips for adding, modifying, and changing the boot experience.  But like boot.ini, the current install is added automatically at the top of the list.  You can open a Terminal Console session and type sudo -s to enable superuser mode, then enter gedit /boot/grub/menu.lst to begin editing the grub boot menu.

The area in the file between
Quote## ## End Default Options ##
Is the area that holds the current install information that was just added to menu.lst.  Below this should be the entry for booting into Windows from within grub.  And after that, in reverse cronological order of entry, are any other boot possibilities.
Note that grub does not automatically delete obsoleted boot information.

Here is a typical menu.lst boot entry:
Quotetitle      Ubuntu 8.04, kernel 2.6.24-16-generic on DRIVE_Q (/media/sdb2)
root      (hd1,0)
kernel      /boot/vmlinuz-2.6.24-16-generic root=UUID=979a2071-d3a8-4ad1-bcab-aaa3b06b5921 ro quiet splash
initrd      /boot/initrd.img-2.6.24-16-generic

Note that unlike boot.ini, grub requires several lines to allow you to qualify the boot process to be used.  The Title line can be made to say anything, but usually identifies the distro and version, kernal release, and some added tag for the release.  I added the drive label and drive designation in my entry above.

The Root entry identifies the root partition, which is where it will find the system folders and files fo rthis install.
The Kernel entry identifies the actual file and the root volume UUID, and the ro means read only, quiet means don't display normal start up messages on the screen, and the splash means show the Ubuntu start up animation screen during the boot process.

The Initrd entry initializes the ramdisk that will be used once Linux is installed.  and the final instruction of quiet appears to be optional.  Sometimes other options are presented after the initrd entry as well.

That's it.  However, in looking at the area for the latest install, you can see that there are three sets of entries, with the generic first, then a recovery mode set, followed by a memtest set.  And below the boot option for Windows, you will find progressively older entries for prior installs, and each of these also has a generic. recovery. and memtest set.  So what happens if you try to boot to a boot set that is no longer on your PC?  Well, the boot will likely fail if it cannot find the right kernel, and may get screwed up even if it can successfully boot, because changes made to support newer releases or different versions of Linux may cause real problems.

There are a couple of ways to deal with obsolete entries in menu.lst.  The topmost entry is the default, unless you specify a default based on the Title lines counted down (the topmost is 0).  You can delete all the older entries, right to the end of menu.lst.  Or you can change howmany=all to howmany=n, where n is a number to signify the maximum number of main entries allowed in menu.lst.  The recovery and memtest alternatives are not counted for this purpose.

Since grub adds entries in the reverse order of their sequence of installs, you might want to switch boot entries around so that they list in an order that helps you.  In my case, I like my boot options listed in drive designation order.  You can use cut-and-paste in menu.lst to move entries about.  And rather than keep the same generic - recovery - mentest, Windows, generic - recovery - tmetest, generic -recovery - memtest sequence that grub set up. I move the entries about so that I had generic, generic, generic, Windows, recovery, recovery, recovery, and just commented out the memtest, memtest, memtest entries, since I'm not sure I would ever use them.

The area above the boot entries in menu.lst has a lot of comments to try and help you understand some of the options that can be used, and to set some default behavour by grub during the boot process.  For instance, you can set screen colors, and you can hide or lock entries, and if you want a verbose boot process, you can get it.  You can also make it remember the last boot route and use it as thought the default for future reboots until you elect to change it again.     

So I hope this post helps you somewhat if you decide to install Linux, and are concerned about your boot issues.  I should add that you can designate an alternate device for your grub boot manager, such as (fd0) to put it on a floppy disk, or possibly onto an external drive or USB device, so that when they are plugged in that you have new boot options, or even to a CD disk.  If you do it this way, than you have to actually insert the disk or attach the device to be presented with the grub boot options.