
Legacy GRUB Page
(GNU-GRUB 'Legacy' - meaning versions 0.97 and earlier)This web page is about GNU GRUB 'Legacy', and in particular how it can be used in Ubuntu Linux. GNU GRUB 'Legacy' is the 'old GRUB' , used in versions of Ubuntu earlier than 9.10 Karmic Koala. Information in this web page mainly applies to Ubuntu Hardy Heron, Intrepid Ibex and Jaunty Jackalope users. Users of Ubuntu 9.10 'Karmic Koala' and later will be booting with the 'new' GNU GRUB, popularly called 'GRUB 2', (actually GRUB 1.97). The 'new' GRUB is quite a lot different from the 'old' GRUB. Ubuntu Karmic Koala users should got to this website's GRUB2 pages, GRUB2 Pages. This web-page is part of a larger site giving examples of how to install Windows+Ubuntu Linux operating systems 'dual boot' in a computer. Illustrated Dual Boot HomePage |
The grub menu is very simple to use, even for beginners. All that is necessary for most people to do is press your 'Enter' key. If you don't press 'Enter', your favorite operating system will boot anyway after a number of seconds. If you want more time you can press any key to stop the count-down timer while you think it over and make a decision. When you're ready, just use your up or down arrow keys to highlight the line representing the operating system you want to boot and then press your 'Enter' key to boot your selected operating system. Most of the time those are the only things you need to know to be able to boot with GRUB. However, GRUB, (GRand Unified Bootloader), is much more than just an ordinary boot loader. If you ever want to do something special, or if you have trouble booting, there are a lot of options available in GRUB to help you,
1) GRUB can load a wide variety of operating systems directly by loading their kernels into the computer's memory. 2) GRUB can load 'proprietary' operating systems (unsupported operating systems like Windows) by a process called 'chainloading'. 3) When you are installing a new Ubuntu operating system, the Ubuntu installer runs programs to detect other operating systems in your computer and it sets up GRUB automatically for you. Most of the time the installation scripts work perfectly and all of their other operating systems will boot. Due to various computer technical difficulties, some computers give the wrong information and a small correction will be needed to an operating system's entry in the menu.lst file. This doesn't happen all that often when it does happen the computer users who are affected tend to make a lot of noise in web forums about it. At least they should be thankful that GRUB was set almost perfectly for them automatically. Other operating systems have boot loaders that need to be set up manually every time if you want to dual boot. 4) The GRUB Menu is completely customizable to suit different computers and individual preferences. The GRUB menu and much of GRUB's behavior is controlled by our /boot/grub/menu.lst (menu list) text files. I'll show you how to find that and some of the things you can do with it further down this page. |
| PAGE INDEX Orientation. - a guided tour of some of the most important files needed for booting Linux. GRUB's Main Menu. - the GRUB menu that you normally see at boot time. GRUB's Command Line Interface. - GRUB can function as a miniature operating system. Temporarily Edit the GRUB Menu. - how to edit your GRUB menu commands 'on the fly'. Using the GNU/GRUB shell. - GRUB as a program when the operating system is running. memtest86+. -it isn't really part of GRUB but it's accessed from the GRUB menu and I like it. Customizing Your GRUB Menu. - Edit your /boot/grub/menu.lst file, personalize your GRUB. How to make a dedicated GRUB partition.- contains only GRUB, no other files are required. How to make a separate /boot partition.-contains the Linux kernel, initrd.img and GRUB files. How to add GRUB to your USB thumb drive. - GRUB in a USB stick makes a great pet. How to make your own personalized GRUB Floppy Disk. - you can play with it and have fun. How to make your own personalized GRUB CD-RW. - portable - boots in almost any computer. Re-install GRUB with a GRUB shell. - re-install GRUB from anywhere to anywhere with anything. Re-install GRUB....................................with the Alternate CD in Rescue mode. How to back up and restore your MBR. - with a dd command from a live CD.
|
| LINKS The Linux Boot Process - a summary of what is supposed to happen before the login prompt Here's the link to GNU GRUB's homepage. Here's a link to the GNU/GRUB manual, it has lots of good information in it you can refer to. Also, here is GNU GRUB FAQ Here are some more links to some other great websites about GNU/GRUB, GNU GRUB Wikipedia, Grub Grotto by Steve Litt, GRUB tips and tricks by Jeremy Turner, Boot with GRUB by Wayne Marshall, Linux Journal. |
Orientation Here's where to find some important files to do with booting.I'm assuming you have Ubuntu or a similar Linux operating system up and running and you're just sitting there staring at your desktop. To start this tour, you go 'Places'-->'Home Folder', and then look for the 'Up' arrow two times to go up two levels in the file system, to the top of our directory tree. This what we call the 'root' of our file system. It's the big main directory (folder) that contains all the rest of them. Very often the forward slash: / , is used for short, to indicate the root file system, instead of typing out the word 'root' every time. Besides, there's also a directory there called: /root , and we don't want to confuse anybody.
In the top row of folders there's the /boot directory, we'll look inside that in a minute. While we're here, notice the two files in the bottom row? Those are 'symlinks', (shortcuts), to the Linux kernel and initrd.img files. Sometimes we use those for booting with when we don't know the exact name and location of the kernel and initrd.img. When, you open the /boot directory it should look something like the illustration below. ![]() The files called vmlinuz-2.6.12-9-386 and initrd.img-2.6.12-9-386 are the Linux kernel and the matching initrd.img that belongs with it. The Linux kernel is the nucleus of the operating system. GRUB needs to be able to load this kernel into the computer's memory to boot the system. Read more about the Linux kernel: The Linux Kernel (tldp.org, David A Rusling). The initrd.img helps the kernel get started, it's something like a road map of the file system or maybe more like a miniature model of it that the kernel loads until it is able to load the real file system. Read more: initrd (Wikipedia). The initrd and the kernel are a matched pair, we always have an initrd with the same numbers after it's name as the kernel it belongs to. /sbin/init - very important, (but not shown here), init is a program that is vital for booting. It's the first thing the kernel runs, init runs other scripts needed for booting including /etc/rc scripts. Here are two links about init, Replacing init with Upstart - linux.com, and Ubuntu's Upstart event-based init daemon - linux.com See the folder named 'grub'? Open that one now... ![]() And here's a look at what you should see inside your /boot/grub directory. These files are your important GRUB files needed for booting your Linux kernel. GRUB's stage1 file is a copy of the one that gets installed in the MBR, (sector 0 of any hard disk). This file is 512 bytes in size, the size of one sector. I don't know why it's 512 bytes. The MBR is 512 bytes in size, but 64 bytes are reserved for the partition table, 2 bytes for the 55 aa bootable disk flag, plus there's the 'Disk signature', which GRUB preserves, and possibly some other bits and pieces of code that has to avoid being trampled. The bootloader code has to be far less than 446 bytes to fit in the MBR. There are six of the stage1_5 files to choose from. Those are the files that GRUB installs to the next twenty-one sectors of the first track of the hard disk, right after the MBR. The jobs of GRUB's stage1 and (optional) stage 1_5 files are just to 'point to' GRUB's stage2 file in a file system somewhere in a hard disk partition, or if they can't, print an error message. GRUB's stage1 can also (or instead), be installed to the first sector of a partition, (called a boot sector). In that case the stage1_5 doesn't go with it, (except if the partition is formatted with ReiserFS). GRUB's stage2 file can be seen in the above screencap. The stage2 file is the main part of GRUB. That's the big GRUB file that does all the heavy lifting to get the kernel loaded into the computer's memory and boot it. The stage2 file I have is 108 KB, according to the output from the command 'ls -lhS /boot/grub', in my terminal. That's by far the largest file in this directory. Please read this brief and excellent link about GRUB's stage1, stage1_5 and stage2 files: Grub's stage2 file refers to our /boot/grub/menu.lst file for instructions to bring up our GRUB Menu for us at boot-up which offers us a list of operating systems to choose from. NOTE: That's 'menu.lst', with an 'L', not a '1', it's short for 'menu.list', not 'menu.first', (a common newbie mistake, I got caught with that one myself when I was new here, (LOL)). When we select an operating system we want to boot from our GRUB menu, we're really selecting the list of commands in our menu.lst file pertaining to that operating system. The stage2 file then uses those commands and goes into action to boot it. That's why the /boot/grub/menu.lst file is the most interesting of GRUB's files for most of us. It's GRUB's 'configuration file'. That's the one that we can edit to change our GRUB settings order to get your computer booting exactly the way we want. Another file in there that's interesting to people whose computers have more than one hard disk, is the /boot/grub/device.map file. That one shows us which hard disk GRUB thinks is our first hard disk and which hard disk GRUB thinks is our second hard disk and so on. You can't just open your /boot/grub/menu.lst file and change it and expect to be able to save the changes. That won't work in Ubuntu because of the Linux file permissions (security settings). We can edit our /boot/grub/menu.lst file if we open it from the command line. Open your terminal, go 'Applications'-->'Accessories'-->'Terminal' and either copy the command I used out of the code box below and paste it in yours or type it yourself if you prefer. Don't include the 'herman@bookpc:~$' part though, only the command after it. If you're typing your own command out by hand, make sure you realize that's an 'L' for 'list', not a '1' in the filename: menu.lst. New users often find that a little confusing. Actually, you can use 'tab completion' instead of typing entire commands. Just type the first two or three letters of the file name or command, then press your 'tab' key. Most of the time the terminal will guess correctly what it is you want to type and finish it for you. Code:
We always make a backup copy, especially the first time we edit any important configuration file. If you ever need to restore your /boot/grub/menu.lst file, just reverse the command, Code:
Now we'll open the file, Code:
After typing your password in, the menu.lst text file will open in your monitor. |
Customizing your GRUB Menu by editing GRUB's menu.lst fileYou can make your computer temporarily unbootable if you make a mistake editing your /boot/grub/menu.lst file. Don't let that scare you though, editing your /boot/grub/menu.lst file is fun. It's a bit like learning how to ride a bicycle though, you might 'fall off' a few times at first. It's interesting and educational to play with the commands in GRUB's menu.lst file. For some people it will be their first introduction to computer programming. Don't worry, it's easy. I'll show you what to do.
Below here is an example /boot/grub/menu.lst file. It contains most of GRUB's commands in roughly the order you'll see them appearing in your own /boot/grub/menu.lst files. I have hyperlinked each command so that you can click on each one to take you to an explanation about what each command does and how to use it. |
| # menu.lst - See: grub(8), info grub, update-grub(8) # grub-install(8), grub-floppy(8), # grub-md5-crypt, /usr/share/doc/grub # and /usr/share/doc/grub-doc/. ## default num # Set the default entry to the entry number NUM. Numbering starts from 0, and # the entry number 0 is the default if the command is not used. # # You can specify 'saved' instead of a number. In this case, the default entry # is the entry saved with the command 'savedefault'. # WARNING: If you are using dmraid do not change this entry to 'saved' or your # array will desync and will not let you boot your system. default 0 #fallback 5 6 7 8## timeout sec # Set a timeout, in SEC seconds, before automatically booting the default entry # (normally the first entry defined). timeout 10 ## hiddenmenu # Hides the menu by default (press ESC to see the menu) #hiddenmenu # Pretty colours #color cyan/blue white/blue splashimage=(hd0,1)/boot/grub/Ubuntusplash.xpm.gz foreground ffe4b5 background f4a460 ## password ['--md5'] passwd # If used in the first section of a menu file, disable all interactive editing # control (menu entry editor and command-line) and entries protected by the # command 'lock' # e.g. password topsecret # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ # password topsecret # # examples # # title Windows 95/98/NT/2000 # root (hd0,0) # makeactive # chainloader +1 # # title Linux # root (hd0,1) # kernel /vmlinuz root=/dev/hda2 ro # # # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST ### BEGIN AUTOMAGIC KERNELS LIST ## lines between the AUTOMAGIC KERNELS LIST markers will be modified ## by the debian update-grub script except for the default options below ## DO NOT UNCOMMENT THEM, Just edit them to your needs ## ## Start Default Options ## ## default kernel options ## default kernel options for automagic boot options ## If you want special options for specific kernels use kopt_x_y_z ## where x.y.z is kernel version. Minor versions can be omitted. ## e.g. kopt=root=/dev/hda1 ro ## kopt_2_6_8=root=/dev/hdc1 ro ## kopt_2_6_8_2_686=root=/dev/hdc2 ro # kopt=root=UUID=fe7bf845-7ce9-4733-b6de-f70f2b62076d ro ## default grub root device ## e.g. groot=(hd0,0) # groot=fe7bf845-7ce9-4733-b6de-f70f2b62076d ## should update-grub create alternative automagic boot options ## e.g. alternative=true ## alternative=false # alternative=true ## should update-grub lock alternative automagic boot options ## e.g. lockalternative=true ## lockalternative=false # lockalternative=false ## additional options to use with the default boot option, but not with the ## alternatives ## e.g. defoptions=vga=791 resume=/dev/hda5 # defoptions=quiet splash ## should update-grub lock old automagic boot options ## e.g. lockold=false ## lockold=true # lockold=false ## Xen hypervisor options to use with the default Xen boot option # xenhopt= ## Xen Linux kernel options to use with the default Xen boot option # xenkopt=console=tty0 ## altoption boot targets option ## multiple altoptions lines are allowed ## e.g. altoptions=(extra menu suffix) extra boot options ## altoptions=(recovery) single # altoptions=(recovery mode) single ## controls how many kernels should be put into the menu.lst ## only counts the first occurence of a kernel, not the ## alternative kernel options ## e.g. howmany=all ## howmany=7 # howmany=all ## should update-grub create memtest86 boot option ## e.g. memtest86=true ## memtest86=false # memtest86=true ## should update-grub adjust the value of the default booted system ## can be true or false # updatedefaultentry=false ## ## End Default Options ## title Ubuntu, kernel 2.6.20-15-generic uuid fe7bf845-7ce9-4733-b6de-f70f2b62076d kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=fe7bf845-7ce9-4733-b6de-f70f2b62076d ro quiet splash initrd /boot/initrd.img-2.6.20-15-generic quiet savedefault title Ubuntu, kernel 2.6.20-15-generic (recovery mode) uuid fe7bf845-7ce9-4733-b6de-f70f2b62076d kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=fe7bf845-7ce9-4733-b6de-f70f2b62076d ro single initrd /boot/initrd.img-2.6.20-15-generic title Ubuntu, memtest86+ uuid fe7bf845-7ce9-4733-b6de-f70f2b62076d kernel /boot/memtest86+.bin quiet ### END DEBIAN AUTOMAGIC KERNELS LIST # This is a divider, added to separate the menu items below from the Debian # ones. title Other operating systems: root # This entry automatically added by the Debian installer for a non-linux OS # on /dev/sda1 title Microsoft Windows XP Home Edition root (hd0,0) savedefault makeactive chainloader +1 # This entry automatically added by the Debian installer for a non-linux OS # on /dev/sdb1 title Windows 95/98/Me root (hd1,0) savedefault makeactive map (hd0) (hd1) map (hd1) (hd0) chainloader +1 ############################################################### # Additional GRUB tricks for fun, security, and convenience # below here are some lesser known commands some (silly)? ideas # added by me - these are not part of your stardard menu.lst # (you can try them out if you like) ############################################################### title Pretty colours color cyan/blue white/blue title Matrix color green/black blink-light-green/green title Green and Gold color black/green yellow/black title Leonardo Watermelon color black/magenta white/red title Your Boot Message Title Here cat (hd0,1)/boot/grub/bootmessage pause End of Boot Message, Press any key. title Windows Security Check root (hd0) cmp 63+1 24306344+1 title Reboot reboot title HALT! halt |
fig 7 grub
Above here is an example of a /boot/grub/menu.lst file. It should be fairly typical for a dual boot computer with one hard disk. (Except for a few lines I added at the bottom for fun). It might look a little scary to a new user when you see it all in one big piece like this. Below here I will be showing snippets of this beginning from the top and working our way down. I will point out the parts that can be edited by the user and comment on how to do so. How to Change the Default - set which operating system you want booted by the timer
The number after the default command sets which operating boots by default when the countdown timer reaches 0 if no keys are pressed on the keyboard. For dual booting with certain operating systems that seem to require rebooting very often, it can be a real pain in the neck after a while to have to be there and manually intervene every time the computer reboots. There are three possible ways to set this, choose the one you like best,
You can cut the entire Windows entry from where it is under the end of the automagic kernels list and paste it above the beginning of the automagic kernels list. Above this line: ### BEGIN AUTOMAGIC KERNELS LIST
What NOT to do- don't
paste your Windows entry anywhere inside the automagic kernels list
because it will be deleted when you have a kernel update in Ubuntu.2) edit the number for the operating system entry to be booted (by the timer) This little line controls which operating system boots by default, Ubuntu or some other operating system entry like another Linux, or Windows. If you really want to have some other operating system booting first by default, you need to have a look at the bottom section of your menu.lst file at the operating system entries. Ubuntu is entry number 0 because the GRUB numbering system begins counting from 0. (From the top of the list,counting down). To see the area I'm referring to, look at either, Count down from the top, (from just below where it says '## End Default Options ##'). Begin counting with the number 0, the number of entries containing the word 'title'. You don't count the entries the are 'hashed out' (with a # in front of them, skip those). Stop counting when you reach the Windows entry, and that number you end up with will be the right number to replace the number 0 with after the word 'default'. In this example, it will be the number 4 which you would use in place of the 0 after the word 'default' to cause Windows to boot by default. That would most likely be true for the majority of standard dual boot installations. Windows is behind the fifth appearance of the word 'title'. Don't forget, you start counting from the number 0. So it's not 1,2,3..., it's 0,1,2,3..., okay? Count each time the word 'title' appears and in this example you will see that Windows is number 4 (counting from 0). Don't be afraid to experiment if you aren't sure, this won't hurt anything if you don't get it right. All this setting does is make the highlight rectangle in the GRUB menu appear on a different line, that's all. You can easily change that again if it turns out wrong. It's a safe line to edit. 3) Edit the number and type 'saved' there instead. Use this method if you want to avoid having to re-edit menu.lst when you have a new kernel added to the list during an update. (Thus changing the number that your default operating system is on the list). Rather than just replacing the number '0' in the line, 'default 0' with another number, you can type the word saved in place of the '0'. For example:
The highlight (selection) rectangle in your GRUB Menu will appear on that line again next time you reboot. The way this works is by use of the command 'savedefault', included in most GRUB operating system boot entries at the bottom of menu.lst. When we type 'saved' rather than a number here, after 'default', it causes GRUB to save that information to the /boot/grub/default file and refer to it next time we boot. Most people would be content with that, however, if even this isn't good enough for you, it is possible to take the idea one step further and make GRUB boot only one operating system by default. Here is how to trick GRUB to only remember one particular operating system entry. Just place a # (hash mark) in front of the 'savedefault' command in the other operating system entries (at the bottom of your menu.lst), that you do not want GRUB to remember. Then GRUB will only be able to remember (save) the operating system entry that does not have the # mark in front of the 'savedefault' command. 4) fallback
For this fallback command to work, you would need to delete the '#' (hash symbol). You would probably need to make up your own numbers to put after it too. The numbering protocol for the fallback command is the same as the 'default' command uses, (already explained above), (scroll up). When the fallback command is used, if the first booting entry, (number 5 in this example), fails for some reason, GRUB will read stanza number 6, (the seventh stanza), and run those commands instead. If that boot entry fails, GRUB will try the next boot entry, and so on. When the 'fallback' command is used, GRUB goes into 'unattended boot mode'. If GRUB encounter an error it wait for the user to do something, it just skips right ahead to the next boot entry. The trouble with that is, you aren't given an error message, so it's not a command that we would want to use all the time for every-day booting. The fallback command can be very useful if you are having problems booting some other operating system, (Windows or a different Linux), and you already know your GRUB Error message, but you're not quite sure of the exact solution to your problem. You can make a whole series of trial boot entries at the bottom of your menu.lst, each with different (hdx,y) numbers in them say for example. Using the fallback command, GRUB will run through the whole list, trying each boot entry until it finds the one that works and then boot the operating system. That can save you a lot of time. This avoids the need to keep rebooting a live CD or something and re-editing your menu.lst file, possibly numerous times. That can be a very time consuming process. How will you know which boot entry worked? You could insert the 'pause' command in each of your boot entries with a short message to inform you of which entry is which. That will stop GRUB at each entry until you read the message and press 'enter'. The 'pause' command puts GRUB back into 'interactive mode' again and that means you'll see any error messages too! The way I have it set up here, this command will only work for GRUB errors. Once operating system begins to boot it's out of GRUB's hands if anything goes wrong after that and it's too late for the fallback command to do anything. Instead, you can put the 'fallback' command in your individual operating system entries, see: Booting fallback systems - GNU GRUB Manual. Then the fallback command will even work when you have booting problems in the operating system. 4) Setting the timer for the boot loader is the next subject.
Following the word timeout above, you'll see the number 10. This sets the timer for the boot loader to boot the default operating system if no-one presses any buttons on the keyboard. We can delete the number 10, and in its place type in any number of seconds we'd prefer the timer to be set to. If we want the computer to boot without waiting so long we can set it to a lower number of seconds like maybe 3, 2 or even down to 1second. If you are also 'hiding' the GRUB menu, you will have 3, 2, or 1 second to press 'Esc' to show the menu. To make the GRUB menu wait longer, type a larger number in place of the 10. If we want to turn off the timer, so that we will have an infinite amount of time to admire our GRUB menu and ponder which operating system we might want to boot today, we just 'hash out' the whole line for the timer. To 'hash out' the line, we insert a # mark before the commands and this will cause the program to ignore the whole line. Then the GRUB menu will theoretically wait forever until you make a decision, select an operating system, and press enter. (Or until there's a power failure).
Hiding the GRUB menu during bootup
The word: hiddenmenu is a grub command. In computer programming, it is often a good idea to add a comment to advise people reading the program what is going on at certain points in the program. There are special symbols in various programming languages that are used to denote a comment. In the case of GRUB's menu.lst and many other files that we edit in Ubuntu, the # symbol is a sign that tells the computer that the words after it are to be treated as comment, and not a command. In other words, they are to be ignored (skipped) by the computer. # - Hides the menu by default (press ESC to see menu' is a good example of a comment. # hiddenmenu - is an example of a command that will be treated as a comment (ignored) for now. If we want the computer to pay attention to the hiddenmenu command and to hide the GRUB menu on start-up, we could 'uncomment' the line with the hiddenmenu command on it by deleting the # symbol. Then we will not see the GRUB menu when the computer boots from now on. Example:
With 'hiddenmenu' activated, they will just see a black screen with a small timer on it. If you want to make a good job of it, set the timer down to 1 or 2 seconds and set the grub menu to boot Windows by default. The black screen will be there and gone again before anyone has time to notice it. No-one would even guess that GRUB and Ubuntu were in the computer at all. When you want to boot into Ubuntu, press your 'esc' key during this 1 or 2 second count-down, to show the GRUB menu and select Ubuntu. Add some color to your GRUB menu
GRUB's color command changes the menu colors. The line for color can be uncommented ( delete the # ) and that will cause the GRUB menu that we see when the computer is starting up to appear in pretty colors, instead of just plain old black and white. The colors cyan/blue white/blue are only the defaults, (example colors). There are quite a few other colors you can use, and you can make up your own combinations. To do that, just delete the colors given there as an example and type or type or copy-paste in your own color combinations. An easy way to experiment with the different color combinations for your GRUB menu is to use GRUB's freindly Command Line. That's a lot easier than editing your menu.lst file and rebooting every time Press 'c' from the GRUB menu when your computer is booting to get GRUB's Command Line Interface. Type the word color as a command, followed by some colors you want to try. Syntax for the color command is : color normal [highlight] and the format of each heading is: foreground/background For example,
Press 'Enter', then press 'Esc' to go back to your menu and see what your GRUB menu looks like with the colors you're testing. Then press 'c' again and try some different colors, and so on until you decide on the colors you want. When you have decided on a combination you like, boot Ubuntu and edit your /boot/grub/menu.lst with your chosen colors.
Some of the color combinations I have tried are listed below. command font&border/panel hilited font/cursor (selection bar) color black/brown blink-yellow/black color black/green yellow/black color light-green/green blink-yellow/red color black/magenta white/red color white/red light-gray/black color light-gray/blue black/light-gray
NOTE: We cannot have a pretty color grub menu and also a splashimage simultaneously, we need to choose one or the other. Add a splashimage to the GRUB menu
You can customize your GRUB with a nice splashimage (picture) for your GRUB Menu. You can either find one you like that someone else has already made and downloading it from the internet, or even make your very own unique one with GIMP! If you want to have fun making your own splashimages, I have help on how to do that further down this page. Link: Making your own splashimage If you like any of my splashimages (below) and if you trust this site, you are welcome to download any of my splashimages shown here for free. Do so at your own risk. I am sure they are safe, I made these myself. (But I copied the canonical logos and colors, I hope that's okay).
When you have downloaded your splashimage and moved it or pasted it into your /home/username directory, you will need a 'sudo' command to copy it to your /boot/grub directory. Code:
Then you need to open your /boot/grub/menu.lst file with your text editor (gedit), also using a 'sudo' command, Code:
and insert a line similar to the following, Code:
Note: If you make a mistake in the splashimage line in menu.lst, it can cause you some temporary booting problems until you correct your mistake. You might need to boot with Grub's Command Line Interface or a Super GRUB Disk to get access to the menu.lst file again so you can correct it. Another way to get out of difficulty is to run a live cd such as Ubuntu Desktop, Knoppix, Puppy Linux or the like, and mount the Ubuntu partition and edit the file that way. Mount a Ubuntu ext3 or reiserfs filesystem rescue your Linux system with a Live CD It is not unusual for inexperienced new users or even careless old experienced users to have a few hiccups with getting the command right, but once you get it all done correctly you will have a nice splashimage showing behind your GRUB menu. Making your own splashimage The excellent instructions in the following link, http://ruslug.rutgers.edu/%7Emcgrof/grub-images/, will tell you how to do everything with splashimages. That's the original and best GRUB splashimage site. That's the one I got all my information from, and is well worth reading. The only problem with that site is that the instructions were written for Red Hat Linux and need to be altered a little bit to work for Ubuntu users. Experienced users will have no problems, but for the sake of new users I'll explain some it again here in Ubuntuese to make it easier. Overview: Due to the fact that the operating system will not have started yet at the time the GRUB splashimage will be displayed, the operating system's graphics drivers will not be in operation yet. Therefore we are just relying on the simpler video capabilities of the BIOS. Since most computer's BIOSes can't handle fancy, high quality images, we are limited to an image size of 640x480 pixels and a 14 color display, (unless your PC has some kind of special new BIOS). The file type used for the image file is .xpm, and it is then compressed. This used to be done by applying a gzip command. An easier way to gzip a file in Ubuntu nowadays is to right-click on it, and click 'Create Archive', from your right-click menu. Step 1: Pick out an image to turn into a GRUBsplash. Any image file you might have will do, it can be a digital art work you made yourself, or even a picture taken with your own digital camera. NOTE: Your picture will lose quality when you follow these steps. Some pictures (photos) and digital art works that look great beforehand will look horribly ugly after they are converted into GRUB splashes. Only a few actually look better, so you can expect to produce a lot of rejects. You will need to use trial and error, patience, luck and good judgment until you learn how to choose images that can be turned into good GRUBsplashes. I think the simplest images turn out looking the best, such as cartoons, cartoon characters on a plain solid background, or other kinds of digital art with sharp edges. Even just one or two words in a nice font on a plain or colored background will do fine. Because of the pixelation, scaley creatures like lizards and dragons or fish look good. Black and white photos can be good, and can even be color- tinted for extra effect. Step 2: Make a copy of the image and work on the copy, preserving the original in good condition so you can make another copy of it and try again if things go wrong. Never use your original image file. Step 3: Open the copy of your image with GIMP in Ubuntu, and scale and/or crop the copy of your image until it's 640x480 pixels. Step 4:Carefully examine your new image to see if it needs any editing, use GIMP to touch up any faults or flaws in your image.HINT: If you want to put some words in your splashimage in fancy text using GIMP, you should first look at 300+ Easily Installed Free Fonts for Ubuntu - Ubuntu Blog by Carthik Sharma, and follow the instructions there to install some beautiful fonts for your splashimage.Step 5:Go 'Image'-->'Mode'-->'Indexed', and set 14 colors as the Maximum number of colors, and set the 'color dithering' spinbox to 'None', and click 'OK'. Then go 'File'--> 'Save as' and make up your own filename. Be sure to add an .xpm filename extension after it, click 'save', and you're all done. It's that easy! For example, you might name it something like: bestgrubsplash.xpm Any name will do as long as it has .xpm after it. Step 6: gzip your 640x480 pixel, 14 color .xpm image made with GIMP, here's the command I used to use to gzip mine, you should be able to use a similar command for yours, whatever it's name is, code:
Actually, nowadays you don't really need to use the command line for this job anymore. An easier way to gzip a file in Ubuntu these days is to right-click on it, and click 'Create Archive', from your right-click menu, then select .gz in the right-hand spinbox, and click 'create'. Step 7: Copy your .xpm.gz file to your /boot/grub directory. You can actually leave your splashimage anywhere, even in your /home/username directory, as long as you type the correct file path for it into your menu.lst file. If you do leave it in your /home/username directory just remember not to accidentally delete, move or rename it. To avoid the chances of that happening it is probably best to copy it to your /boot/grub directory. You definitely do need to use the command line for that, code:
Step 8: Edit your operating system's /boot/grub/menu.lst file with a line to make your GRUB open and display your splashimage at boot time. I already showed you how to do that at the start of this topic, go back. EXTRA TIPS: To look at your splashimages without taking the time and effort to edit your menu.lst file with each one and re-boot each time, you can load them with CLI mode GRUB when you are booting up. Just press your 'c' key for GRUB's Command Line. Then, type something similar to the following, Code:
Then press 'esc' to return to your GRUB menu to see how it looks. When finished, press 'c' again to return to the command line interface. Type the path and filename of another GRUBsplash you want to look at and press 'Enter'. Then press 'esc' to return to your GRUB menu to see how it looks. And so on... NOTE: pretty color must be disabled (hashed out) in your GRUB menu or your splashimage will refuse to display. If you have problems, check and make sure you have your color lines all hashed out in your /boot/grub/menu.lst file. We can however, change the colors of the foreground, background and border for the splashimage. This can be very effective to compliment and show off an already good splashimage and make the finished job look superb! I highly recommend reading and trying out the instructions in the next article right below here on setting the foreground, background and border colors! Setting the foreground, background and border colors for your GRUB menu. The following several commands only work in graphics mode GRUB (when you are using a splashimage). See 'pretty color' if you aren't using a splashimage. We can use the commands 'foreground', 'background' and 'border' to specify the colors of the parts of our GRUB display that show up along with our splashimage. 'foreground' means the color of the main upper left faces of all letters and the big text rectangle that has all our operating system titles in it in our GRUB menu. 'background' sets the colors used in the lower-right 'shadowing' for all the letters and the big rectangle around our operating system titles and most importantly the hilite (selection) bar that we shift up or down with our arrow keys to select an operating system to boot. 'border' gives us a chance to set a color for any parts of the screen not used by the GRUB menu. In my computer I'm using 640x480 GRUB splashes that nearly fill the entire screen. There is a column on the left that shows up and a thin line across the bottom of the monitor that shows up if I set a 'border' color that is different from my splashimage. I could leave the border color black or pick a color that will blend in with the splashimage or one that will show up if I want that effect. I imagine if I use a smaller sized splashimage the border will show more. You can pick any colors out of the sixteen color chart here in this sixteen color chart to begin with, but probably you'll want to use a 256 color chart instead ,that would be even better,
For example these can be applied something like this,
That gives me 'moccasin' lettering with 'sandy brown' shadowing and selection bar over my nice chocolate and tan Ubuntusplash. I chose yellow, ffff00 and maroon 800000 with my Aboriginal flag splashimage. The 'shade' command toggles the shadows to the right-lower side of the rectangle and font. shade 0 turns off the shadow effect shade 1 turns on the font shadows So with this command you can now choose whether you want to see the font shadows or not. You can also use these commands from GRUB's Command Line Interface (CLI) while you are booting up to try out all the colors you like and see what they look like. Just press 'c' from your GRUB menu for a command line and use the same commands to change the colors as you please, then press 'Esc' to go back to your GRUB menu to see how it looks. You can do that as many times as you like until you have a combination you are happy with. viewport If you have a nice splashimage but the rectangle in the GRUB menu that the operating system titles are printed in happens to be in the way of an important part of the picture, you can either make a new splashimage with the subject of the picture in a different spot, or you can move that rectangle. The rectangle can be moved around somewhat and made larger or smaller too. GRUB's viewport command is for controlling the position and size of the rectangle that the text fits inside in the GRUB Menu when we use a splashimage. (only available in Graphics mode). for example, viewport 0 0 66 16 gives a small rectangle in the upper left of the screen. for example, viewport 3 3 80 30 means you will have the largest rectangle in the middle of the screen for example, viewport 11 6 80 30 gives you a large rectangle in the lower right of the screen I couldn't get it to accept any numbers for a small rectangle in the lower right though, sorry. You may be able to experiment at the command line like I did until you get the results you want. The syntax for viewport is like this, viewport x0 y0 x1 y1 The numbers seem to range between, viewport 0-11 0-6 66-80 16-30 x0 sets the left-right positioning for the left side of the rectangle. In my tests the smallest number I could set for this parameter was 0 and the largest was 11, although sometimes a number less than 11 had to be settled for, depending on the other parameters. y0 sets the up and down position for the rectangle. 0 entered here makes the rectangle appear as close as possible to the top of the monitor. The number 6 was the largest number I could get it to accept, which made the rectangle lower. x1 can be in the range from 66-80 and sets the width of the rectangle. y1 can be a number in the range between 16 and 30 and sets the height for the rectangle. This command can also be run from GRUB's Command Line Interface to experiment with it until you get your viewport right for your splashimage. After that you can add it to your /boot/grub/menu.lst somewhere around your splashimage command. You should experiment with these commands at GRUB's Command Line Interface (CLI) while you are booting up to try out all the parameters until you get the viewport how you like it before adding it to your menu.lst file. Just press 'c' from your GRUB menu for a command line and use the viewport command to change the rectangle as you please, then press 'Esc' to go back to your GRUB menu to see how it looks. You can do that as many times as you like until you have a combination you are happy with. Set a GRUB password
Here's a Ubuntu Web Forums link by HungSquirrel, HOWTO: Password protect your GRUB entries. Here is a link to the Feisty Starter Guide too, 1.19.2 How to disable all interactive editing control for GRUB menu. So, if you have read those links, you probably understand that you should:
It will help to keep casual 'snoops' out, and it will probably be enough to slow down an ordinary spy. Sometimes if you can slow someone down, that's enough to deter them, they may be afraid of being seen by surveilance cameras or being caught by someone enexpectedly entering the room. If you're up against a more determined type of spy though, or if you have information that's valuable or confidential, you should look into some better security arrangements, such as an encrypted file system at least. For further reading see: Ubuntu Security - by bodhi.zazen Examples
It's just to show you a couple of examples of how an operating system entry should look. The line at the bottom of this table is to let people know that they should put operating system entries that are 'static' (in other words, ones that are not to be automagically updated), either above the start of the automagic kernels list or after it, but not in it. You can paste your Windows entry here if you want Windows to be first in the list and boot by default. Your Windows entry to be automagically deleted every time Ubuntu is updated with a new kernel if you paste it anywhere between the beginning and the end of the debian automagic kernels list. (Well, it shouldn't have been there in the first place). Many users don't understand that and blame GRUB or Ubuntu for their problems.
Other Operating System Entries
Other operating system entries are normally added here, below the end of the Debian Automagic Kernels list, or else above the start of the Debian Automagic Kernels list. These can include boot entries for foreign operating systems such as certain 'proprietary' systems and/or additional installations of Ubuntu and other GNU/Linux distros.
|
Ubuntu Operating System Entries title
uuid
Your /boot partition is defined as the partition your linux kernel resides in. The uuid command replaced the old 'root' command, which used to need a partition number after it, such as (hd0,1) or something like that. Sometimes if there was more than one kind of disk it could be confusing which kind of disks should be numbered first. Some computers number the IDE drives first, followed by the SATA drives, and if there's a USB drive plugged in, it will be numbered last. Unfortunately for GRUB, not all computers are made the same when it comes to numbering different kinds of discs, and they don't always send a clear signal to GRUB about their intentions. The uuid command solves a lot of problems, now GRUB is much better at finding the right device. You can also use the 'uuid' command from GRUB's Command Line Interface to get a list of file system UUID numbers 'on the fly' and then boot, For example,
kernel
The path and name of the linux kernel must be in the line following the kernel command. There must be no spelling mistakes or syntax errors. One miniscule mistake and your operating system won't boot. In times of olde, this had to be typed in by hand after every kernel update. Now we have the debian automagic kernels list and the update-grub script to write our new menu.lst when we are given a new linux kernel. If you do ever need to edit this line for any reason, just be careful. (It's easy to fix again though). The 'root=' command is followed by the UUID number for your operating system's 'root' partition. The 'root' partition is defined as the partition which contains the operating system's /sbin/init file. After that come 'kernel options', where you tell GRUB how to handle the kernel if you want it loaded a special way. Another way to get a list of these UUID numbers in case you ever need to know that to edit your menu.lst file is to boot your Ubuntu 'Desktop' Install/LiveCD and run the command 'blkid', or 'sudo blkid', For example: You may need to use the numbers listed by the 'blkid' command to edit your /boot/grub/menu.lst file.
You can easily set your own file system labels with Parted Magic or GParted LiveCD, or Gnome Partition Editor in your Ubuntu Live CD. You may also want to refer to this website's File Systems and Mounting Page for more info on setting file system labels. initrd
In the line following the initrd command, you need to have the exact path and filename of the initrd.img that matches the kernel you're going to boot. savedefault
The 'savedefault' command isn't important, you can boot just as well without it. It's only used if you type the word 'saved', after the 'default' command, up around the top of your menu.lst file, default. recovery mode
When you boot into recovery mode your computer will boot up without the splash screen that hides all the text the kernel prints out us as it is booting. If it stops booting half way somewhere and gets stuck, you can at least see what stage it stopped at, and that might help you diagnose the problem. Hopefully it'll boot all the way though, and when it does, you'll be offered a menu. You can,
Hide items in the GRUB Menu
Here's an example thread about that, Grub menu.lst shows 2 Linux kernels Sometimes, we end up with a big long list of old kernel entries that we're never going to use. You probably don't need to see all of those entries every time your computer boots. They can get in the way of other boot options at the bottom of the list that we might want to see without scrolling, and our menu.lst file will get messy.
I'm more adventurous, and I normally just delete the lines for them from my menu.lst file completely, I can always find them again by searching for them with GRUB's Command Line Interface if I ever need any of them. If you don't like having old kernel entries left in your boot menu at all in the first place, you can limit the number of kernel entries that show up here by using the # howmany=all setting in the automagic kernels default options section. That's all most people need to do, especially if you have enough room on your hard disk. It's easiest and probably best to just leave old retired kernels and initrd.img files alone and let them remain in the file system just in case we might ever need them again for any reason. If you have Ubuntu installed in a very small hard disk or a USB flash memory drive and you're cramped for disk space though, you can remove old kernels by uninstalling them with Synaptic Package Manager. Sometimes people with a separate /boot partition run out of room in their /boot partition and might need to uninstall a few old kernels. Old kernels don't take up very much hard disk space, when you add on the initrd.img files that are supplied with them do take up some. A typical kernel for Ubuntu is a little too big to fit on a floppy disk, but the initrd.img file is a quite a bit larger. You can use ' ls -lhS /boot ' if you want to see for yourself. For example,
Here are a few links about how to uninstall old kernels, if you have to, Remove Ubuntu Kernels You Don't Need - Tombuntu, Removing Those Extra Kernels in Ubuntu -Alter Ego, How to: Linux delete or remove kernel - Nixcraft, and, Remove Old Kernel From Ubuntu - Lahiru Sandakith’s Web Log. Once again, it is probably not worth the time and effort for most people who have normal sized hard disks to bother uninstalling old kernels. Only someone running Ubuntu in a flash memory device or very in a very small hard disk would probably feel the need to do that. memtest86+
We can run the memory test when a computer behaves strangely and won't boot. A memory test can be very useful to find out if a memory module could be faulty, memtest 86 + |
Windows Operating System Entries
Windows normally has its entry placed at the bottom, it should not be
included in the automagic list. The divider at the bottom of the
automagic kernels list is there to protect the Windows entry from being
automagically deleted when the automagic kernels list updates itself.
These commands are: title The title command means the words on the line after it will be displayed as a boot option in your GRUB menu. You can replace the words on that line with anything you like and your computer will still boot up okay. You'll just see a different message in your GRUB menu. root or rootnoverify I'm not being rude, (LOL) . The 'root' command tells GRUB what hard disk and partition it is supposed to find for you. The numbers ands letters following the 'root' command describe your hard drive and partition location in GRUB notation, like '(hd0,0)' for example. That's H D zero zero. There's no such thing as a 'drive C:\' to GRUB, or to Linux either for that matter. You might as well pin a tail on a donkey as talk about drive C:\ because the term is completely devoid of meaning except to describe partitions relative to the particular Windows installation you're getting the description from. If you have several Windows installations in in primary partitions the same hard disk, every one of them will think that it is the one that's in 'drive C:\'. Don't bother trying to describe your booting problem in a Linux forum by using Windows terms like drive letters. (LOL). We need to know in Linuxese, like: '/dev/sda1', or in GRUB-speak, like: '(hd0,0)'. Here's a link to a table for converting between Linux and GRUB notation, A Quick Guide to GRUB's Numbering System. If you have your Windows partition formatted with the FAT32 file system, it is recognized by GRUB and GRUB can 'read' it, so you can use the 'root' command. If you have your Windows partition formatted with the NTFS file system, you might still be able to use the 'root' command, but it has been known to cause error messages. The NTFS file system is not supported by GRUB. If you have NTFS, it's more proper to use the 'rootnoverify' command instead. That still tells GRUB which partition you want to find, but tells GRUB not to bother to looking at the file system. GRUB really only needs the location of the boot sector anyway, which is the first sector of the partition, and that comes before the beginning of the file system controlled area. savedefault The 'savedefault' command is an important command for Windows users who are dual booting with Linux. Windows is an operating system that has the annoying habit of wanting to be rebooted all the time, at every little hiccup. Gah! (I hate that!). Anyway, if you must use Windows, you can ease your pain a little bit by editing the 'default' setting, which is up near the top of the /boot/grub/menu.lst file. Here's a link, default. The presence of the 'savedefault' command here enables the setting 'saved' to be useful after the 'default' command, and that's a very good way to set your GRUB menu up for Windows users. That way, GRUB will remember which operating system you booted last time and will automatically keep on booting the same one until told otherwise. makeactive Most Windows operating systems can't boot without the 'boot flag'. (I am told that some can). The 'makeactive' command will try to set the 'boot flag' or 'active flag' in the partition table on the Windows partition that you want to boot. The 'makeactive' command is mainly needed when there are two or Windows installations in primary partitions in the same hard disk. If you only have one Windows installation, the 'makeactive' command is just there to make sure, but it really shouldn't be needed. GRUB's 'makeactive' command only works for primary partitions, so if you have Windows in a logical partition, you need to delete the 'makeactive' command and set the 'boot flag' on the partition with a partition editor instead. If GRUB tries to do it, it will error out and fail to boot your operating system. chainloader +1 GRUB's 'chainloader' command is special because it loads whichever boot sector the earlier 'root' command directed GRUB's attention to. In simple words, GRUB boots the Windows boot loader by its boot sector, which then boots Windows. Windows calls the first sector of it's partition a 'boot sector', and it cannot be booted (easily) without it . The boot sector contains Windows boot loader code which leads to the Windows boot loader, and thus hands over the task of booting to Windows's own boot loader. GRUB doesn't actually boot Windows at all, it only acts as a 'boot manager', and relays the signal to boot up. Trouble booting Windows If you run into trouble booting Windows caused by GRUB and you need Windows in an emergency, you can use Super Grub Disk to help you boot Windows. Super Grub Disk Page. If you run into trouble booting Windows and you need Windows in an emergency, and GRUB is booting your Windows boot loader but your Windows boot loader can't boot Windows, the best thing to do first is run a file system check. You can do that by booting your the Windows XP Recovery Console, and running CHKDSK /R. If you still can't boot, Microsoft has a link that might help you. It tells you how to make your own Windows NTLDR boot floppy disk for Windows XP or earlier, with NTLDR, NTdetect.com, and an editable copy of boot.ini in it. How to create your own boot disk for Windows XP. That will bypass both your MBR and boot sector, (in case those are damaged or misconfigured), and boot your Windows XP regardless of whether the three vital boot files are missing or corrupted. So it's a very powerful tool! Unfortunately, it's only good if your computer has a floppy drive though. Here's a better link, How to fix: NTLDR is missing, press any key to restart. - Tiney Empire, from that site you can download an NTLDR CD, floppy or USB files already made for you with a generic version of boot.ini that will boot your Windows almost no matter what!Vista users, here is another useful link: Windows Vista Recovery Disc Download - Neosmart.net, thanks lswest for the link. Thanks for the download to Computer Guru, of NeoSmart Technologies (the developer of EasyBCD). When you have time, take note of the error message you had and go to the Trouble Shooting section of this web page. There, you can look for your error message and hopefully learn how to fix it. You can also go and get help at Ubuntu Web Forums, especially if your problem is somehow related to your having installed Ubuntu in your computer. Entries that sometimes need to be corrected for grub to boot Windows. Chainloading Windows on a non-first hard disk code:
GRUB's 'map' commands make it easier when you have Windows in a non-first hard disk, (the second, third, or fourth ... hard disk, and you want to boot Windows from GRUB without the need to go and edit boot.ini, or whatever configuration file your Windows system uses. Since GRUB numbers everything by counting up from zero, (hd0) means your first hard disk and (hd1) is short for your second hard disk, (hd2) is for third hard disk, and so on ...
The 'map' commands mean GRUB will confuse Windows with a quick 'pea and shell' game, and then tell Windows it's in the first hard disk. Windows will believe that and will behave itself and boot up properly then. People wanting to dual boot with two (or more) hard disks should read this great thread and links provided from it on the subject in Ubuntu Web Forums. Thanks confused57 and lha,catlett and all participants for the information in these threads. Dualboot Two Hard Drives Here is is a post by lha about how to install Ubuntu with Windows in a computer with two hard disks without overwriting the IPL for the Windows boot loader in the first hard disk's MBR. If you feel comfortable with reaching inside your computer and unplugging your hard disks physically and changing jumper settings around then possibly this idea would suit you. This is a very good method if there is an extra hard disk available. Particularly note post #6. More than one Windows on the same disk
The hide commands don't work for Vista, but they work well for all other Windows: Windows XP, Windows 2000, WIndows 98, Windows 95, and so on. Windows has a big problem with setting up a dual boot. If you have a Windows operating system already on your hard disk, and you add another Windows, the older installation will become the 'boot partition' for the newer installation. What that means is, the vital boot loader files, NTLDR, NTdetect.com, and boot.ini will be copied out of the new installation, and into the old installation. The new installation will be installed in a logical partition instead of a primary partition. Crazy! That's called a 'Microsoft default dual boot' setup. The first big problem with that is you we not warned about it. Secondly, the vital boot loader files are in the older, and weaker, operating system. Quite often people delete their old Windows 98 say for example, to install Ubuntu dual boot with Windows XP and XP won't boot. WHY? Because they weren't aware that they deleted their boot loader files when they deleted Windows 98! The same thing still happens with Windows XP and Vista. If you want to install more than one Windows in the same hard disk, do it the right way, use GRUB. You use GRUB's 'hide' command to change your partition table so the new Windows won't recognize your previous, existing Window installation. The new installation will go in as per normal, and it will retain it's vital boot loader files. Now when you want to boot your old Windows, you 'unhide' it, and 'hide' the new one. When you want to boot your new Windows, you 'hide' your old one, and 'unhide the new installation. This makes your two Windows installations independent of one another. That's a much smarter way to do things, the last thing you want is to have both of operating systems go at once because one was Dependant on the other to boot through. There's a nice website explaining all this much better then I can, read this link, Understanding MultiBooting and Booting Windows from an Extended Partition. The hide commands don't work for Vista, so you'll need to unplug the other hard disk(s) and install Vista by itself. If you did make a mistake and delete your Microsoft 'boot partition', you might need a special boot CD or floppy disk to boot Windows with for now until you can fix the problem. Microsoft has a link that might help you, it tells you how to make your own Windows NTLDR boot floppy disk for Windows XP or earlier, with NTLDR, NTdetect.com, and an editable copy of boot.ini in it. How to create your own boot disk for Windows XP. That will bypass both your MBR and boot sector, (in case those are damaged or misconfigured), and boot your Windows XP regardless of whether the three vital boot files are missing or corrupted. So it's a very powerful tool! Unfortunately, it's only good if your computer has a floppy drive though. Here's a better link, How to fix: NTLDR is missing, press any key to restart. - Tiney Empire, from that site you can download an NTLDR CD, floppy or USB files already made for you with a generic version of boot.ini that will boot your Windows almost no matter what!Vista users, here is another useful link: Windows Vista Recovery Disc Download - Neosmart.net, thanks lswest for the link. Thanks for the download to Computer Guru, of NeoSmart Technologies (the developer of EasyBCD). Consult the GNU GRUB manual or get help at Ubuntu Web Forums if you still have problems. |
| Operating System Entries for Multiple Booting Linux Systems Here are some tips about the best way to use Ubuntu's GRUB menu for booting more Linux distributions in the same computer if you want to multiple-boot. A few people like to do that so they can test the latest pre-release version of Ubuntu or to try out other Linux distros just for fun. We can use the GRUB Menu from our Ubuntu operating systems to boot as many other Ubuntu or other Linux systems as we like. If there are already other operating systems in the computer when Ubuntu is installed they will be automatically added to the GRUB menu of the new Ubuntu installation. That suits most people fine, and works well enough for a while. The only problem is the type of commands Ubuntu uses in it's GRUB menu for booting other Linuxes, or even other Ubuntus. Ubuntu's GRUB boots other Linux operating systems by their specific kernels. When Ubuntu itself receives an updated kernel, it automagically updates it's own menu.lst file to boot the latest Ubuntu kernel. When your other Ubuntu system or other Linux distro receives a kernel update though, these are not able to be updated automagically. You have be aware of this and remember to update your menu.lst in Ubuntu manually or you will be booting your other systems by their old obsolete kernels. There are three possible solutions to this minor problem. 1. Chainloader boot entry GRUB's 'chainloader' command is the King of multi-booting commands. The chainloader command is used to boot another boot loader. The chainloader command hands over control to the other other operating system's boot loader at the other operating system's partition boot sector. The other boot loader can then boot whatever operating system it belongs to, (or any others listed in it's menu). Since the other boot loader's menu is kept up to date by it's own operating system, it should always automatically boot the most recent kernel. In order for this to work, the IPL or stage1 file for a boot loader needs to be installed in the boot sector of the other operating system's partition. Normally, Linux Operating Systems don't have anything installed it their boot sectors unless we install it there ourselves.
Here's an example of a typical chainloader booting command, code:
It is also possible to chainload the MBR in another (non-first) hard disk or even in an external USB drive or a pen drive, as long as there is some bootloader or boot manager with its IPL installed to the MBR you plan to chainload. code:
Here's an extreme example of the use of GRUB's chainloader command, by saikee, a moderator in JustLinux Web Forums, A grub menu booting 100+ systems of Dos, Windows, Linux, BSD and Solaris. Also by saikee, How to install and boot 145 operating systems in a PC. - JustLinux Web Forums. I highly recommend the above links for anyone interested in multi booting. 2. Symlink boot entry A third method that works very well would be to make an boot entry that will boot the other Linux by it's symlinks, and not refer to it's kernel or ramdisk specifically. Almost all Linux operating systems have symlinks to the kernel and initrd.img files in the root of their filesystems. A few might not. Obviously you will only be able to use this method if there are such symlinks provided, or if you can make them yourself. The advantage of symlink booting is that it is very reliable. Even if there is a problem with the GRUB menu in the other operating system and you cannot boot that OS any other way, symlink booting will almost always work. Here's an example of a symlink boot entry, code:
Can you see that I have altered the 'kernel' line to refer simply to to /vmlinuz, which is a symlink, rather than a specific kernel like '/boot/vmlinuz-2.6.15-23-386'? Also, the initrd line has been simplified to '/initrd.img' rather than a specific file like '/boot/initrd.img-2.6.15-23-386'. The symlinks always point to the most up to date kernel and initrd.img files, so there is no need to worry about updating your GRUB menu after a kernel update in your other system when you are using symlink booting. 3. Configfile Boot Entry The 'configfile' command can be used sometimes, but only when the other system you want to boot uses the same version of GRUB boot loader as the one you're currently using. Some other Linux Distros, such as OpenSuse and Linux Mint and a few others, use modified versions of GRUB with 'gfxboot' (fancy graphics) feature, which might not be compatible with our GRUB, I'm not sure. On the other hand, Ubuntu's GRUB is has the more advanced uuid support feature. Some other operating systems will choke on the uuid command, because their GRUB might not be updated with the ability to handle that command yet. And then there are a few people already experimenting with GRUB2, even though it's nowhere near ready yet, (at least not at the time of writing this). I used to like the configfile command best, but now I'm forced to derate it to the third place in my choice of multi-booting commands. The configfile command will tell GRUB to find the other Linux's menu.lst or grub.conf and run the commands it contains to boot any operating system with. Since that will be maintained by the OS it belongs to, it should always be up to date. An advantage of using the configfile command is, all other operating systems listed in the other GRUB menu can be subsequently booted. You can use as many different GRUB menus as you like. The stage 2 file that will be used will be from the first operating system's GRUB. Following is an example. code:
Where: /boot/grub/menu.lst is the exact file path and filename of the configfile for GRUB to load. You may need to check what directory path other distros use for keeping their grub menu.lst in, it could be /GRUB , for example, (no /boot folder, and /GRUB with capital letters). Also, the filename might not always be 'menu.lst, it could be something else, like 'grub.config' or the like. You will need to find out somehow, and alter the details following your configfile command accordingly. To speed up booting, you can turn down it's timer and hide it's GRUB menu if you like. Or, the opposite, take advantage of the opportunity to display another nice GRUB splashimage instead. You can have a lot of fun with the configfile command and make entries in the other GRUB menus that refer back to the first GRUB menu. You can also make more menu.lst files of your own and call them 'menu.2nd' or some other name and use them for experimenting with other GRUB commands, for example different splashimages or pretty colors. NOTE: Sometimes when we try to use an older version of GRUB to boot using the menu.lst of a more modern version of GRUB, the older GRUB can't understand the new GRUB's commands. For example, WinGrub can't handle Ubuntu Grub's 'savedefault' commands, and give it boots to grub error 26: Disk read error if it encounters the 'savedefault command. WinGRUB Page. GRUB from Ubuntu versions earlier than Intrepid Ibex can't cope with the uuid line in Ubuntu's booting stanza, and give Grub error 15 if the configfile command is used to boot with a newer menu.lst from an older GRUB. Try using the chainloader command instead. |
| ############################################# Additional GRUB Menu commands for fun, security and convenience. color_
We can change the colors from a title in our GRUB menus to some other color if we use a title command to give our color scheme a name. For more colr ideas, See: 'Add some color to your GRUB menu'. Colors won't work if we already have a splashimage enabled because that over rides the color command and puts GRUB in graphics mode. cat and pause
The 'cat' command is probably named after Linux's 'cat' command. According to my information, the word 'cat' in this instance is short for 'concatenate', which means something like hitching things up in a series, like making a train or a chain, or a string of beads. I guess they mean gathering up bits and bytes that are scattered around the hard disk and assembling those into a file that we can read in the computer screen. The cat command is for displaying a message in the computer screen. It can be inserted anywhere in your menu.lst file, as long as it's somewhere under a line that begins with the word 'title'. You can insert a message in any operating system entry or anywhere you like. In this example, the message has it's own title, just for demostration purposes. The 'pause' command follows the 'cat' command to make the message stop on the screen long enough to read it. Any words or characters you type after the pause command will also be displayed on the computer screen. When you press any key you'll be back in your GRUB Menu again. You can use the 'pause' command by itself if your message is 80 characters or less, (short enough to fit in one line). Following the word 'cat', we need to put in the path and file name to whatever file we want to be diplayed on the screen. It can be an 'absolute path name' to a file, or a 'block list'. An 'absolute path name is like: (hd0,1)/boot/grub/bootmessage A 'block list' is the location of a file in sectors from the beginning of a hard drive or a partition. (More about that later). GRUB can see any file in any hard disk, and it doesn't even need to be inside a formatted partition, GRUB can even read raw areas of the hard disk, such as the MBR, the first track of the hard disk, and boot sectors. In this example, I have a text file that I made with a message on it, which I coped to my /boot/grub/ directory in the second partition of my first hard disk. Below is an example boot message,
The only important thing about the message is, it will be limited to 80 characters per line and the maximum number of lines will be 23. You can copy mine (above) and use it for a template if you like. You can use more cat and pause commands if you need a longer message. You can have fun with the cat and pause commands and I'm sure you will be able to come up with all kinds of novel ideas is soon as you play with it a bit and get the hang of it. cmp
Windows viruses often write to the Windows boot sector so the virus will load at startup and take over control of the operating system before the antivirus program has a chance to wake up. There's a backup of the boot sector in the sixth sector of a Windows partition formatted with the FAT file system. In the NTFS file system, the backup bootsector is in the last sector of the partition. We can find out what sectors are the first and last sectors with 'sudo fdisk -lu' command in Ubuntu. The boot sector is almost always number 63 because the first partition never starts until the end of the first track of the hard disk. If you compare your boot sector with the backup and find they are both identical then that's fine. If you do the same thing another day and there's a difference, and you can't remember doing anything to your boot sector yourself, beware! The numbers after the word 'cmp' in this example, tell GRUB to start counting from (hd0), which is the MBR of the first hard disk. The MBR is in sector zero. It counts to 63 then reads one sector. Then, (starting from zero again), it counts up to 24306344 and reads one sector and compares both sectors. If they match, nothing happens. If there's any difference, GRUB will display what the differences are. The output is unintelligible human beings, but it will certainly be enough make you aware that something might be wrong.
There's always the chance that files could be changed during an update though. If you're serious about security, you probably have Ubuntu installed in an encrypted file system and therefore you'd have a separate /boot partition. In that case you can't use the cmp command from the GRUB menu, but you would be able to from a GRUB Shell, after the operating system has booted. The kernel will be in the /boot partition, so GRUB would be able to compare your kernel with a backup of itself in some other partition. I haven't finished testing that yet. More experimening will be needed before I would say that will work for sure. reboot and halt
I find it convenient to have those two commands at the bottom of my menu.lst file. |
A Quick Guide to GRUB's Numbering System
The GNU GRUB manual contains a lot more information than can be put on this page. |
Getting Help
If you aren't sure how to edit your GRUB menu.lst to get an operating
system to boot, you can usually get help from other users at Ubuntu forums.You should provide a copy of the bottom section of your menu.lst file, (all the operating system entries), along with a copy of the output from sudo fdisk -l or sudo fdisk -lu to enable someone to help you.
The output from 'sudo blkid' might also be useful,
The Grub manual contains a lot more information than can be put on this page. |
Editing GRUB's device.map Here is what the GNU GRUB Manual has to say on the device.map file, 15.3 The map between BIOS drives and OS devices. That was written quite a long time ago. Nowadays we have the uuid command in GRUB and use UUID= (file system Universally Unique IDentifiers) to direct GRUB to our /boot and / (root) partitions. Hardly anyone gets GRUB error 17 anymore. See Operating System Entries for more on UUID numbers. GRUB Error 17 used to occur frequently when people's computers had more than one hard disk, especially if one or some were SATA and others were IDE. Not all BIOSes sent the same signal to GRUB to tell GRUB what the hard disk numbering should be, and sometimes GRUB used to get it wrong. Some people used to think that editing our /boot/grub/device,map files might be a way of curing GRUB Error 17. Apparently that worked in some older versions of GRUB, or so I'm told. This didn't work in Ubuntu, at least not for me when I tested it. It doesn't seem to me as if GRUB pays any attention to the device.map file at all during booting. As far as I have been able to determine, it looks like it would be better to try Changing the hard Disk Boot Priority instead. NavyRSt, in this thread, HOW-TO install bootloader from Ubuntu, just changed the hard Disk Boot Priority and says that worked fine! The only purpose I can think of for the device.map file was to show what order GRUB thought our hard drives were numbered in. (Obsolete information below here) (Obsolete information below here) Running grub-install --recheck after adding or removing a hard drive Some modern computer case designs make it easy and quick to add and remove or swap hard drives. When grub is getting the device.map right in our computers, which will probably be the case for most of us, and after removing or exchanging hard drives, it is easier to run a command something like 'sudo grub-install --recheck /dev/hda2', which will cause GRUB to re-check our devices (hard disks) and update our device.map file and re-install GRUB. For example, (after you've managed to boot with either GRUB's Command Line Interface or with Super Grub Disk), Code: After editing your device.map file, you need to re-install GRUB in a special way for the changes to be effective. First, open a GRUB shell with the device.map file specified in the grub command. For example:
Then we install GRUB,
...and then,
It gives you GRUB's own natural device.map again. If it's not correct then we might need to edit it by hand and re-run grub-install, as the message already tells us. |
| GRUB's Command Line Interface (CLI)
This is GRUB's 'Command Line Interface', you get this by pressing your 'c' key from the GRUB menu. You can return to the GRUB menu by pressing your 'Esc' key. Another way to return to the GRUB menu is to type the command 'reboot' after the GRUB prompt to reboot the computer. The command line interface is not necessary to use everyday, but can be extremely useful for getting an operating system to boot which GRUB isn't automatically set up for. You can experiment with commands at the command line interface until you succeed in getting it to boot. Once you find the right commands then you can add those to your /boot/grub/menu.lst file to make it boot from the GRUB menu after that. The GNU GRUB manual contains a complete list of commands you can use.
This Section's Menu
How to use GRUB's Command Line - to investigate a computer GRUB
is almost a miniature operating on it's own, it can take quite a few
commands and perform some useful tricks. It's well worth a little of
anyone's time to learn how to work with GRUB at the command line.We'll see how to boot operating systems in a few minutes. First, here are a few useful tricks to help you learn to use GRUB interactively if your computer's BIOS supports that. This is how to use GRUB to take a look around inside a computer. Tab completion is a very useful feature of GRUB. In the example shown below I want to use Tab completion to find out what hard disks and partitions ane in my computer,
Find Hard Disks Here's another way to get GRUB to list all hard disks and partitions and give information on what filesystems are in a computer,
Find PartitionsNow I want to find out what partitions are in the first hard disk,
I use these commands often to determine one hard disk from another before installing GRUB to a hard disk's MBR, to make sure I install the right GRUB to the right MBR. NOTE: In Ubuntu Intrepid Ibex and later, there is an added 'uuid' command which can also do this job. Just type 'uuid' (without the inverted commas), and press your 'enter' key.
Find out which partitions contain a Linux kernel To find more information we can use the 'find' command, for example:
The feedback from the above command should give you one or more answers like:
Well, really, to be accurate, they are partitions which contain a symlink to a Linux kernel. These partitions could be /boot partitions if an installation has separate /boot and / (root) partitions. Find out which partition is your '/' or 'root' partition
The results from the above command might appear as shown below,
There are ways to have GRUB find out even more interesting information for us if it might help. We can open plain text files in any of those partitions we may be interested in with the 'cat' command. For a few examples,
and,
and also:
By the time you have tried out some of those extra commands you will be getting the idea that you can find out almost anything about any computer with GRUB's CLI. That's probably all the information we need for getting GRUB to boot any Linux system. How To Boot Linux from GRUB's CLI (Ubuntu) First method: 'direct boot'. This procedure is the most reliable method for booting any Linux operating system that is bootable. We directly boot the Linux kernel and initrd.img, or boot then via their symlinks in the root of the file system. This bypasses the MBR, menu.lst or a non functional boot loader.
A GRUB entry or a series of commands to boot from a GRUB command line includes the following four essential commands:
If you don't know those things, don't worry, because GRUB has commands you can use to find out. 1) The first command is 'root (hdx,y)' to set GRUB's root device to the partition that contains a Linux kernel. Our kernel is normally found in our /boot directory. This is usually the same partition as the rest of our operating system, but if we made a separate /boot partition, our kernel will be there instead. For example,
and in some computers Grub might reply by identifying the file system and partition type:
2) The second command is 'kernel /vmlinuz' to load the kernel image, and 'root=/dev/hda2' to specify the '/' (root partition, which contains the matching /sbin/init file. How to use GRUB to find out if you aren't sure
3)The third command will be 'initrd'
4)The fourth and final command is 'boot',
Right after this we should see a lot of white print appearing and scrolling up our monitor too quickly to be read, it's always very exciting! After a minute or so we should see our Linux operating system's login screen. Second method, 'configfile boot' This series of commands brings up the GRUB menu of an operating system that has GRUB installed in it by having the GRUB you are using read it's /boot/grub/menu.lst file. This is an quick and easy way to boot. It will work as long as the entries in the menu.lst file are correct. You can easily use this to boot any other operating system that happens to have a valid entry in that menu as well, so this can be a handy trick to know about. First, use GRUB's 'find' command to look for a menu.lst file in the computer,
GRUB tells me I have four partitions with a /boot/grub/menu.lst file that I can use for booting with.
When we're using the 'configfile method' for booting with GRUB, it's interesting to know that the GRUB we're using does not hand over control to the operating system's GRUB. So if you're using an older GRUB version such as the one used in GRUB for DOS (WinGRUB), it might not be able to handle some of the new commands that might be found in the menu.lst file for GRUB version 0.97, like the 'savedefault' command. WinGRUB Page. Of course, it's a waste of time to even bother thinking about trying to boot some other boot loader's configuration file with a configfile command. That would just be stupid. ...well, unless you know some special circumstances. Third method, 'chainloader boot'. GRUB's 'chain loader' command is special because it hands over the job of booting to another boot loader. The other boot loader can be another GRUB, or it can be LiLo, Syslinux, or whatever boot loader is installed inside the operating system to be booted. Normally, the chainloader command is used to boot another boot loader via the other boot loader's code installed in a 'boot sector'. (The first sector of that operating system's partition). Linux doesn't necessarily need to use it's first sector for booting. Installing boot loader code there is optional. This method requires that your have a boot loader; GRUB, LiLo, Syslinux or some other boot loader installed to the first sector of your partition, otherwise nothing will happen, you'll get Grub error 13. It's also possible to point the chainloader command at the MBR of any hard disk, or a USB flash memory device. If it has code for a boot loader installed in it, GRUB's chainloader command will boot it. For this example, I'll pretend we already know what hard disk and partition we want to boot. If you don't know what hard disk or partition you want to boot, go back to How to use GRUB's Command Line - to investigate a computer, and start there, then come back here when you know.
...but what do we do if we get: Error 13? If the operating system has GRUB files in it, we can use the install the operating system's GRUB to the first sector of the operating system's partition and then chainload it. The 'find' command is a test to remind me what partitions contain GRUB files.
Okay, I decided I want to install the GRUB in (hd0,5) somewhere,
If (hd0,6 has Kubuntu in it and we did 'root (hd0,6), that would install Kubuntu's GRUB somewhere. If (hd0,5) has Ubuntu in it and we do 'root (hd0,5), that will mean we're installing Ubuntu's GRUB somewhere.
It's telling us it has failed to install stage1_5 but don't worry about it. It says that when it installs to most partitions because there's no place for the stage1_5 file to go. The stage1_5 file is instalable in a ReiserFS partition or when we install to the MBR of a hard disk.
How To boot Windows using GRUB's 'CLI': Sometimes after a new install when Windows won't boot this might come in handy. Sometimes menu.lst gets written with an error in it. I don't know how that can be caused.
Chainloading Windows the simple way, for a single Windows installed on a first hard disk,
It is most common to expect Windows to be allocated the partition number 1, and remain that way, even if you 'move' it with partitioning software to the other end of your disk. If you aren't sure, it won't hurt anything if you try guessing it, and, if you still have trouble, an easy way to find out where all your partition are is to boot up a GParted LiveCD and take a peek. Use the command 'root' if you are booting a Windows version with the FAT32 filesystem such as Windows 95, Windows 98, Windows ME, or Windows XP Home Edition. Use the command 'rootnoverify if you aren't sure, or if you are booting a Windows system that has the NTFS filesystem. Windows XP Home Edition, Windows XP Professional, WIndows NT and Windows 2000.
If Windows is allocated a different partition number, either accidentally or on purpose, you may need to edit boot.ini with the changes and it will usually boot up fine. TIP: You should make your own Windows XP boot floppy disk with ntldr, ntdetect, and boot.ini on it if you have Windows XP and you are playing around with partitioning software. That way you can always access boot.ini on the floppy disk and edit that if required, and boot Windows when you cannot access your regular boot.ini because you can't boot Windows because you can't edit boot.ini because... (especially if you have the NTFS filesystem). How to make your own Windows Xp boot floppy, Click Here. (Microsoft). EVEN BETTER TIP: Go to http://tinyempire.com/notes/ntldr by Miles Comer and read 'How to fix: NTLDR is missing, press any key to restart', and download yourself a copy of Miles Comer's Super NTLDR Disk, burn one of those to a CD, or make a floppy disk out of it. Read that web page by Miles Comer, that should help you boot Windows sooner or later if you keep trying. Chainloading Windows using map commands when it is installed on a non-first hard disk. If you have Windows installed on a second or third hard disk, you will need to trick Windows into thinking it is on the first hard disk, or it will sulk and refuse to boot. To do that you can use the map command (twice). map (hd0) (hd1)
map (hd1) (hd0)
(Where (hd1,0) is the partition Windows is in.)
GRUB and MultiWindows GNU/GRUB is actually a far better boot loader to use for setting up a Windows multiboot than Windows own bootloader. Windows is the operating system that insists on being the only one on the hard disk, but ironically it still doesn't have any 'hide' feature of it's own. The default Windows method for multibooting is to copy the new installation's vital files needed for booting into an older, existing Windows installation in a primary partition. Then the newer Windows install will be made in a logical partition without any bootloader file of its own. Needless to say, if the user ever has a problem with the older operating system it means the newer operating system will be ruined too. For more info read this link, Understanding MultiBooting and Booting Windows from an Extended Partition Dan Goodall You use GRUB for booting Windows with rather than Windows own bootloader, especially if you want to set up a Windows multi boot. You install the first Windows, then use GRUB to 'hide' it, then you install the other Windows. When more than one Windows is installed on the same hard disk, you can use GRUB's 'hide' and 'unhide' commands to hide one Windows install from another, and boot. For example if one Windows installation is is the first partition and another Windows installation is added to the fourth partition, you would boot the first partition this way,
Now when I want to boot the other one, I just do the reverse,
A Quick Guide to GRUB's Numbering System
The Gnu Grub manual contains a lot more information than can be put on this page. |
Temporarily Edit the GRUB Menu
You can press any key to stop the timer when you're at the GRUB menu. If you read the text underneath the GRUB menu it says you can press 'e' to edit the commands before booting. You can make non-persistent changes to the GRUB menu by pressing your 'e' key, and editing commands and options in your GRUB menu. So press your 'e' key. Now you should see a different Grub menu,
You can move the highlight bar over any line you need to and press 'e' to edit it. Booting problems are often caused by just one wrong number in a line in your /boot/grub/menu.lst file. Normally you just need to edit that one hard disk or partition number and you can boot. If you already know what you're doing it's often quicker to use this 'e' for edit method to temporarily correct the error and boot than using the 'c' key for GRUB's Command Line Interface. With the 'e' for edit menu, your boot-up commands are displayed already complete, so you don't need to type each command out again from scratch. This way you can just edit what you need. That often saves time and effort. For another example, you might need edit your kernel line and add kernel options. Press your down arrow key to go down to the second line, the one beginning with the word 'kernel' and press 'e' again. Scroll across to the end of that line and it should say 'ro quiet splash_', those are kernel options that are passed from GRUB to your kernel during boot-up. You may need to add some more kernel options to the end of the kernel line because of some hardware issue, perhaps. Probably the most frequently needed kernel parameter would be: xforcevesa , which essentially means you'll be able to boot into 'safe graphics mode', in case your monitor went blank at the login screen due to a video driver problem. Here's a link to 'The Linux BootPrompt-HowTo' - by Paul Gortmaker. Here's a more Ubuntu-specific link: Ubuntu - How To Edit Grub Boot Parameters - grumpymole. When the computer is first booting, the display functions in 'VGA' mode, which is run by a simple video driver from the BIOS. GRUB uses the BIOS's VGA driver too. As soon as a Linux kernel begins to boot, we can use the vesa video driver, that's used to give a slightly better resolution during the starting up phase of booting. During this period of time, the 'usplash' screen is normally displayed. Usplash - Wikipedia, the free encyclopedia Then when Ubuntu boots, it loads the operating system's hardware specific video card drivers and you have much nicer graphics by the time you get to your login screen. Sometimes we don't see the usplash, but instead we see the kernel's rantings and ravings about the hardware as it's booting. That information is strored in log files in /var/log as well. The kernel's feedback is sometimes useful for troubleshooting purposes. Usually, the kernel drops the usplash as we can see what's wrong if it encounters an error and cannot completely boot up. Sometimes it'll drop you to a shell prompt instread of booting. In some rare cases, the vesa driver isn't working during the middle phase of the boot-up. What would happen if you can't see anything at all? Normally, even if you had a blank screen during boot-up, there would be no harm in that. You just wouldn't see anything for a while and then when it gets to the part where the video driver kicks in and Ubuntu comes up, you'd get your display back. That's okay if your computer does boot eventually, but what happens when the computer fails to boot, and just sits there with a black screen? The main concern is, it could be stopping at some error and you can't read the error message because you have no display whatsoever at that stage. You could first try simply waiting a while in case it's just doing a file system check. Maybe try pressing 'Enter', followed by 'Ctrl'+ 'D', in case it's hanging at the file system check. That would get you over that. You'd still need to wait a minute for it to finish booting..... Okay, so you tried waiting for ages already and still nothing.... The answer is to reboot and add 'vga=ask' as a kernel option. Here is a link to an excellent howto which explains all we need to know about the vga= option, HOWTO: Change bootup resolution, by Indras At the end of the 'kernel' line, make a space and then type: vga=ask Then press the 'Enter' key. Press 'b' to boot. On the next screen, it should say,
It should give you a choice of vga settings you can try in an effort to get some display during boot-up.
Then, there's a choice of numbers between 1 and 6 that correspond with different capabilities of your display. Hopefully that will sooner or later let you to be able to see the text messages that normally run behind the boot splash screen during a regular boot-up, but show up to tell you what's wrong when there are errors. Then whatever the problem is that's holding up the booting procedure can be solved, depending on what the exact problem turned out to be. That was just one example of how to use the 'e' for edit feature to temporarily edit the GRUB menu for one boot-up. This way it's possible to make any changes to the GRUB menu you need in order to boot your operating system. Once the operating system is booted then it will be easy to edit the /boot/grub/menu.lst file and make more permanent changes. |
Re-install GRUB The following thread is the most popular about this subject in Ubuntu Web Forums, How to install Grub from a live Ubuntu cd. - catlett.The two most popular methods are,
The advantage of the grub-install command is that it can be used to install or refresh grub files in the /boot/grub directory, at the same time as it installs the IPL for GRUB to a hard disk's MBR or to a partition's boot sector. (i) If you can boot your Linux operating system somehow, the command is simple,
(ii) If you need to run the grub-install command from a Live CD, Contrary to what many people think, there's no need to chroot from a live CD into a hard disk installed Linux operating system to re-install GRUB. When we're in a Live CD or a different operating system (such as a USB disk or a different hard-disk installed Linux), to install some other operating system's GRUB somewhere you just need to do something like the following command, Example:
Where: /media/disc is the file path for the directory where you want the GRUB files to be installed. If you're looking for an example about how to chroot, look in my LiLo Page, it is necessary to chroot to install LiLo. LiLo Page. 2) GRUB's setup command The grub shell method explained below here for re-installing GRUB is very flexible. It can just as easily be used from a live CD or DVD, from a GRUB floppy disk, from GRUB's Command Line Interface or a hard disk installed operating system or just about anywhere there is already a GRUB installation present with the necessary GRUB files. That often makes it much more convenient than running the grub-install command. The GRUB shell method is for re-installing GRUB's IPL to a hard disk's MBR or the boot sector of a Linux partition, most of the time that's all we need to do. It doesn't actually refresh the grub files in /boot/grub. The most common use for this operation is to fix your MBR after another operating system has been installed and it has taken over your MBR, or if your partition numbers have been accidentally changed and you're getting GRUB Error 17. Here's how to use the GRUB shell to re-install GRUB. The first step is to open a terminal and open a grub shell with root priveleges, Code:
In Ubuntu, it is important to use 'sudo' before the 'grub' command. If you forget, you will get a GRUB shell okay, but you won't have root priveleges. You won't be able to do very much with a grub shell without root priveleges. If you try, you will probably just get some confusing error messages. Output:
This gives me a clue as to exactly where the necessary GRUB files may be located that I can install GRUB from. (In case I have more than one Linux operating system).
It has to be one of the ones listed by the 'find' command (above). If I know I have Ubuntu in partition 2 and Debian in partition 4 and I want Ubuntu's GRUB installed to MBR, I set (hd0,1) as GRUB's root device here. If I chose (hd0,3) that would install Debain's GRUB somewhere. Quick Guide to GRUB's Numbering System. GRUB should recognize the filesystem, and will reply with an output similar to the one shown above. If not, then check to make sure you didn't make a mistake.
Installing GRUB to MBR: 'setup (hd0)' is the command to install Grub's stage1 to MBR in the first hard disk. Stage1_5 will also be installed to the 15 sectors following the MBR in the first track of the hard disk. Installing GRUB to a partition: To install GRUB to a partition, you would use a command like, 'setup (hd0,1), or 'setup (hd0,3)', where (hd0,1) and (hd0,3) are Linux partitions. If you do that, you'll be able to boot your operating system using the 'chainloader' command. Installing GRUB to a non-first MBR: The BIOS normally only boots the MBR of whichever disk is set in the BIOS as the first hard disk. If you have more than one hard disk in your computer, you can install GRUB to the MBR of some other hard disks instead. You can then use a chainloader command from your first hard disk's GRUB to boot GRUB or any other boot loader in any other hard disk. This is useful for people who have a lot of operating systems and they want to spread them over several GRUB menus. To install GRUB to a second hard disk, you would use 'setup (hd1)', and for a third hard disk 'setup (hd2)', and so on. Installing GRUB to a floppy disk: That's a seperate subject, covered further down this page. How to make your own personalized GRUB Floppy Disk........................................ GO Installing GRUB to a usbdisk: That's another seperate subject, also covered further down this page. How to add GRUB to your USB thumb drive...........................................................GO
|
Memtest86+ ![]() In Ubuntu, one of the options GRUB can load is called 'Memtest86+', a series of tests to check your computer's memory and make sure it is okay. This results in a very impressive blue display, as pictured above , with hashes '#' progressing across the monitor and strange numbers and letters appearing and disappearing again. It will continue unattended as long as you like until you press the 'Esc' key There are eight tests in the series. (Just highlight 'Ubuntu, kernel memtest86+ on the GRUB Menu). It took about 25 minutes to run through one complete cycle of eight tests with my 400 Mhz computer. My 3.0 Gz computer (3000 Mhz) took 25 minutes to run through all these test twice. Memtest 86+ will keep on cycling through these tests for as long as you let it run, in case you're checking for intermittent errors. Normally, one cycle of eight tests is enough to find out if you have a memory problem or not. The tests are: #1 [address test, own address] #2 [moving inversions, ones and zeros] #3 [ moving inversions, 8 bit pattern] #4 [moving inversions, random pattern] #5 [block move, 64 moves] #6 [moving inversions, 32 bit pattern] #7 [random number sequence] #8 [modulo 20, ones and zeros] These tests could be very useful for troubleshooting purposes, especially if your computer freezes up or crashes now and again. Error messages that might possibly (but not necessarily) be associated with faulty RAM modules include 'parity errors', 'general or global protection faults', 'fatal exception errors', and 'divide errors'. I have read that memtest 86+ tests not only the RAM modules, but the machine's CPU caches as well. If you want to make sure you're only testing the computer's memory modules, before you run memtest86+ you can go into the machine's CMOS (BIOS) settings and disable all caching, such as 'L1' and 'L2' or 'CPU Internal Cache' and 'External Cache'. Save the changes and reboot. Then run memtest86+. If you find any errors and you have more than one RAM module, remove all but one RAM module and test one RAM module at a time to determine which one is faulty. Be sure to unplug the power cable from your PC, and wait for the motherboard LED light to go out before touching anything. If it's a laptop, make sure you remove the battery too. Be aware of ESD, wear an ESD wrist strap if you have one, or touch the computer's frame first. Often just removing and reseating the RAM modules can cure the problem if it is caused by dirt or a bad fit in the socket. (That has worked for me before). When you're finished, don't forget to go back into your CMOS (BIOS setup), and re-enable caching, and save the changes and reboot, otherwise your computer might run very slowly. For more information on memtest86+, Memtest86+, Memtest forums, memtest86.com. |
How to make a GRUB CD-RW (with an optional splashimage)
This works for CD-R or CD-RW disks, but I prefer to use CD-RWs for this. 1) I made a new empty directory named iso, then I made another directory inside it called boot with another one inside boot called grub. code:
2) I copied my /boot/grub/menu.lst to my new /iso/boot/grub directory,
3) and also I copied a file called 'stage2_eltorito' to my new /iso/boot/grub directory. NOTE: The exact location of this file may not be the same for all versions of Ubuntu, so I recommend you find it first, with the 'locate' command, like this, code:
Now that Linux has found the file for me, I copied it to my /grub directory inside my /boot directory in my new iso directory,
Where: '/usr/lib/i386-pc/stage2_eltorito' is the correct path and file name, found with the 'locate' command in your own computer. (It may be different in your compared with mine). 3 (a) This part is optional, I added a nice splashimage. My splashimage is called Ubuntusplash. To add this all I did was open my iso/boot/grub directory in my /home/herman folder and copy and paste it in there. If you don't have your own splashimage, you can make your own, or download one from the internet via the link already given under splashimages on this page, ........................Go Back Or, if you want, you can just download any of the ones I made from here, Splashimages. 4) I opened my menu.lst with my text editor and edited the file to make sure everything will work properly from the CD. Some modifications need to be made to the menu.lst since things will not work the same from a CD as from a hard disk. 4 i) THIS IS IMPORTANT. We need to delete all instances of the savedefault command. The 'savedefault' commands in each operating system's boot entry will cause GRUB to fail to work from a CD. That's because the 'savedefault' command tells GRUB to run a program called grub-set-default, which tries to write to a file called /boot/grub/default, and record which menu entry was booted last time GRUB was used. That works great in a hard disk, USB or floppy disc, or any media GRUB can write to. Unfortunately, the only way to write to a CD is to burn a new CD. GRUB can't write to the file in the CD. That stops GRUB from completing it's tasks and GRUB will return an error message instead. So, for our GRUB CD to work we need to: open the new copy of menu.lst with 'gedit' text editor, and delete all instances of the command 'savedefault' from the boot entries. 4 ii) Another (recommended) idea would be to edit your Ubuntu entries so that the CD-RW will boot Ubuntu via the symlinks to the Linux kernel and initrd.img rather than the actual files specifically. That avoids the need to make a new CD-RW after each kernel update. (Well, it will probably still boot as long as you still have the out-of-date kernel and initrd.img, but it's best to always be booting with the most advanced kernel and initrd.img, for lots of reasons). For example, change this,
To something like this,
The savedefault command has been deleted. References to a specific kernel and initrd.img have been deleted and the paths have been changed to point to the symlinks (shortcuts to the current kernel and initrd.img) instead, (by deleting the word '/boot'). That avoids the need to make a new GRUB CD-RW after each kernel update. Intrepid Ibex's GRUB replaced the command 'root', (the command in the second line, under 'title'), with the 'uuid' command. You have the option of leaving that alone. If you leave it that way, your GRUB CD will look for the Ubuntu installation with the designated file system (with the UUID number you specified), and boot it no matter what disk it might happen to be in. Even if you want to boot Ubuntu in a USB flash memory stick and if it's plugged into a hub with a lot of other USB devices, and GRUB will find the right disc for you and boot it. Earlier versions of Ubuntu, or other Linux distributions's GRUBs might not feature the uuid command yet. 4 iii) Add another operating system entry which will be more generic.
I added another boot entry by copying and pasting my first one and then I edited the words after the title command, you can type in whatever you like there, I typed in 'Symlink Boot on Ubuntu in (hd0,1)'. I reverted from the uuid command to the old root command, and replaced the UUID number with '(hd0,1), (you may need to type in something else here as appropriate for your own needs). I also changed the 'root=UUID' part in the kernel line to be non-specific by replacing the exact UUID number with '/dev/sda2' instead, so the CD will boot whatever is in the second partition, regardless of the exact file system UUID. It's up to you, you don't have to do that, but now it can still boot Ubuntu again if Ubuntu has been re-installed, or replaced with a newer version. (Or whatever Linux installation is in the first hard disk, second partition). 4 iv) You can also add a third boot entry something like this instead if you like,
You could add more of these to boot any operating system in more different hard disks and other partitions if you want. and/or, you might find a boot entry like this one useful someday,
You could add more of these to boot Linux installations in more different partitions if you want. It would do no harm and possibly some good to have all kinds of different boot entries. Don't forget you will still have the options of
If you're doing it for fun though, feel free to as as many different kinds of boot entries as you like. You can probably think of lots more possibilities, let your imagination run wild! Also, do a last minute check to see if there is anything else you might want to edit in your menu.lst file and do that now. If you are not using a splashimage, you can enable pretty colours instead if you like. 4 v ) This is optional, you need to do this for the splashimage if you are using one. The name of my splashimage in this example is Ubuntusplash.xpm.gz You need add a line in your menu.lst file for the splashimage you are going to use. For example, splashimage=(cd)/boot/grub/yourgrubsplash.xpm.gz as shown in my example menu.lst snippet shown below. (Where 'yourgrubsplash' is the name of your splashimage. Replace 'yourgrubsplash' with the name of the splashimage you will be using. It does not necessarily need to be between #hiddenmenu and #Pretty colours like mine, but that's where I always put mine and it seems to work okay. For example, Code:
End of OPTIONAL section. 5) The next command is to make the new grub directory into an .iso file. Note: Copy and paste this command into your terminal, don't try to type it. Code:
Here's what it should reply:
6) After that I just exited the terminal and put my CD-RW in the drive, went through my /home/herman directory, right-clicked on the newly made grub.iso file and clicked 'write to disk'. 7) Test your new GRUB boot CD-RW disk. It should boot all your operating systems from the GRUB menu or from the GRUB command line interface. 8) If you do any work with a partition editor that causes your file system UUID number to be changed then your GRUB CD won't work any more and you'll need to make a new one. That's one of the reasons I prefer to use a CD-RW for this rather than a CD-R disk. GRUB's Command Line Interface is available from the CD though, so if you can use CLI GRUB, you'll still be able to use the CD, (to boot any computer). Only use 'Parted based partition editors, it is not advisable to touch your hard disk with any partition editors designed only for Windows. Just opening one of those to take a look at your partitions can make your Linux installs unbootable, as they might change your file system UUID numbers without your knowledge or permission. 'Parted based partitioners like GParted, QTParted, Partman and Parted are okay for both Windows and Linux. |
| NOTE: You can use Super GRUB Disk to make your own bootable CD with, and add your favorite live operating systems to it, like Knoppix, Puppy linux, or GParted LiveCD, and combine it with your own personal GRUB CD that you just learned how to make. Build a CD/DVD with SGD on it.............................................Build a CD/DVD with SGD on it |
How to make your own personalized GRUB Floppy Disk.
This will make you a GRUB boot floppy with your own GRUB menu in it, so it that suits your computer already. You can also play with it and personalize it even more after it has been made. It's a safe way to experiment and learn how edit the GRUB Menu without interfering with your hard disk install's everyday booting. You can try out all the tricks on this web page, add a splashimage to your GRUB floppy, and anything you like. Conduct weird experiments, have fun! First, of course, you need to insert your new, blank floppy disk in your computer's floppy disk drive. Check to make sure it is not 'write protected' at the moment. (The little plastic slider should be covering (closing) the hole in the left rear corner). How to Write-Protect a Floppy Diskette - HelpDesk (external link). Code:
Code:
An icon can be expected to appear on your desktop that looks like a floppy disk.
This command makes an empty directory (folder), in your floppy disk named /boot
This 'setup (fd0) command installs GRUB's IPL or stage1 in our floppy disk's first sector. The rest of the text you see here is the feedback from the system, so we can see what happened.
If you want to edit the menu.lst in the floppy disk, so you can customise it, play with it, update it or correct it, use this code:
It is good practice to remove any boot floppies before shutting a computer down, and to 'write protect' the disk unless you are working on it. Never share a floppy disk between computers. In the old days, bootsector viruses used to spread that way, at least between Windows computers. I'm not sure about linux computers and boot sector viruses. It is best to 'keep our guard up' anyway. How to Write-Protect a Floppy Diskette - HelpDesk (external link). |
How to make a dedicated GRUB Partition
The only thing I'm trying to do here is make a quick how-to for it that's more 'Ubuntu-specific'. There are a few other small difference that come down to personal preferences. I would like to encourage everyone to go and explore Steve Litt's site. A dedicated GRUB partition is a special partition just for GRUB, it just has GRUB files in it. This will mean GRUB will be 'operating system independant'. In other words, even if you delete your Linux operating system, you'll still have your GRUB bootloader. A 'dedicated GRUB partition' is not the same things as a 'separate /boot partition' because a separate /boot partition contains the operating system's kernel as well as the bootloader files and is mounted in the /etc/fstab file as /boot in a particular operating system. A 'separate /boot' partition is only useful for curing GRUB error 18 in older computers, by forcing the kernel to be located close the the beginning of the hard disk. A separate /boot might not necessarily have GRUB files in it, it could have LiLo instead. How to make a separate /boot partition. A 'dedicated GRUB' partition,
The rest of this article is about how to make a dedicated GRUB partition. 1) Just make a small partition anywhere on your hard drive with any 'parted based partition editor you like. LibParted base hard disk partitioners include Parted, GParted, Parted Magic, Gnome Partition Editor, QTParted, Partman and others. Probably a 100 MiB partition would be way more than large enough. GRUB by itself takes up very little space on your hard drive. Format it with any file system that GRUB supports. GRUB supports FAT32, Ext2, Ext3, ReiserFS and others as well. GRUB does NOT support NTFS. Most Linux tutorials show the ext2 file system being used for GRUB, without explaining why. I think it's just to save hard disk space. Some of those tutorials are very old, from way back when a typical hard drive was smaller than 5 or 8 GB. The ext3 journal does occupy a tiny wee bit of room on the hard disk, but most of us would never notice it with the hard disk sizes that are common today. Just in case someone is installing in a small hard disk or a flash memory stick, I'm going to use ReiserFS for this how-to, but you can use whatever file system you like. The Reiser File System takes up even less room than ext2 and works particularly well in flash memory. For the rest of this how-to you will need to remember the Linux term for your new partition. Make a note of what Linux calls your new partition, (like '/dev/sda8' or something like that), before you close your partition editing program. 2) Label your file system. You can call it anything you like, but I'm going to name mine 'GRUB'. With the Reiser File System, we use the reiserfstune command, like this,
Yours will most likely have a different partition number than mine. Look with your partition editor or use the 'sudo fdisk -lu' command to check. Replace the '/dev/sda8' part of this command with whatever partition numbers apply to you and your own unique partition numbering. The reason for setting a file system label is to get our file systems to be automatically mounted in our /media directories with a nice descriptive name for the mount points. That's a good idea now that Hardy Heron and newer version of Ubuntu feature the new automated mounting method. Just go ' Places'-->'Removable Media'-->'GRUB', to mount your new file system. If you made an ext2, ext3 or a FAT32 file system for your dedicated GRUB partition, see: Make a label for your ext3 file system - give your ext3 file systems descriptive names. FAT32 usbdisk volume label give your FAT32 usbdisk a pet name or How-to get your removable device mounted under an explicit and persistent name - Debian/Ubuntu Tips & Tricks. If you are using an older versionof Ubuntu, or if you are using some other Linux distro, you should be able to make your own mount point and mount your file system manually. If you're not sure how to do that, refer to the following link, Mounting Filesystems with the mount command - Traditional olde reliable method. 2) Reboot your computer, and mount the new GRUB partition. Click-Icon Mounting - The new easy way to mount file systems in Hardy Heron and Intrepid Ibex. If you use the 'ls' command to check the names of your mount points in your /media directory, you should find that your new dedicated GRUB partition will be automatically mounted as 'GRUB' ,
3) Make a directory named /boot in your new GRUB partition, (in /media/GRUB),
This is just done for the sake of uniformity. 4) Copy your /boot/grub directory to the new partition,
5) Get the new GRUB partition's menu.lst file with,
You can also delete the entire Debian Automagic Kernels List too. Since the menu.lst file isn't in an operating system anymore, the Debian Automagic Kernels List won't be needed. 7) Re-install Grub from your new GRUB partition to MBR.
8) Give all your operating systems a test boot-up to make sure everything's working fine and dandy. If everything's good, you can (when you are ready) delete or hash out your extra operating system entries in your other menu.lst files if you won't use them any more. (Or just leave them there if they look neat and tidy enough and they don't bother you). If you have a complex multi-boot set-up, with several hard disks and lots of operating systems, you might not want all of your operating systems to be squeezed into one GRUB menu, (if they're all in one menu it might become too congested). Instead you could have several dedicated GRUB partitions, one for each hard disk. Make entries in your first hard hard disk's GRUB menu to boot only the operating systems in the first hard disk and chainload the MBR of each of the other hard disks. Each hard disk's GRUB can list just the operating systems in it's own disk and chainload the first hard disk's MBR. It would be kind of like going up and down in an elevator. That would be a nice way to spread the number of operating system entries out over a number of GRUB menus because if they're all in one menu it might become too congested. |
| How to make a separate /boot partition A separate /boot partition is not the same thing as a dedicated GRUB partition. The main reason for needing a separate /boot partition is for curing GRUB error 18. GRUB error 18 most commonly occurs when a hard disk is larger than the computer's BIOS was designed for. Here is a list of BIOS hard disk limits and some approximate dates when these ways to overcome these limits were invented. 2.11 GB or 4095 cylinder limit 3.26 GB or 6322 cylinder limit 4.22 GB or 8192 cylinder limit .................(around 1997 or earlier) 8.45 GB Standard INIT13 limitation (CHS[1024x256x512)....................(around late 1990s) 33.8 GB or 66,060,287 LBAs limitation...........................................................(August 1999) 137 GB or 268,435,455 LBAs limitation (28-bit limit)...............................(September 2001) So let's say for example, you have an older computer that has an 8.45 GB hard drive size limit. You can install a larger hard drive in your computer, but the BIOS can only boot an operating system that has its kernel located within the first 8.45 GB of the hard disk. The reason is, older BIOSes plot the location of information on the hard disk using a system called 'CHS' addressing. 'C.H.S.' stands for 'Cylinders, Heads and Sectors'. CHS addressing works a little bit like co-ordinates on a map, but using Cylinders Heads and Sector numbers for a 3D representation of a hard disk. When this system was invented, it was thought to be wonderful, no-one ever dreamed it would ever be possible for hard disks to exceed 8 GB in size! Unfortunately, 8.45 GB is the largest the CHS system can address before that method simply runs out of numbers. Therefore, any Linux kernel that happens to get placed outside the 8.45 GB limit can't be 'seen' by the BIOS, so it can't be booted, and we get GRUB error 18. There is also the 137 GB BIOS hard drive size limitation, which is caused by a different BIOS quirk, but results in a similar type of problem when people fit a larger hard drive to their computer than it came with from the store. Sometimes you can download a BIOS update from your motherboard manufacturer's website and 'flash' your BIOS with it to overcome these hard drive limits and get other improvements for your BIOS as well. See also Grub error 18, on this web page. One way to cure GRUB error 18 is to force the Linux kernel to be located in an area of your hard disk within the area that the BIOS can address. The way to do that is to make sure it is contained within a partition that is situated somewhere close to the beginning of your hard disk. That's what a separate /boot partition is all about. I would not recommend making a separate /boot partition for any reason than for overcoming GRUB error 18. For most people, a dedicated GRUB partition would be much more useful. The easiest way to make a separate /boot partition if you need one is to have the installer make you one when you install Ubuntu or any Linux operating system. If you didn't make one during your install, (probably you didn't know you needed one), you can make one any time. That's what this article will be about. It will be a little bit more work than doing it during the install, but quite do-able for most people. First, you will need to use Partition Editor in your Ubuntu 'Desktop' Live/Install CD. Go System'-->'Administration'-->'Partition Editor'. A GParted -- LiveCD will also work. Resize a partition to make some free space anywhere within your hard drive limit. Around a quarter of a GB to half a GB should be plenty. You can format it with an ext2 or ext3 file system. Then you need to mount both your hard disk installed Ubuntu and your new /boot partition in your Ubuntu LiveCD operating system, (or GParted LiveCD). See this link first, Mounting Linux ext3 or reiserfs filesystems and mount your new /boot partition's file system. For example, my new /boot partition will be /dev/sda2, Code:
See this link second and mount your Ubuntu hard disk installed operating system Mount a Ubuntu ext3 or reiserfs filesystem. Code:
Copy all the files from the /boot directory in the installed system into the new empty partition. Do not copy the directory itself, just all the stuff inside it. You will probably need to use a sudo command for that, Code:
You would also need to add a line for the new partition in your /etc/fstab file, registering it as /boot. You can edit your installed operating system's /etc/fstab file from the Ubuntu Live CD too, the above link shows you how to access it. See Mount a different Linux filesystem (ext3) in Ubuntu Code:
Now you can add a line something like this in your /etc/fstab file,
Where: /dev/hda2 is the partition to be mounted as the /boot partition on start-up from now on.
You will also need to edit your /boot/grub/menu.lst file with the new partition information with the new path for your Linux kernel, see Mount a different Linux filesystem (ext3) in Ubuntu Code:
When your /boot/grub/menu.lst file is open, scroll down to around the bottom of the file and look for your Ubuntu boot entries. They should look something like mine, below,
to this (below),
If you're not sure, see: A Quick Guide to GRUB's Numbering System NOTE: Since the new /boot partition doesn't have a directory named /boot in it, I removed the '/boot' from the path to the kernel and initrd.img in the two middle lines. And don't forget to make the 'root (hd0,1)' change persistant during kernel updates when update-grub automatically generates a new /boot/grub/menu.lst file. You do that by editing your 'groot' line, in the debian automagic kernels list area of our /boot/grub/menu.lst file. Scroll up to somewhere closer to the middle of the file to look for that. Refer to this link for more information, # groot=(hd0,1) Code:
to this (below),
Make sure you find out the right partitions for your computer and replace these example numbers with whatever is correct for your special machine. Don't forget to save your menu.lst file before closing. You will need to re-install GRUB, see: Re-install GRUB with a GRUB shell eg; with Live CD You will need to set your new /boot partition as the root device in GRUB and install GRUB to MBR in your first hard disk.
Do this instead,
Your output from the above command should tell you the input for the next command, below.
Then, at last, you can reboot. Don't forget to remove your Ubuntu Live CD. That's it! WARNING: Do not try to delete your old /boot directory in Ubuntu after you reboot, because your new fstab file has already mounted your new /boot partition using your /boot directory as the mount point. Your old /boot (directory) files will now have been over written automatically. That means your new /boot (partition) will look the same as your old /boot (directory), for all intents and purposes. There is no need to delete anything. If you do delete any files, thinking you are deleting old files from your old /boot directory that you don't need anymore, you will be in fact deleting the files in your /boot partition! So you will lose your boot! :( Don't do that. The main disadvantage of having to use a separate /boot partition is that is you want to dual boot more than one Linux installation, it is a bit tricky to get two or more linuxes to share the same separate /boot partition. If you try, any files with the same name in the new system you might be installing will overwrite files belonging to your existing system and you will lose the boot of your existing Linux. The main problem is the /boot/grub/menu.lst file, as the other files will either have different names, or else can probably be shared without any problems. One workaround is to rename the existing /boot/grub/menu.lst file to some other name, for example 'boot/grub/menu.lstb', or something like that.
Then you need to go into your /usr/sbin/update-grub script to look for a line to edit to make update-grub look for a file named 'menu.lstb' instead of menu.lst from now on. Update-grub is the script that runs automatically when we get a kernel update, to make us a new updated menu.lst file, (or maybe a menu.lstb file instead now). The trouble is, update-grub is a very big script, and the line we want to find is about the 280th line, and it's hard to find by simple scrolling and eye-balling if we open the file in gedit text editor. It's a lot easier to use the text editor nano instead, here's one way to do that, Code:
When the nano text editor opens the file for you, you will see the top portion of the file. To find the right line quickly and easily so you can edit it, you press your 'Ctrl' + 'W' keys. If you read the clues nano gives you in the black hightlighed text at the bottom of the page, (called the 'shortcut list'), you'll see that '^W' , (CTRL+W) means "Where is?" in nanoese. That gives you a search bar, and after the word 'Search:', if you type 'menu.lst' (without the inverted commas), and press 'Enter', nano will take you instantly to the line we need to edit! Isn't that neat? Use your arrow keys to move the cursor to where you want to type. Now you can just add a 'b' after 'menu.lst' (without the inverted commas). To save the changes, you type: ^o (nanoese for CTRL+O), for 'write out'. And to close the file then: ^x , which is nanoese for 'eXit' (CTRL+X).
to this (below),
Then you can install another Linux and let it share the same /boot partition. Unless you have room for another separate /boot partition, they aren't very big, but restrictions in the hard disk partitioning rules like how many primary partitions you can have and where logical partitions have to be located (in a series), could mean you to have no choice but to share the same separate /boot partition if you want to install more Linux operating systems. If you want to quickly learn a little more about how to use nano, you can start by taking a look at this link, How to use nano. You can skip the ssh/telnet part and just do the exercise in your own computer if you want, or just read it and do your own thing. Nano is a really cool text editor and well worth practicing with and getting to know. Here's the link to Gnu Nano's homepage, http://www.nano-editor.org/ Don't forget to look up the documentation there and play with nano a little bit more. Here's the nano Command Manual Since nano doesn't require a GUI to work, knowing how to use nano might get you out of a scrape some day if your operating system is sick and your GUI won't start until you edit some file. Ubuntu Community Docs Nano |
How to add GRUB to your USB thumb drive.
This USB thumb drive is to be used for booting operating systems in the hard disk, in a similar way to using a GRUB CD or Grub floppy disk. This will add GRUB to a USB thumb drive with your own GRUB menu in it. It may need some editing of the menu.lst file to make it boot your computer's OSes. Some people might prefer it to booting from a CD or floppy drive or maybe they have no floppy drive and their CD drive isn't working at the moment. You can still use your USB thumb drive to store and transfer files as you would normally. GRUB does not occupy very much room. NOTE: not all BIOSs support booting from USB disk, so not everyone will be able to use this method either. You can keep a USB disk installed GRUB as a pet. It requires no feeding and doesn't make any mess on the carpet. Play with it and personalise it even more after it has been made. It's a safe way to experiment and learn how edit the GRUB Menu without interfering with your hard disk install's everyday booting. You can try out all the tricks on this web page, add a splashimage to your USB GRUB menu, and anything you like. Conduct weird experiments, have fun! First, of course, you need to plug your USB disk into one of your computer's USB ports. In Ubuntu, a USB disk is usually automatically mounted by the operating system a few seconds after it is plugged in. If your USB thumb drive is already used, you already have a filesystem on your USB disk, so you can just install GRUB to it. If your USB thumb drive is brand new, Check to make sure it has been formatted with a filesystem if it is new and you just brought it home from the store and unpacked it. I recommend GParted -- LiveCD for all disk partitioning and filesystem work. Just re-boot the computer with the USB thumb drive already plugged in and when GParted LiveCD is fully booted, over in the upper right-hand corner you'll find a 'spinbox' for selecting a different hard disk. Your USB thumb drive should show up in a list there, and you can use GParted LiveCD to format it with a filesystem. Fat32, ext2 or ext3 will be fine.
The feedback from this command can be seen right under where the command is shown in the above illustration. That doesn't look like my USB thumb drive to me, my USB thumb drive only has one single partition in it. I recognise that partition information as being that of my second hard disk inside my computer, so (hd1) is not the disk I want to install GRUB to right now. Let's take a look at (hd2),
This is the right hard disk to install GRUB to.
Yours might be different to mine, so be careful here, use one of the GRUB partition designations you see shown in the feedback from your 'find' command, three tables up from here.
The rest of the text you see here is the feedback from the system, so we can see what happened.
This is optional, but you can now have fun playing with the GRUB in your USB drive without having to worry about it affecting your hard disk install's GRUB. If you prefer to leave your USB disk's GRUB secure, it will just mean you will need to use the sudo commands from a terminal every time you want to make changes.
Remember that you will probably need to make sure that 'USB device' is in the list of bootable devices in your BIOS's hard disk boot priority before you can use the USBdisk for booting up your computer with. Or, press your F8 or F12 key (depending on your brand and model of computer) during boot-up for a boot menu of hard disk drives to boot from and select the usbdisk. Now that Ubuntu's GRUB uses file system UUID based booting, we should not have any problem with booting a USB device like we used to in the past. We can have all sorts of drives all plugged in and GRUB can easily find the right / (root) and /boot partition now. |
| How To Re-install GRUB Using The Ubuntu 'Alternate Install' CD If you have installed Ubuntu first and Windows later, Windows will write it's version of MBR code to the first sector of your first hard disk. This makes the MBR point to it the Windows boot sector and from there to the NTLDR and boot.ini files in Windows. You'll need to re-install GRUB to MBR if you still want to dual boot. There are numerous ways to re-install stage1 (pointer to GRUB), to your MBR. That will make your first hard disk's MBR point to GRUB files in your Ubuntu /boot directory again.
Re-installing GRUB using Rescue mode in the 'Alternate Install' CD Before I start I want to know which disks and partitions I have, and which filesystems are on each one. Many people can remember this information, but others will need to check and confirm. (Recommended). Of course when you can't boot your Ubuntu install you will need to do this using a Live CD. The 'sudo fdisk -lu command is the best way to check. (Illustration below).
Once this is noted, it's okay to re-boot with the 'Alternate Install CD in the CD-ROM drive. ![]() I boot the 'Alternate Install' CD and select 'Rescue a broken system'.
Choose your language
Choose your country
Choose your keyboard layout
For example I have inserted a blank floppy disk and typed "(fd0)" on the line.
|
| MBR Backup and Restore
Recommended - Especially for all Microsoft Vista users, this
backup will include your MBR 'disk signature' - vital for Vista's boot
loader! :) This is also good for Windows/Linux dual booters who might need to re-install Windows while leaving your Ubuntu install in place. Normally Windows will automatically over-write GRUB's 'IPL' in your MBR, and you will need to re-install GRUB. If you want to take a shortcut, you can easily back up your MBR in Ubuntu using some 'dd' commands. code:
You may substitute anything you like for a name for the file. I don't always call mine 'MBR', I recommend something descriptive, possibly including a date in the file name. It might also be an idea to make your own 'readme' text file to remain in a folder where the MBR back up is stored to explain what the file is. For example, whether it has GRUB or LiLo on it, or Windows IPL. This may come in handy if you end up with several similar files. quote:
When I open /home/herman directory, I should find a file named MBR.img there somewhere, and I can then copy it anywhere I like to store it until it need to be used.
Restore command: code:
Of course, you would need to plan in advance how you will access this MBR back-up on your hard-disk when you can't (automatically) boot Ubuntu. You could still boot from GRUB's Command Line, or from a GAG Boot Manager CD, or just use a Live CD to mount your Ubuntu partition and issue the command to restore your MBR that way. |
I scan Ubuntu Web Forums regulary and try to keep it up to date as the software changes and as I learn something new about each error message. This should help most people solve many of the most common and simple booting problems. This is even becoming useful for some slightly more obscure or peculiar problems as time goes on. Just remember this is not a complete or exhaustive list of problems and solutions by any means, (far from it), at least but it's somewhere to start from. When troubleshooting booting problems, recognizing where the error message comes from is almost as important as what the error message is trying to tell us. For that reason I have divided this section up according to where the error messages can come from. If you don't know you will be able to click on any of these links and look for your error message in the next menu. If you don't see if, click your browser's 'back' button to return here and try another link to a different menu.
|
Normal Grub startup text If you are quick enough, in some computers you may see these
messages flash past in your monitor during a normal, healthy grub
boot-up,
Then you should see your Grub menu,
If you selected linux, or allowed it to load by default, here is what you should see blink up in your monitor just before the usplash screen loads,
If you selected Windows,
Once again, unless you are extremely quick with your pause/break key, you need to be extremely fast to catch these text messages. However, when there is a boot problem, it is likely you will see your system pause with one of these text messages partially completed and probably an error message to give you a clue about why the process stalled. |
BIOS Boot Up Errors The BIOS (short for 'Binary Input/Output System) is the first thing you need to have working properly right after you press your computer's power button. The motherboard BIOS is located in a small chip on the motherboard. BIOS - Wikipedia. The PC's BIOS contains the motherboard's clock and calendar and runs from a watch battery on the motherboard so it continues to run even when the rest of your computer is shut down. Before the computer can boot, the BIOS must perform a P.O.S.T. (Power-On Self Test), which is sort of like a role call to check and make sure all the important computer parts are there and in a fit condition for booting. If the signals returned by each of the important parts of the computer indicate they are there and they are all okay, the BIOS will look for the MBR in the first hard disk and start to boot the computer. See: P.O.S.T. - Power On Self Test - Wikipedia. If there is something wrong like a vital part of the hardware is missing or damaged, the BIOS won't let the computer start. Instead it will give a beep code through the motherboard speaker and/or print an error message on your screen. HINT: The BIOS battery on the motherboard needs replacing every two or three years or so. If the computer's time and date are out and the computer doesn't boot maybe the battery is getting old. Index
BIOS beep codes If your computer beeps at you when you try to start it, you should count the numbers of beeps and look up the code in your motherboard manual or on the internet to find out what the beep code means to find out what your motherboard is trying to tell you. Here are a few web pages that might help for a start, Power On Self Test Beep Codes for AMI and Phoenix BIOS - PC Hell Computer POST / beep codes - computerhope.com BIOS Beep Codes - pantherproducts.co "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER" The BIOS has looked around in the list of devices listed in the BIOS boot sequence you set in the CMOS and has not found a bootable device. 1) Check your BIOS boot order in CMOS and make sure this computer is set to boot from the device (eg, hard disk, cdrom drive, floppy drive, or the like), that you are trying to boot. 2) After that, check that the device has a bootable media present. For example, if it is a cdrom or floppy drive, is the media bootable in some other machine? 3) If it is a hard disk, if the drive has been newly installed, has it been plugged in and jumpered correctly and set up in the BIOS? 4) Is the MBR is okay? "Non-System disk or disk error replace and strike and key when ready" Example thread: http://www.ubuntuforums.org/showthread.php?t=295098&highlight=grub Disk I/O error There was an error trying to read from or write to your hard disk. Your hard disk might not be plugged in properly or your hard disk may have some other kind of hardware problem. You may want to check on the health of your hardware with a Linux live CD, Hardware Detection and Testing. NTLDR missing There are two kinds of 'NTLDR is Missing' errors. One kind comes from the BIOS and this appears before any bootloader loads, (whether it will be GRUB or NTLDR), so you do not see the GRUB menu yet. That's the one I'm talking about now. The other kind of 'NTLDR is Missing' error comes from Windows, after GRUB has done its work and chainloaded Windows by its boot sector okay, but there is something wrong in Windows. That's listed under ' Error messages from Windows .....(Windows begins to boot, but...)...' This section is about when that error comes from the BIOS. Your computer gives this message when it has found a non-bootable disk and it is trying to boot from it. Check to make sure you don't have a floppy disk in the floppy disk drive. That can often interfere with booting. The same goes for USB devices. Make sure your hard disk is properly detected in your BIOS. Check both your Hard Disk Boot Priority and your bootable devices boot sequence in CMOS. It is probably not true that NTLDR is missing at all, you should be able to see all your Windows booting files if you mount your Windows filesystem in Linux (LiveCD or installed OS), and take a look for yourself. It will look like the illustration on this link, A Birds's eye view of Windows XP (showing the bootloaderfiles) Hard disk boot sector invalid, press H to retry hard disk or any other key for floppy. Try settiing the boot flag on the partition with Super Grub Disk . Go 'English Super Grub Disk'-->'Boot and Tools'-->'Activate Partition of, then select your hard disk number from a list, then your partition number to be activated. You can also set the boot flag with disk partitioning software like GParted or Gnome Partition Editor in the Ubuntu Live CD. Example thread: http://www.ubuntuforums.org/showthread.php?t=296137&highlight=grub |
GRUB Errors
The basic information in this section has mostly been copied from the
official GNU/GRUB Manual, which is not my work. I have used that as a foundation to work from and I am adding additional comments that I am collecting by helping in and observing Grub related threads in Ubuntu Web Forums. I hope that Ubuntu users especially will refer to this list and find the solution to their GRUB problem or that of someone they may be trying to help. Here's a link to the GNU/GRUB manual, it has lots of good information in it you can refer to. Also, here is a link to GNU GRUB FAQ. See also: Gentoo GRUB Error Collection - external link
|
GRUB Stage1 Error Messages GRUB hard disk error Quoted from the GNU/GRUB manual
Check that your hard disk has been properly detected and set up in your BIOS. Make sure your hard disk is properly detected in your BIOS. According to these links the best hope is to try updating your BIOS, GRUB hard disk error GRUB fails to load (GRUB Hard Drive error) UPDATE: Look at page 4 of that first thread, where it has been found that re-installing GRUB with GRUB's install command solved this error for some people. The idea of using that command is to make stage1 point directly to stage2, without any stage1_5. floppy error
I don't know anything I can add about this error message. GRUB Loading stage1.5 Read Error Quoted from the GNU/GRUB manual,
Another link I read but can't seem to find again said to re-install GRUB with the grub-install command, because that refreshes the GRUB files in /boot, and also in the MBR and first track case something had been corrupted somehow. For example:
Here's the best link I have found so far about GRUB Loading stage 1.5read error, Nabble - Grub - Bugs - fixing the "grub loading stage1.5" hanging error adrian15, the author if Super Grub Disk, says to re-install GRUB without the stage1.5 by renaming the stage1.5 to some other name, then re-installing GRUB. Stage1.5 is optional, so that should work. My idea is to try running a file system check on the /boot or /root partition and see if that helps, Running a filesystem check on an ext3 filesystem | Running a filesystem check on a reiserfs filesystem. A file system check is always a good idea. GRUB geom error Quoted from the GNU/GRUB manual,
See this link: SDB:The Boot Process Hangs with the Message GRUB Geom Error GRUB loading stage1.5 Looks like,
or you might see this message instead,
You can try to reboot by pressing your Ctrl + Alt + Del keys, but it will just do the same thing again. First, the simplest thing -please check your CD drive and make sure there isn't an unbootable CD-ROM still left in there from last time you used the computer, same goes for floppy disks too. I don't know why, but sometimes they can interfere with booting. (It's rare, but can happen). This problem is more likely to occur when trying to boot up a newly installed system or after an internet update. It can be caused by corrupted files in the /boot/grub directory. You'll need to boot with Super Grub Disk, use the feature 'direct boot' If you have only one Linux or a standard dual boot with one Linux and one Windows install 'English Super Grub Disk'-->'Gnu/Linux'-->'Boot Gnu/Linux Directly' will bypass those corrupted files and boot your operating system. (Even if they are not there at all)! For advanced users who might be multiple booting or have a non-standard arrangement, go 'English Super Grub Disk'-->'Advanced'-->'Gnu/Linux Advanced'-->'Boot Gnu/Linux Directly'. That will give you the opportunity to manually select the disk and partition of the operating system you need to boot. Once you are booted up and running the system, it's easy to fix if you know the right terminal commands to use. Just remove the corrupted files and replacing them with new ones. First, save your menu.lst (or grub.conf), to your /home/username folder to get it in a safe place until you are ready to restore it again. Then remove all those bad files in /boot/grub. Copy back your menu.lst, and reinstall GRUB. Here are the commands, Code:
Note: It is best if you can copy and paste these commands to aviod typing errors. If you do decide to type in your own commands, be aware that the '.' following the space at the end of the first command is a way of abreviating '/home/username' (directory), so the command will not work without the space and . after it. Starting up... Looks like this,
Erik solved this problem himself by unplugging a sata drive cable from the motherboard and plugging it into a different sata port, where it used to be originally. For details, see this Ubuntu Web Forums thread: Boot problem. GRUB_ Looks like this,
If you see this GRUB error just after you installed Linux with Windows XP on a Toshiba laptop, and if it has an 'Express Media Player' partition, this is reported to conflict with GRUB, as it uses the first track of the hard disk which is normally reserved for boot loaders. GRUB uses the first 15 sectors following the MBR for the optional stage1_5 of GRUB to be installed there. Deleting 'Express Media Player', has been reported to have successfully solved this problem. If you don't want to delete your 'Express Media Player' partition, you can instead try doing without the optional stage1_5 of GRUB in the first track of your hard disk. Super Grub Disk has the ability to install grub without the 1.5 stage files: http://www.supergrubdisk.org/wiki/WindowsErasesGrub Thanks goes to meierfra for the above information. Otherwise, you might have to give up the idea of using GRUB installed to that hard disk. Restore the Windows Bootloader instead, with Super Grub Disk. English Super Grub Disk--> Windows --> Fix Boot of Windows, and try to find some alternative way of dual booting. You can just boot your Linux with Super Grub Disk for now, and as soon as you feel like it, make a GRUB CD of your own. The following website has advice peculiar to dual booting Windows Xp and Ubuntu when you have a Toshiba Laptop, Matthew J. Miller's HOWTOs: Dual Booting Ubuntu Linux and Windows on a Toshiba Laptop. grub grub grub ... Looks like,
Try re-installing GRUB to MBR without stage1_5 by using GRUB's install command. Refer to the following links, Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. -LinuxQuestions.org GRUB GRUB GRUB GRUB - Scatter Gather Thoughts by Johan Petersson Gentoo GRUB Error Collection |
| GRUB Stage1_5 and Stage2 Error Messages Returns to a grub_ prompt instead of trying to boot A GRUB CLI prompt looks like this,
You can investigate a computer with GRUB's command line. Type help for a list of commands you can use. Here is a link that will teach you how to use Command Line Interface (CLI). Usually,
this means GRUB's stage1 and stage1_5 files were able to find GRUB's
stage2 in the operating system's partition but the stage2 can't find a
menu.lst file to load a menu from.
Did you delete or rename the menu.lst file? Did you move your menu.lst out of the /boot directory? I had this problem while trying to boot Windows in a second hand computer I bought from a friend for a test computer. Even though I had though I had done a clean re-install, after several reboots I began to notice things were abnormal. Soon, it wouldn't boot Windows and left me at a GRUB prompt. I found out that the entire Windows partition had been corrupted and looked as if it had been encrypted. (All the files were scrambled up and had strange filenames that consisted of a mixture of parts of words mixed with stange fonts amd symbols). I have re-installed again and I am waiting to see if it happens again by itself. If not, it might have resulted from some experiments I was doing that could have corrupted the filesystem. I will repeat those experiments and see what happens. Update: The problem has never returned, I think it probably was a virus in Windows and clean-re-installing Windows has removed the virus. Operating System not found Looks like this,
Consider installing a boot loader to the MBR of the disk you are trying to boot. Quoted from the GNU/GRUB manual
One way to produce this error on purpose at GRUB's Command Line Interface is to type something like 'kernel (hd0,1) vmlinuz' The correct way to type it is with the forward slash to indicate the root of the file system, like this, 'kernel (hd0,1)/vmlinuz' Check to make sure your menu.lst doesn't have a silly syntax error like that. Quoted from the GNU/GRUB manual
Here's a link to the first instance of it I've noticed, [ubuntu] GRUB error 2... I want to kill my laptop. Note the explanation by caljohnsmith in post #6 there, quote:
GRUB's 'makeactive' command is used for setting a boot flag on a partition, so you can also do it with GRUB. Windows in particular requires a boot flag or it won't boot. If more than one partition has already been marked as active, you might need to remove the 'active' flag from one of them, as only one is supposed to be set as active at a time. Use your favourite partition editing software for that. If nothing else works, you might be able to use TestDisk to write you a brand new partition table. TestDisk is an excellent Linux program that can scan you hard disk for partition starting blocks and identify those and offer you the chance to have the one you select written to a new partition table for you. TestDisk can do lots of other useful jobs as well. This website has its own page about TestDisk, TestDisk Page. You should always back up your data before using any software to work on your partition table. If you can't boot any operating system you might need to use a Live CD for doing that, and you can visit these links to learn how, File Systems and Mounting Page, SSH Network.
The GRUB program lives in Ubuntu inside /usr/sbin, and the grub-install command runs a script that refreshes the GRUB files in /boot or overwrites the corrupted ones with files stored in /usr/sbin and re-installs GRUB's stage1 file to a MBR or boot sector and possibly stage1_5 (to the first track of a hard disk). You will need to do a direct kernel (or symlink) boot from a GRUB CD or Super Grub Disk to boot into the operating system to run the grub-install command. Another solution would be to 'chroot' into the system from a Live CD.
You would get GRUB error 8 if you tried to boot without first specifying a kernel, for example, Code:
This Ubuntu Web Forums thread contains a good example, GRUB: Error 11: Unrecognized device string. See how logos34 spotted the syntax error? Syntax errors can be very sneaky and it often takes a good eye to spot them.
GRUB's 'makeactive' command is for setting the boot flag on a partition, to make that partition 'active'. GRUB can't set a boot flag in a logical partition as far as I know,and that's why it gives error 12. Normally, Windows is only bootable in a primary partition. However, the Windows default method of dual booting more than one Windows system deleted the vital boot loader files from the new Windows system being installed and copies them into the old existing system. The subsequent Windows installation can only boot via the original installation. In this case, Windows users call their original installation their 'boot partition'. Unfortunately for Windows users, once the installation has been completed that way, it means if they delete thier original installation, it becomes impossible to boot their new installation, which is normally in a logical partition, just to make things even worse. For more information see, Understanding MultiBooting and Booting Windows from an Extended Partition Dan Goodall. That is why Windows users are better off dual or multi booting with GRUB. GRUB is a much better bootloader and boot manager than Windows' own bootloader when it comes to dual or multi booting. GRUB provides Windows users with special tools such as the ability to hide and unhide partitions to allow a subsequent Windows to be installed independantly of an existing installation. Then each installation retains it's vital boot loader files and remains independant. There are lots of ways for Windows users to use GRUB, even without installing Linux. They could install WINGRUB, GRUB4DOS and WINGRUB Project Homepage. WINGRUB is very good, I have tested it in a FAT32 filesystem Windows XP Home Edtition and it is currently working very well for me. Otherwise it is easy to download and use Super Grub Disk or make their own GRUB floppy disk or CD. If Windows is already installed, the damage has already been done. There are two ways to make a Windows installation in a logical partition bootable again. One way to possibly recover your Windows installation might be to make a lot of room on the disk somewhere with GParted -- LiveCD or Gnome Partition Editor in a Ubuntu Live CD. Make a new primary partition big enough to copy and past the whole Windows partition into, so it will be in a primary partition now. Then make a Windows Xp boot floppy, Click Here for a how-to. Then try to boot it. A website that is extremely helpful when Windows XP is impossible to chainload is this one, How to fix: NTLDR is missing, press any key to restart by Miles Comer. You can download boot discs from this site now that have the needed Windows files that would have been deleted with your primary partition, those should help you. Vista users, go here: Windows Vista Recovery Disc Download - Neosmart.net, thanks lswest for the link. Thanks for the download to Computer Guru, of NeoSmart Technologies (the developer of EasyBCD). After Windows boots up copy the three vital Windows XP boot loader files from the floppy disk or the CD to the root of the Windows partition. I have tested this several times myself and I know that it does work in a test computer. After that, you should be able to boot Windows with GRUB without any problems. What I am not so sure about is if it's okay to copy and paste a Windows partition without activating any anti-piracy software booby-traps that could include a count-down timer. Windows might stop working some day when you least expect it. I have read that these things exist in proprietary software but I'm not sure as I haven't kept a test install for that long. A second way to make Windows bootable in a logical partition is to use GParted -- LiveCD or Gnome Partition Editor in a Ubuntu Live CD to set the boot flag in the logical (Windows) partition. GRUB can't do that, but a partition editor can. Then you need to either delete or at least 'comment out' the 'makeactive' command from your /boot/grub/menu.lst file so GRUB will skip trying to move the boot flag and won't be stopped with the 'Error 12' message. You will need to download a boot discs from this site, How to fix: NTLDR is missing, press any key to restart by Miles Comer. Boot discs from that site have the needed Windows files that you would have been deleted with your Windows primary partition, that boot CD should boot Windows for you. Copy the three vital Windows XP boot loader files from the floppy disk or the CD to the root of the Windows partition and Windows should now be bootable from GRUB. Vista users, go here: Windows Vista Recovery Disc Download - Neosmart.net, thanks lswest for the link. Thanks for the download to ComputerGuru, of NeoSmart Technologies (the developer of EasyBCD).
Are you trying to chainload a Linux partition by the boot sector? The first sector of a partition is often called the 'boot sector', as it can have boot loader code installed there. With Linux it is optional to have any boot code in the first sector of the partition and it isn't installed there by default in most distros. You have to install your bootloader to the partition yourself. After you do that, then you can use the chainloader command and it should boot. If you were using the kernel command to boot Linux directly, and you got the GRUB error 13 message, it might be that you have just received a kernel update and your new kernel update didn't go as planned. Something could be corrupted or incomplete there somewhere. There is normally a list of kernels in your GRUB menu that you can boot, entries for the newest kernels are added to the top of the list. You can try booting an older kernel by scrolling down your list in your GRUB menu and boot up with a known good kernel. Then use Synaptic Package manager or apt-get if you know how, to uninstall the corruped kernel. Try updating it again and hope for better luck this time. When trying to boot Windows The chainloader command is the only way to boot Windows from GRUB. GRUB's chainloader command finds Windows boot sector and hands over control of the booting of Windows to Windows' boot loader there. GRUB does not actually boot Windows at all. For this to work, the Windows boot sector must be okay, if it is corrupted, Windows can't boot. One user reported receiving this error when trying to boot Windows and found the Windows bootsector had been corrupted somehow. The FIXBOOT command from a Windows recovery console would normally be the recommended way to repair a Windows bootsector and other files, but not all Windows users are able to access a recovery console easily. In an NTFS partition, the backup of boot sector is stored in the last sector of the partition. I don't know the ntfsprogs command for restoring that yet. TestDisk is a program you can install in Ubuntu, and TestDisk can easily restore the boot sector in an NTFS partition from the backup, or even rebuild an NTFS boot sector, TestDisk has their own page with illustrations, here is a link, TestDisk Step by Step. If you want to install TestDisk in Ubuntu, use a command like this,
To run TestDisk, you start it with the testdisk command,
If it's a FAT32 file system in Windows you should be able to fix it from Linux. Run dosfsck -ar on it, refer to this link: When the bootsector is not the same as its backup
Open your menu.lst file with 'sudo gedit /boot/grub/menu.lst', if you are using Ubuntu Linux. Use the command 'ls /boot' to check for the correct name for your Linux kernel and initrd.img. Copy the correct name from the terminal output to the text file and paste it to avoid typos. Don't forget to save the changes in your menu.lst file before your close it. A Second, reason GRUB Error 15 can occur is when using the 'configfile' command from some other (older) GRUB to boot Intrepid Ibex's (or later) via the new menu.lst file which now features the uuid instead of root (hdx,y) line.
Intrepid's GRUB has a special patch (additional code) for enabling the use of the uuid number instead of the traditional 'root (hdx,y) notation for telling GRUB which partition to boot. Older or standard versions of GRUB don't have the patch, therefore, they can't understand the uuid command, and so they error out. To fix that, one obvious workaround would be to replace the uuid line in Intrepid's (or later) menu.lst with a conventional 'root (hdx,y)' line instead. Or, even better, you could install that operating system's GRUB stage1 to the boot sector of it's partition and use the chainloader command to boot it instead, and leave the menu.lst as it is, keeping the uuid line. The uuid line is an improvement to GRUB, it means that we can plug in USB drives or more hard disks without upsetting GRUBs drive numbering system and thus throwing GRUB out of whack. Re: [SOLVED] duel booting multible versions of linux - (see post #36 and later), Ubuntu Web Forums. Third, this error can also occur if the files needed to boot with are missing or corrupt in the /boot/grub directory. Refer to Grub loading stage1.5 for how to completely delete possibly corrupted GRUB files and restore them again from /sbin/grub.
If you have a GParted -- LiveCD you can boot that and right-click on the filesystem you need to check and select 'check' from the right-click menu. That will fix a lot of filesystem problems. A GParted LiveCD is free and only a small download (45 MB or so), and it is almost indispensable. If that doesn't work or you would rather use your own commands for filesystem checking, see this website's File Systems and Mounting Page. Type 'man fsck', 'man e2fsck', or 'man reiserfsck' into an terminal and make up a command with the right options to fix your specific filesystem problems. Check your SATA drive cables, especially if you have recently been reaching inside your computer case. Are they plugged in nice and snug? Ubuntu user halw in the following post had GRUB error 16 intermittently and loose SATA cables are suspected, Grub Error 16 (halw).
Ubuntu Intrepid Ibex and Ubuntu Jaunty Jackalope are pretty near immune from most of the old causes of GRUB Error 17, because GRUB can find the operating system's specified boot and root partitions by the file system UUIDs now instead of using hard disk and partition numbers for booting with. With the use file system UUID numbers, GRUB can find the correct partitions and boot even if the operating system is in a USB flash memory stick at the end of a whole daisy chain of other flash memory sticks and USB devices. I have tested it myself and it works every time. You can mix IDE and SATA drives, and add or remove hard disk drives and it won't affect your booting, (except if you remove the first hard disk). GRUB Error 17 in Ubuntu versions later than Hardy Heron is almost always caused by a file system problem in your Ubuntu partition. A file system check should fix it in almost all cases. This is a good thing to try first because a file system check is always helpful even if the file system is okay and it may solve the GRUB Error 17 problem right away if the file system did need repairing. A lot of people have solved their GRUB Error 17 problems simply by running a file system check. See this website's Running a filesystem check with GParted for a user friendly GUI method of running a file system check in your Ubuntu partition from a Ubuntu Live CD. Even better, if you prefer the command line, see Run a filesystem check on an ext3 filesystem for how to run a manual file system check and fix your Ubuntu partition's file system. INFORMATION BELOW HERE IS OUT OF DATE BUT STILL INCLUDED FOR USERS OF OLDER OPERATING SYSTEMS Other Linux distros such as Linux Mint, which are slow to convert to the use of uuid numbers for booting with, are still prone to GRUB Error 17. There were three different situations when we used to get GRUB error 17 in older versions of Ubuntu,
When trying to boot Linux (even if you only have one hard disk) Check your /boot/grub/menu.lst file and make sure to check your operating system entry's 'root (hdx,y)' details are correct. For example,
If you have used hard disk partitioning software recently and you have copied and pasted your partition that contains GRUB, it probably has a different partition number now than it had before. Some partition editors (especially proprietary ones), think that partitions should be numbered in disc order so they renumber you partitions on you without telling you. That's one cause of GRUB Error 17. If that's the case, you probably need to (a) Consider upgrading to a more recent version of Ubuntu. (b) edit your /boot/grub/menu.lst file to make it point to the correct hard disk and partition number (c) re-install GRUB's IPL to MBR in your first hard disk (a) Upgrade to a more recent version of Ubuntu or install a more recent version (b) edit your /boot/grub/menu.lst file
Whichever way you do it the idea is to check and repair your operating system's entry in menu.lst. You'll need to check the current partition number with fdisk or Gnome Partition Editor. (c) re-install GRUB's IPL to MBR in your first hard disk You may need to Re-install GRUB using your Linux Live CD, or if you prefer, you can use Super Grub Disk to re-install GRUB. If you tried the solutions above and it does nothing helped, try this solution posted in to Ubuntu Web Forums by AmericanYellow, here is the link, Grub error 17 (Make sure your hard disks are properly detected in your BIOS and set to AUTO, (not LBA, large or normal). Thanks AmericanYellow for that information. redenex, also in the same thread, solved his GRUB error 17 problem with a file system check. That has worked for quite a few other people as well. In a computer with more than one hard disk GRUB error 17 could be caused by any of the above mentioned problems for single hard disk machines or else some confusion or disagreement between your computer's BIOS, the Linux kernel, and GRUB over which hard disk is the first hard disk and which is the second hard disk and so on. This only applies to older versions of Ubuntu, Hardy Heron and earlier, and Linux Mint and other distros. Consider using the uuid command in your menu.lst file or consider upgrading to a more recent version of Ubuntu. Symptoms include GRUB being installed to MBR on the wrong (non-first) hard disk, and the /boot/grub/menu.lst file having the hard drive numbering wrong in each operating system entry. Mixed IDE and SATA hard disks Error 17 also commonly occurs when we have a mixture of IDE and SCSI or SATA hard drives plugged into the same motherboard. If this is your situation, just try switching the 'Hard Disk Boot Priority' around in your BIOS. Here's a series of illustrations showing how I do mine, Changing the hard Disk Boot Priority. I realize of course that most computers will have a different BIOS from mine, it would be impossible to give exact information that will suit everyone, but you should be able to see what I mean. This method is proving to be the fastest, easiest and best solution for GRUB Error 17. No time consuming editing of files or re-installing GRUB is necessary when the problem can be solved this way. This method worked for NavyRST in the following thread: HOW-TO install boot loader from Ubuntu. This solution should be fine for most computers, and it's well worth a try before resorting to editing configuration files and re-installing GRUB. Another thing that can definitely cause this kind mix up is when someone changes their hard disk Boot Priority in their BIOS in a computer that was working okay. Therefore, it is not too surprising that one of the best solutions to this problem is to try switching the order of your hard drives back again. PATA Settings and Connections GRUB Error 17 is also likely to occur if you have PATA hard drives (IDE) and you or your computer technician made a mistake with the way they are plugged in and jumpered, (master, slave or cable select). Shine a light around inside your PC case and check your the way your PATA disks (including your CD/DVD drive), is plugged in and jumpered. A PATA ribbon cable with black plugs is a standard PATA cable, and a cable with color coded plugs is a 'Cable Select' type of PATA ribbon cable. The use of a standard PATA cable requires the hard drives to be jumpered as 'Master' and 'Slave', (even CD/DVD drives as well). If your PATA ribbon cable is the 'Cable Select' type, the blue end should be plugged into your motherboard socket, the grey plug is for the 'Slave' hard drive, and the black plug is for the 'Master' hard drive. You should set the jumpers to 'Cable Select' on all drives connected with this kind of ribbon cable. Make sure your hard disks are properly detected in your BIOS too, and set to AUTO, (not LBA, large or normal). Refer to this thread, Grub error 17, thanks AmericanYellow for that information. GRUB Command Line Interface method A great way of solving GRUB Error 17 is to boot to GRUB's Command Line Interface, by pressing your 'C' key when you are at your GRUB menu during boot-up. If you don't get GRUB menu during boot-up, you can still get a GRUB Command Line from Super Grub Disk, or any CD, floppy disk or USB device with GRUB installed in it. Read what I have in that link and try to boot your computer from the command line. Write down the commands you use that work, because they are the same commands you need to use for editing your /boot/grub/menu.lst file so you will be able to boot with GRUB automatically from now on. You may also need to re-install GRUB, if it has installed to the wrong hard disk's MBR. This problem only happens when GRUB is installed automatically by a new operating system being installed in a computer. This never happens, (or people don't complain of it very often), when GRUB is installed manually from the command line or by Super Grub Disk, because in those circumstances it is the user who directs GRUB to install somewhere. It doesn't seem to me to be really GRUB itself that makes the mistake, it seems more likely to be whatever the operating system's grub-install script queries to determine the order of the devices, (probably the BIOS I would guess). I have read that this problem is difficult to solve for all computers, since the programs are already set up to suit the majority of BIOSes, and any changes made to make the situation better for some will also make things worse for others. GRUB is already the best boot loader I know of for configuring itself automatically most of the time, so it's probably not fair to blame it for not being perfect, especially when it could be that hardware and BIOS peculiarities are also to blame. Device.map method Some people claim editing the /boot/grub/device.map file and re-installing GRUB does it for them. Boot with another GRUB, such as Super Grub Disk, and edit the /boot/grub/device.map and re-install GRUB (to the correct device this time). Here is a link with more details about that, Editing GRUB's device.map Probably you would also need to edit your /boot/grub/menu.lst as well. Don't forget to edit your Debian automagic kernels list too, (in the lower-middle of your menu.lst file), to make the changes permantent over a kernel update. groot= Then run update-grub, just to make sure. Code:
Or, leave the /boot/grub/device.map as it is and just edit /boot/grub/menu.lst wrongly to suit, because two wrongs actually do make a right, at least in this instance.
Consider upgrading to a more recent version of Ubuntu. When trying to boot Windows having the NTFS file system (even if you only have one hard disk) GRUB error 17 can be caused by using the 'root' command instead of 'rootnoverify' It is a little better to use 'root' if you have the FAT32 filesystem, but use 'rootnoverify' for NTFS. Edit your commands in your menu.lst or grub.conf file with 'rootnoverify' to get rid of this error message. For example,
The 8.45 GB BIOS hard drive limit was reached when the CHS, (Cylinders, Sectors and Heads) system for plotting the co-ordinates of sectors in the hard disk reached the maximum number of sectors it could address. Windows users were limited to 8.45 GB by its CHS addressing scheme, but that didn't stop larger hard disks from being invented and used. A famous Linux method for utilizing larger hard disks than 8.45 GB was to create a separate /boot partition containing GRUB and the Linux kernel entirely within the 8.45 GB limit in the first hard disk. Linux users could leave room for Windows to be installed within the 8.45 GB limit if they wanted to also have Windows. As long as the Linux kernel was placed somewhere inside the limit, so the BIOS could 'see' it and boot it, the Linux kernel could manage a file system which was located outside the limit. This was possible because Linux was the first to use LBA addressing. Using LBA addressing means that to the Linux kernel, all the sectors in the hard disk are numbered from 0 to whatever number was necessary. Therefore the hard drive was seen more like a roll of film that could be any number of sectors long. Linux wasn't restricted to only the first 1024 cylinders that the BIOS could 'see' with the old CHS addressing scheme. Clever Linux users installed the Linux /root partition outside the limit and in that way they could then make use of much larger hard disks. Historic Link: http://www.win.tue.nl/~aeb/linux/Large-Disk-5.html Now, technology has also passed the 33.8 and 137 GB hard drive limits too, so bear these two in mind as well, when diagnosing error 18 faults. The GRUB error 18 message could nowadays be referring to the 137 GB BIOS hard disk size limit. This occurs when a machine was made for an 80 or 120 GB hard disk, and someone fits a 137 GB+ hard disk in thier machine without checking if the BIOS supports it. Windows XP will work okay because it is usually installed in the first part of the hard disk, so the average user is blissfully unaware of the situation until they maybe install Linux on the second half of their hard disk, past the BIOS limit and get GRUB error 18. Reduce the size of the Linux partition One way of coping this problem which is reported to have worked for some people is to just try reducing the size of the Linux partition. (thus forcing the Linux kernel to be located be inside the limit). I have participated in one or two Ubuntu Web Forum threads where that seemed to solve the problem. A data partition can be used to fill the rest of the hard drive so it won't be wasted. I have also read of three separate instances where users claimed that installing Linux '/' (root) on a logical partition instead of a primary partition cleared this problem up for them. (..."Go figure?"..!) Making a separate /boot partition would probably still be the best answer even with a relatively modern computer if you think you might have the 137 GB hard drive limit. In the following thread, Ioza had a system that wouldn't boot after and upgrade from Feisty to Gutsy. Here is the link, http://ubuntuforums.org/showthread.php?t=582855 Apparently, an operating system that is partly inside the hard drive limit may boot for some time as long as the kernel happens to be located within the part of the disk that the BIOS can 'see'. After an update, if a newer kernel happens to be placed somewhere outside the limit, the operating system might suddenly become unable to boot (at least by the new kernel), and most users would find it difficult to understand the reason why not. Here is a great explanation of how that might happen, also already linked to in the above link, http://www.nabble.com/Grub-tf4291271.html#a12218543 That might also explain the real reason why resizing the Linux partition to a smaller size has helped some people cure GRUB error 18. A separate /boot partition could have fixed that and allowed them to make better use of their hard disk. Here's how to make a separate /boot partition: How to make a separate /boot partition. Actually, if it's a brand new installation and still empty, re-installing would probably be a lot easier, and you can create the new boot partition at the same time as you re-install. TIP: I helped a fellow who had an Asus EeePC 701 and the SSD drive wouldn't work so he installed Ubuntu in a 1 TB external HDD, but it threw GRUB Error 18 at us and it wouldn't boot. We fixed it by copying his /boot files into a directory in a USB flash memory stick and making that into a separate /boot partition according to the link just given above. BEFORE YOU DO ANYTHING, check your computer's BIOS date and settings in case your BIOS can be updated instead. You can check the date of your computer's BIOS by going into 'setup' by pressing the appropriate key during the early stages of booting, something like this: Getting Product Information. Here is a list of BIOS hard disk limits and some approximate dates when these ways to overcome these limits were invented. 2.11 GB or 4095 cylinder limit 3.26 GB or 6322 cylinder limit 4.22 GB or 8192 cylinder limit _______________________________(around 1997 or earlier) 8.45 GB Standard INIT13 limitation (CHS[1024x256x512)____(around late 1990s) 33.8 GB or 66,060,287 LBAs limitation _______________________(August 1999) 137 GB or 268,435,455 LBAs limitation (28-bit limit) _________(September 2001) You could check at your motherboard manufacturer's website, (find it with google), to see if there is a newer update for your machine's BIOS available. If so, you can download it and try 'flashing the BIOS'. That has been reported to have solved this problem many times. BIOS settings If you don't think the BIOS date could be your problem, or there is no more modern BIOS flash available for your BIOS, then at least check and make sure your hard disk is being correctly detected and set up in the BIOS. Quote:
Remember, the old 8.0 GB limit was overcome when the old CHS (Cylinder, Heads, Sectors) method for dealing with hard disk addressing (disk geometry) was replaced by LBA (Logical Block Addressing). (Numbering each sector of the hard disk starting with the MBR and counting upwards). * Check your hard Disk Boot Priority in CMOS. I am able to produce this error if I have operating systems installed in more than one hard disc in my computer and I either remove my first hard disk or switch the hard disk order around in my BIOS. Therefore maybe it should be possible to cure this grub error for in some instances by reversing with the hard disc order in the BIOS. You can try, it might help or maybe not, but it's worth a try. I know you can certianly scramble things up that way, so it seems logical, (notwithstanding Murphy's Laws), we should be possible to unscramble things this way too. (I actually work with an Ashley Murphy, he's a good friend of mine). * Check your IDE hard drive cabling and jumper settings If your hard drives are connected to your motherboard by IDE cables that have black plugs, or all plugs of the same color then probably you have a non cable select IDE cable. If you have non cable select IDE cables then you should make sure your first hard disk is jumpered as Master and your second hard disk is jumpered as Slave on your first cable, and the same thing on your second IDE cable, even if one or two of your drives are CD-ROM drives. If your IDE cable has a blue plug connected to your motherboard and a black plug for the Master of first hard disk and a grey plug for the slave or second hard disk then you should make sure you have your jumpers all set to 'cable select' position. There are stickers on all hard drives to tell you how to position these jumpers. Make sure you have the blue plug plugged into the motherboard and the black plug plugged into the master and the grey plug if used, plugged into the slave drive. Please refrain from using the blue plug for a hard drive and a different plug for the motherboard even if cable length or spacial restrictions make this idea seem attractive. It isn't ! A longer IDE cable is very cheap, like about a dollar or so, and sometimes you can even get one thrown in for free with a reasonable purchase from a freindly computer store. Ways that older Windows computers used to overcome BIOS/Hard drive limits If you have an older Windows machine, the use of 'Disk Manager' (break the 528 mb IDE barrier!) software is a way for Windows users to utilize a hard disk larger than the machine's BIOS would normally support. For a slightly more modern example, there is 'OnTrack Disk Manager' (for the 37 GB barrier). Since those install in the first track of the hard disk, GRUB users should be aware of them in case GRUB's (optional) stage1_5, which installs in the first track of the hard disk, overwrites the disk managment software. People who know they have software in the first track of their hard disk should consider using LiLo instead. 'On Track Disk Manager' (for the 137 GB limit). I'm not sure because I can't see it mentioned anywhere in the documentation, but I believe these are still installed somewhere in first track of the hard disk, so if your old computer does have a disk manager, (not needed for Linux), you should be careful when installing GRUB because GRUB will want to install its optional stage1_5 to the first track as well. I cannot see anywhere where they say it is compatable with Linux either. As far as I know, the use of disk management software is quite rare these days. Anyway, you would not be likely to need one if you install Linux in the second half of your hard disk. The use of disk manager software might be another reason why a computer user might install Linux and then find that Linux doesn't boot in their computer. It's not GRUB or Linux's fault at all, it's because the user is unaware of the fact that their hard disk is larger than their BIOS can support.
You would get GRUB error 19 if you tried to place the initrd command before the kernel command. For example, Code:
I have read of this error being described after the number 2 hard disk with the Linux installation on it has been removed from the machine. GRUB had been installed in the MBR in the number 1 hard disk, and when the number 2 hard disk was removed, the machine could not boot anymore, and showed 'grub error 21'. This is because bootloaders have two or three parts. The first part, called 'stage1', normally is very small, and lives in a special part of the MBR. The second part, called 'stage2', is much larger and lives in the operating system itself. Other bootloaders work the same way too. Basically the only work the small part (stage1) has to do is to find the other, larger part, 'Stage2'. It is 'stage2' that does all the hard work, it can because it is bigger. In the case of GRUB, there is also another part called 'stage1_5' which helps 'stage1' to find the other part. When the hard disk that contained the operating system has been removed, GRUB cannot work because the larger part of it is gone. The first part of GRUB, which is very small and whose only job is to find the larger part, gets help from stage1_5, but if the hard disk with stage2 on it is gone, they cannot find stage2 of course, so they complain by printing out this error massage. Please put the hard disk with stage2 in it back into the machine, and/or make sure it is properly plugged in and detected and set up in the BIOS. If you happen to be using a hard disk larger than 137 GB, see also error 18. Other ways to solve this problem might be, (depending on your circumstances and the situation),
If it is another Linux system with GRUB or LiLo, look in Super Grub Disk's Gnu/Linux for options. If you want a Windows bootloader's stage1 written back to MBR again, look in SGD's Windows. If your computer still has more than one hard disk, look in Advanced for menus that are designed to offer you the most options.
example,
Look at your partitions with your partitioning software or run 'sudo fdisk -lu' in a terminal and make sure you have the partition number correct here in your menu.lst boot entry. This is also the error that people often see after they delete their Linux partition but they still have that partition's GRUB's stage1 written in the MBR. They can easily cure that by overwritting the existing GRUB IPL code with code for another bootloader in another operating system. In other words either re-install GRUB or re-install Windows bootloader or some other bootloader or boot manager. In Super Grub Disk, go 'English Super Grub Disk'-->'Windows'-->'Fix Boot of Windows', or see my 'Un-install Page'. Don't bother doing anything if a new (Linux) operating system will soon be installed, the new operating system will install a new bootloader and cure this error automatically. If there is another operating installed in the computer, re-writing the bootloader'e MBR code for that operating system's bootloader and overwriting the now useless GRUB code will cure the problem. This can be easily done with Super Grub Disk. 1) Re-install a GRUB to MBR from another Linux 2) Re-install a Windows Bootloader to MBR. (These two above items are both options in Super Grub Disk that can be selected and SGD will do it for you). I got GRUB error 22 myself one time after doing quite a lot of work to the partitions in my wife's computer. I tried to fix the boot of grub with an older version of Super Grub Disk, not realizing her partition numbers had been unexpectedly changed somehow by disk partitioning software. I installed grub from the wrong partition by accident. Later I found out the real cause of all the trouble was a dirty DVD/CD-ROM drive that caused read problems from my partitioning CD. Anyway I got Grub Loading Stage1.5 Grub Loading Stage1.5 Grub Loading Stage1.5 Grub Loading Stage1.5...and so on, scrolling endlessly down the monitor. I couldn't even boot with Super Grub Disk's 'English Menu'-->'Gnu-Linux'-->Boot Gnu/Linux Directly'. After much mumbling and head scratching and trying various ideas I decided to run a file system check with my GParted -- LiveCD. When that was done I clicked on the triangular buttons for a report and found that GParted LiveCD had repaired quite a few problems in that filesystem. So tried again, this time from the Super Grub Disk menu I pressed 'c' for a Super Grub Command Line Interface, and booted manually using a direct kernel style boot The operating system booted and I was able to re-install Grub to MBR, and configure menu.lst with new partition numbers. GParted LiveCD saved the day for me. I didn't have to sleep in the doghouse after all! :) The lessons here are, 1. keep my CD-ROM drives clean, and 2. to try a filesystem check if I am having unusual troubles booting. It's easy to run a file system check on any file system with a GParted -- LiveCD, just boot with the CD and click on the filesystem (partition) to be checked and click 'check'. Click 'Apply' (on the toolbar), and then 'Apply' again (in the confirmation box). Then wait a few minutes. When it's finished it's a good idea to click on the arrow shaped 'Details' button in GParted to expand the output box. Make sure you click on all the subsequent arrow buttons too, so you will expand it all fully so you can read the report and see what was done to fix your file system. See my File Systems and Mounting Page for more about file system checking in Ubuntu.
The '0' in '(hd0)' is a number zero, not a capital letter 'O'. If you type a capital letter 'O' in pace of a number '0' in this context, you will receive this error message. I try to make sure there is no confusion between the number 0 and letter O in my web pages by using bitstream vera sans mono font wherever I think of it, that way the number 0 has a dot in the middle of it like terminal font. For example, you can see that 0 is different from O.
Type 'man fsck', 'man e2fsck', or 'man reiserfsck' into the terminal and make up a command with the right options to fix your specific filesystem problems. It is easiest to run a file system check from a live cd. See this website's Running a filesystem check on an ext3 filesystem or Running a filesystem check on a reiserfs filesystem for more info. If you get this error message when trying to boot Windows, Ubuntu user jogui reported that editing the boot stanza for Windows from 'root' to 'rootnoverify' solved the problem when this error message was received when trying to boot Windows XP. Here is a link to jogui's thread, Dual Boot. Thanks to meierfra for bringing that to my attention. A file system check never hurts a Windows file system either, and will normally do some good. It would be best to use CHKDSK from a Windows XP Recovery Console. For more details, see this website's NTFS and FAT32 file system repair and maintenance.
Normally this error has something to do with the way the hard drives and CD/DVD drives are plugged in. Most often the IDE jumper settings will be found to be incorrect. It might be necessary to open your computer case and maybe shine a light in there to take a look around. There are two kinds of hard disk drives,
An IDE ribbon cable normally has three plugs on it, one plug for plugging into the motherboard port and two other plugs. The other two plugs are for hard disc drives, or a hard drive and a CD/DVD drive. Most motherboards have two IDE ports, one called 'primary', and another called 'secondary'. Two IDE ports, each with a cable for two drives means you can normally have up to four IDE drives. There are two kinds of IDE ribbon cable, the older, 40 conductor cable, and the newer, finer 80 conductor ribbon cable.
Check to make sure your hard drive cables are plugged into the right ports If you have IDE drives, make sure the jumper settings are correct, even for the optical drive (CD/DVD drive). Also, don't forget to check that the power cable from the power supply is connected. (It seems obvious). Also, check your BIOS settings and make sure all your hard drives are set to 'auto', and to 'LBA' mode, and are detected and set up correctly by the BIOS.
Pin Assignments for the 40-pin IDE standard - www.ele.uri.edu Quoted from the GNU/GRUB manual
Symlinks to the Linux kernel and initrd.img can be seen in a screen cap of the root of a Ubuntu filesystem here in this link, ...GO You will see the symlinks at the bottom of figure 4 grub there. The actual kernel and initrd.img are pictured in figure 5 GRUB, the next illustration down. This trick comes in handy when you may want to boot a system and it is impossible to know or find out what the exact name and path for the kernel and initrd.img files will be. For example, you are making your own Grub CD, and you don't want to have to make a new CD every time your system has a kernel update. You can edit your menu.lst for the CD-RW with a series of commands to boot the symlinks rather than directly booting the kernel and initrd.img files. Another reason you might want to use this trick is when multi booting other Linux OSes from one GRUB menu, so you don't need to worry about updating the menu manually with each kernel update. You might also prefer to boot via symlinks when booting up from GRUB's Command Line Interface, refer to: Direct (kernel) Boot. The only time I have ever received this error message was when experimenting with WinGrub (GRUB for Windows), see my WinGRUB Page. The reason is that the version of GRUB that WinGrub uses doesn't recognize the Ubuntu GRUB's 'savedefault' commands. One solution is to 'comment out' the savedefault commands in Ubuntu's /boot/grub/menu.lst, it boots okay with the savedefault commands removed. They aren't vital and only a few people use them. The savedefault command allows us to type 'saved' instead of a number after the 'default' command in /boot/grub/menu.lst to have GRUB remember which operating system we booted last time and preselect that one again to boot by default when the computer is rebooted. Refer to: default. - set which O.S. will be booted automatically by the timer if no-one presses a key. Another solution would be to use the chainloader command rather than the configfile command to boot from one version of GRUB to another. When we use the configfile command, the GRUB we're using finds the other operating system's /boot/grub/menu.lst and tries to use it's configuration file to boot with. When we use the chainloader command, the GRUB we're using hands over control to the other operating system's GRUB at the boot sector. That means we can boot a system with a different version of GRUB or even one that has LiLo, NTLDR, or just about any other boot loader. Refer to Configfile Boot. Boot Ubuntu and most Linux systems by their configuration file, and Chainloader Boot. Boot Ubuntu and most Linux systems by their partition (boot sector). Grub Error 26 seems to be quite a rare and unusual error, I haven't noticed this one being reported in Ubuntu Web Forums. Quoted from the GNU/GRUB manual
Also, don't forget if you are working in CLI mode GRUB or a GRUB shell, you can use 'tab completion' by typing the first few letters of a command and then pressing your 'tab' key. That is a great trick as it not only saves a lot of typing, if you are a poor speller or typist, it saves a lot of mistakes and having repeat things until you get it right. ( Just ask me, I know all about what that's like! ) Otherwise, you can look up GRUB commands in the GNU GRUB Manual Here's an example of a series of commands entered correctly, Code:
Here's an example of what can go wrong. You would get GRUB error 27 if you made a spelling mistake in the command 'kernel', for example, a lot of people spell the command wrongly as 'kernal', this will result in an error message. (Even if everything else is correct). Code:
Edit your menu.lst or try again and this time be more careful with your spelling. ... or use 'tab completion' ! :)
To continue booting anyway, you can press 'e' for edit, select the line of the 'savedefault' command, press 'd' for delete, and 'b' for boot. If this problenm will re-occur, it would be best to either hash out, or delete the 'savedefault' commands from the menu.lst file involved. They aren't often important anyway. You may be better off without them.
GNU-GRUB Manual: 9 Protecting your computer from cracking
|
Windows Booting errors
Generally, these are already pretty well
covered. Windows Knowledge Base and many computer forums discuss
Windows errors already, but I'll start a new collection here too.
Windows Booting errors:
disk I/O error - you may see the following print in your monitor, Booting 'Microsoft Windows XP Home Editition root (hd0,0) Filesystem type is fat, partition type 0xb savedefault makeactive chainloader +1 Disk I/O error Replace the disk, and then press any key _ GRUB has tried to chainload Windows, but the Windows boot sector is corrupted somehow. The usual way to fix this problem is to use a Windows XP recovery console, and run the Fixboot command. For Vista users, I imagine the procedure is similar, but you use the bootrec /fixboot command. One alternative is to use ms-sys, the Linux tool for re-installing the Windows boot sector. Here is a link to a cool thread by lswest and bodhi.zazen about how to fix boot sectors and MBRs, http://ubuntuforums.org/showthread.php?t=740221 If you already have Super Grub Disk, a quicker and easier way to do it is to go 'English Super Grub Disk'-->'Advanced'-->'Windows (Advanced)'-->'Fix Boot of Windows (Partition). You can also restore the Windows boot sector from it's backup with Linux in a FAT32 file system or an NTFS file system. FAT32 boot sector restoring: If you have the FAT32 filesystem in Windows, you can replace the corrupted or non-existing Windows bootsector with its backup by running a filesystem check from a GParted -- LiveCD, Any Linux live cd will work, including Ubuntu and Knoppix, provided the filesystem (partition), is not mounted when you do the filesystem check. Code:
Where: 'x' is the letter representing the hard disk of your Windows install, 'a' is most common, but if your Windows is on hard disk number2, replace this with 'b'. Use 'c' for a third hard disk, and so on. Where: 'x' is your partition number, most commonly '1' will be right. If you are not sure, you can check with partition editing software such as GParted, or type 'sudo parted', and then 'p' for 'print'. When the above command has been run, it will show you the differences between your boot sector and it's backup. It will offer you the following choices: 1) Copy the original to backup 2) Copy backup to original (this is probably what you want to do) 3) No action ? The ? is the prompt, I would type '2' after the prompt, and then type 'Y' for yes when asked to confirm this. That's it, your bootsectorwill be instantly restored! Example thread: http://www.ubuntuforums.org/showthread.php?t=296619&highlight=grub NTFS boot sector restoring: The backup copy of the boot sector in an NTFS formatted partition is in the last sector of the partition. You can use TestDisk to restore it. Restore an NTFS boot sector with it's backup . Returns to GRUB when trying to boot Windows It could be that you or somebody has install GRUB to your Windows boot sector instead of to your hard disk's MBR. Just put in your Windows XP install CD, and boot into the Windows XP Recovery Console and use the so-called 'FIXMBR' command. If you don't have a Windows 'Installation Disk', the backup copy of the boot sector in an NTFS formatted partition is in the last sector of the partition. You can use TestDisk to restore it. Restore an NTFS boot sector with it's backup . Windows 95 If you are having problems booting Windows 95, go to Bootdisk.com and download a floppy disk for your version of Windows 95. There are two different versions of Windows 95, the original version had the FAT16 file system and was later upgraded to the FAT32 file system. You need to make sure you download the correct boot floppy for your version of Windows 95.
Only run this command if needed, if you're booting with GRUB you won't need it. If you are only booting Windows 95 then you need Windows 95 IPL in the MBR.
In Windows 95, 98 and ME, the boot sector must points to the boot loader file called IO.SYS
When you are finished, press 'Ctrl'+'Alt'+'Del' to reboot, and remember to eject and remove the floppy disk so your computer will boot from the hard drive. Windows 98 You can download a self extracting file to make your own Windows 98 boot floppy disk from Bootdisk.com. The one I use is called 98SE OEM. To make the boot disk, download the boot98se WinImage Self Extractor file when running a Windows operating system. Place a formatted floppy in the floppy drive and then just double-click on the file. I it will make a boot floppy automatically. You must first of course have your computer's BIOS set to boot from the floppy disk drive before the hard disk in the BIOS boot sequence. See this website's BIOS Page. Just pop the floppy in the drive and boot your computer. You will soon see a black background in your monitor and will be given three choices. These are,
After a few minutes, you will see a prompt that looks like this,
fdisk /mbr will replace the IPL in the MBR to make the MBR point to Windows 98, (overwrite GRUB),
The Windows 98 boot floppy's fdisk/mbr is not recommended for Vista or later, because it alters the 'disk signature', which Vista's and 7's BCD boot loader depend on.
In Windows 95, 98 and ME, the boot sector must points to the boot loader file called IO.SYS
When you are finished, press 'Ctrl'+'Alt'+'Del' to reboot, and remember to eject and remove the floppy disk so your computer will boot from the hard drive. A Disk Read Error Occured
Generally this seems to be a sign of a possibly weak or failing hard disk, according to reports turned up with google. In one instance I was able to solve this for a friend by juggling the partitions with GParted so that the Windows XP partition was at the end of the hard drive and Ubuntu was at the start of the hard drive. That cured the problem, but I can't explain why. Running CHKDSK /R numerous times didn't seem to do any good, but logically, that's what should probably be the thing to do. "Go figure", as they say. 'autocheck program not found - skipping autocheck', and then the computer reboots
If you have a Windows XP Installation CD, you can boot it into a Windows Recovery Console, and issue the command 'bootcfg /rebuild ' command. That command is for automatically fixing a corrupted boot.ini file or making a brand new one if one doesn't already exist. See: How to Use and Edit Boot.ini in Windows XP - Computer Education. I have also produced this error when I used GRUB's 'hide' command to hide the partition and later tried to boot it without remembering to unhiding it with the 'unhide' command. GRUB's 'hide' and 'unhide' commands are useful for booting Windows when you have more than one Windows operating system on the same hard disk. If you have been using GRUB's 'hide' and 'unhide' commands, check that your partition is unhidden. If you have used another bootloader's 'hide' command, please use the same bootloader you used to 'hide' it to 'unhide' it again (just in case there are different way of 'hiding' and 'unhiding' the partition). Here's a link to another website, How to fix: NTLDR is missing, press any key to restart The author of that website explains how to get your Windows to boot up with NTLDR and the other vital Windows booting files on a floppy disk or CD or USB disk. Then when you have Windows booted, you can edit your boot.ini file for next time. There's also a more basic but similar how-to from Microsoft, How to make your own Windows Xp boot floppy. If anyone finds out how to format one of these floppy disks from Ubuntu please let me know, you can copy the files to the floppy disk from Ubuntu okay, but I don't know how to do the formatting part with Ubuntu. Maybe try syslinux? The best thing about using a floppy disk is the fact that we can edit the floppy disk's boot.ini file on the fly from Ubuntu and try to boot again as the floppy disk will have no security attributes set on the file. NOTE: The text editor in Ubuntu makes line breaks differently to the way they are expected in Windows, so you can edit boot.ini carefully from Linux, just to alter the hard disk or partition numbers, but don't start any new lines!!! As soon as we touch our 'Enter' ('Return') key, we will corrupt the boot.ini file as far as Windows is concerned. Viewed from Ubuntu it will look fine, and we won't be able to figure out what on earth could be wrong with it. Viewed from Windows though, (if you could view it from Windows), it will have all the text in one long line with funny little rectangles where a new line should begin. They're not so funny to a Windows user who is locked out of his or her system. If your Windows partition number is a number greater then 4, refer to Windows in a logical partition hal.dll is missing or corrupt Symptoms: The following message is seen when attempting to boot Windows,
Usual cause: There could be lots of possible reasons for Windows to display this message and fail to boot, but it is probably not true that hal.dll is really missing or corrupt. Most often it is just because your Windows partition number has been changed somehow, either on purpose or by accident, by you or by a partition editing program you used. You only need to edit your boot.ini file in Windows with the new partition number to fix this problem. diagnosis: You should be able to see all your Windows booting files if you mount your Windows filesystem in Linux (LiveCD or installed OS), and take a look for yourself. File Systems and Mounting Page It will look like the illustration on this link, A Birds's eye view of Windows XP (showing the bootloaderfiles) Open the file called: boot.ini and see if it has the correct partition number for your current Windows installation. To cure this problem: (if this is the likely cause), all you need to do is either edit boot.ini with the new partition number, or copy and paste the partition again with the partitioning software in such a way that it gets its original partition back number again. Normally, editing boot.ini would be the easiest. For example, say Windows was in partition number 1, but you made it partition number 4 now, by mistake, that's okay, here's your old boot.ini file,
Here's what you should edit it to look like now (if Windows has been changed from number 1 to number 4 partition),
Normally, you can't write directly to boot.ini from Linux, because you won't have the right permissions. It's a locked, hidden, read-only file. Windows doesn't count extended partitions and it only counts partitions which really exist. See: How to Use and Edit Boot.ini in Windows XP - Computer Education. You may be able to access boot.ini from Windows recovery console. This link, A Birds's eye view of Windows XP (showing the bootloaderfiles) shows you how to relax the security attributes for boot.ini in Window XP and gain read and write access to the file. Or another way that should work in Windows recovery console is to just use these two commands : bootcfg /rebuild,
fixboot,
Thanks to saurabh kakkar for letting me know. http://ubuntuforums.org/showthread.php?t=485723 If you still have trouble, here's a link to a great website, How to fix: NTLDR is missing, press any key to restart. The author of that website has anticipated almost every problem you might have and suggested lots of possible solutions to them. You can get your Windows to boot up with NTLDR and the other vital Windows booting files on a CD or USB disk if you have no floppy disk drive. Then when you have Windows booted, you can edit your boot.ini file for next time. Another way you can do it is to make yourself a special Windows XP boot floppy disk with the most important Windows XP booting files on the floppy disk instead. Here is the how-to for that from Microsoft, How to make your own Windows Xp boot floppy It is important to follow their instructions to the letter about how to format the floppy disk or it probably won't work. Once the floppy disk is formatted, we can use Ubuntu to copy the files to the floppy disk if we want. It is easy to mount the floppy disk in Ubuntu and edit the boot.ini file in the floppy disk with any partition numbers you like too. The floppy disk has the FAT32 filesystem and Linux has no problems writing to that. Here's how to Mount a floppy disk in Ubuntu. These special Windows XP boot floppies are great! They have their own copy of NTLDR, NTDetect.com and boot.ini files right on the floppy disk. These bypass almost any problem you could have with booting Windows, they bypass the MBR, the bootsector, and problems with the main Windows booting files. Edit you boot.ini file and reboot. NTLDR is missing, press any key to restart If you get this error message it usually means GRUB has already done its job properly and Windows is trying to boot but has a problem with its own bootloader or in the boot.ini file. To check and see for yourself if NTLDR is really missing, you should be able to see all your Windows booting files if you mount your Windows filesystem in Linux (LiveCD or installed OS), and take a look for yourself. It will look like the illustration on this link, A Birds's eye view of Windows XP (showing the bootloaderfiles) In most cases you will see that the three vital Windows bootloader files, NTLDR, NTDetect and boot.ini, are all there safe and sound. Possible causes: 1) Somehow Windows's partition number may have been changed by a buggy partition editing program. You should have used your Ubuntu installer's hard disk partitioner or Gnome Partition Editor in the Ubuntu Live CD or any good 'Parted based partition editor to avoid this happening. Use a partition editing program to check, normally Windows is in partition number 1 of the first hard disk. (It doesn't matter which end of the disc partition number one happens to be physically located). If the partition number has changed, Windows will need it's boot.ini edited before it will boot. The problem is, you can't boot Windows normally right now to edit boot.ini, so you are stuck... Well not completely. Here's a link to another website, How to fix: NTLDR is missing, press any key to restart There's also a more basic but similar how-to from the makers of the other software too, How to make your own Windows Xp boot floppy Either of those two links contains instructions that should help you boot your Windows Operating system so you can fix it. See: How to Use and Edit Boot.ini in Windows XP - Computer Education. 2) When Windows is in a non-first hard disk, a pair of map commands in GRUB's menu.lst file are normally used. The map commands avoid the need to edit boot.ini to tell Windows it's on a different hard disk. If the map commands are applied when they're not needed (for example if Windows actually is in the first hard disk), or if there's something wrong with the map commands, you could get 'NTLDR is missing. (When really it isn't). See 'Chainloading Windows on a non-first hard disk'. 3) If you have only ever had just one single installation of Windows in your computer there could be lots of possible reasons for Windows to display this message and fail to boot, but it is probably not true that NTLDR is really missing. It might be that the file is there but Windows can't find it because it's file system is all mixed up. A file system check such as CHKDSK /R from the Windows XP Recovery Console might fix it, and maybe a good defrag after you get it booted will improve things even more. 4) If you have had more than one Windows in your computer it could be true that NTLDR really is missing! If you installed your second Windows operating system without using GRUB's 'hide' command to hide the older Windows install, Windows probably set up a Windows default multi boot without warning you. This means all your bootloader files from your new Windows system were quietly moved to your older Windows install without your knowledge. Now you can only boot your new installation through your older Windows. If your old Windows system ever gets a virus or you delete it for any reason, you will lose all your bootloader files for your new Windows operating system too. You should use GRUB as your boot manager when you multi boot Windows. You can use GRUB's 'hide' command to hide your first Windows so your second Windows will install normally. Super GRUB disk can help you if you don't know how to use GRUB from the command line. Super GRUB Disk includes the 'hide' command in one of its menus. Next time you set up a Windows dual or multi boot, use GRUB as your boot manager and Super GRUB Disk to help you set it up. Read this link, Understanding MultiBooting and Booting Windows from an Extended Partition. That is an excellent website and well worth the time spent to read and understand it. Read this link too, http://www.goodells.net/multiboot/principles.htm If your Windows partition number is a number greater then 4, refer to Windows in a logical partition Even if it's really true that NTDLR is actually missing, you can still easily recover your Windows boot. You can go to the following website and download the .iso file to make yourself a special and very powerful boot CD with it's own generic copy of boot.ini in it, plus NTLDR and NTdetect.com, How to fix: NTLDR is missing, press any key to restart There's also a more basic but similar how-to from the makers of the other software too, How to make your own Windows Xp boot floppy Either of those two links contains instructions that should help you boot your Windows Operating system and you can copy the files from the CD into your Windows so you can fix it. If Windows is in a logical partition, you amy need to delete the 'makeactive' command from GRUB, since GRUB can't put the boot loader flag in a logical partition. Use a partition editor to place the boot flag instead. Windows in a logical partition Here is a link you should read, http://www.goodells.net/multiboot/principles.htm. - Did you allow your Windows/Windows dual boot to "Multi Boot the Microsoft way"? Please re-read the above link again. Here is that website's home page, Understanding MultiBooting and Booting Windows from an Extended Partition. That is an excellent website and well worth the time spent to read and understand it. As far as I have read from other websites, in this problem is even worse with Vista. See ' BOOTMGR is missing', just above here. It's not good enough to just 'hide' your other Windows anymore, Vista will still find it and write it's boot loader to it, even if it's on a different hard disk. If you want to install Vista independantly, you have to physically unplug the other hard disks if they have Windows systems in them. To make Windows XP bootable in a logical partition, 1) Use GParted -- LiveCD or Gnome Partition Editor in a Ubuntu Live CD to set the boot flag in the logical (Windows) partition. GRUB can't set a boot flag in a logical partition, but most partition editors can. 2) Then you need to either delete or at least 'comment out' the 'makeactive' command from your /boot/grub/menu.lst file so GRUB will skip trying to move the boot flag and won't be stopped with the 'Error 12' message. 3) You will need to download a boot discs from this site, How to fix: NTLDR is missing, press any key to restart by Miles Comer. Boot discs from that site have the needed Windows files that you would have been deleted with your Windows primary partition, that boot CD should boot Windows for you. Copy the three vital Windows XP boot loader files (ntldr, ntdetect.com and boot.ini), from the floppy disk or the CD to the root of the Windows partition and Windows should now be bootable from GRUB. Here's a link to a thread: [other] How to fix XP when the boot files are missing - meierfra Here's the original post, Re: Grub error 17. \WINDOWS\SYSTEM32\CONFIG\SYSTEM missing or corrupt
Error Loading Operating System (External link) Here is the link, Error Loading Operating System » WhoCares? Type the name of the Command Interpreter When I saw this error message it was caused by me setting my Windows 98SE partition as 'hidden' with a partition editing program and forgetting to 'unhide' it again. You can check to see if your Windows partition is 'hidden' or not with a partition editor such as GParted LiveCD, and unhide it with a partition editor. You can also 'hide' and 'unhide' partitions with GRUB's 'hide' and 'unhide' commands. If that's not the problem, here is a link to great web page that should help most people with this error: Type the name of the Command Interpreter - (External link) vista WINDOWS VISTA and WINDOWS 7
Index
BOOTMGR is missing (Vista/XP dual boot when adding Ubuntu) From Ubuntu Web Forums Thread: http://www.ubuntuforums.org/showthread.php?t=319814 Quote from davidgarcin,
The above quoted problem comes about because during installation, Microsoft Windows operating systems are programmed to search for an existing Windows operating system in any computer they are being installed in. If they find a pre-existing Windows installation in a primary partition, they are programmed to set up a 'Microsoft Default Dual Boot', and install the new operating system in a logical partition and install their boot loader files in the older operating system. Read Understanding MultiBooting and Booting Windows from an Extended Partition. With Vista, even hiding the partition doesn't work, Vista will find it anyway, and even if you install Vista on a different hard disk, it will still set up a 'Microsoft Default Dual Boot'. Unless you unplug the other hard disk before installing Windows Vista. Windows Error Recovery
I saw this black screen advising me to run startup repair after moving the Windows partition with a partition editing program. I decided let it do the repair, but all that happened was, I was shown this blue screen, below,
I used the reset switch to restart my computer. I inserted my Windows Vista Installation CD, and all I got was the same blue screen. So I grabbed my Windows Vista Recovery Disc - (you can download yours from that link) from Neosmart.net, thanks lswest for the link. Thanks for the download to Computer Guru, of NeoSmart Technologies (the developer of EasyBCD). I booted my Windows Vista Recovery Disc Download and it ran 'Startup Repair' automatically. It scanned for problems and said 'Startup Repair cannot repair this computer automatically -> Send information about this problem (recommended) -> Don't send' I closed out of that and hit 'Finish' and went to the command prompt instead. At the command prompt I ran,
When I rebooted, Windows ran CHKDSK and rebooted again and was all fixed. winload.exe is missing or corrupt
An
error message from Windows Vista. Here is a link to a web really good
web page that explains the problem in detail much better than I
can, Refer to: Vista's MBR Disk Signature - Multibooters.co.UK. To solve the problem, look in this page of the same web site, bootmgr and BCD. Scroll to about half way down the page and find the paragraph headed 'Moving Vista', and follow the links provided. If you have time, start from from that web page to that website's home page, Multibooters - Dual/Multi Booting With Vista, and read the other pages that site links you to you will find all the information you need about Windows Vista's boot loader. Windows Failed to start. A recent hardware or software change might be the cause.
Apparently, Windows Vista has been designed to be so fragile and unstable, that even a simple resize operation with GParted will cause it to refuse to boot, here's a link to an outside source about that, Using GParted to Resize Your Windows Vista Partition - the How-To Geek. Thanks to meierfra for letting me know about this one, thread: [SOLVED] Grub Doesn't Detect Vista. Starting up . . .
Looks like the illustration above, with a blinking underscore. There was a version of GParted Live CD that had a program called 'xxd' missing, which meant that if a NTFS partition was 'moved', GParted LiveCD wasn't able to update the NTFS boot sector. Refer to Ubuntu Web Forums thread: Is Partition Magic Reliable? There are two ways of fixing this minor problem. One way to fix it yourself is to use a program called TestDisk to restore the Windows boot sector. You can install TestDisk in Ubuntu,
Once TestDisk has been installed, you can start it with,
Thanks to meierfra for letting me know about this problem and it's solution. A second method for fixing this is to use the following series of commands. First, run 'sudo fdisk -lu', to find out what sector number your Vista boot sector is in,
Then run, (copy and paste this code, and copy and paste the sector number from fdisk at the end of it),
That will return an answer, which will be our input for the next command. Thanks to unutbu for making up this command.
Where: You pasted the answer from your earlier command after the word 'echo'. Where: '/dev/sda1' is the partition number of your Vista partition. Thanks to GParted Live CD for this command. Exit the terminal and you should now be able to boot into Vista. If you still can't boot Vista right away, at least it's fixed enough to run Windows Vista Recovery Disc - 'Startup Repair', and that should be able to do the rest of the work to repair your Vista boot loader. |
Ubuntu
Booting problems
(Ubuntu begins to boot, but can't because...)
Target filesystem doesn't have /sbin/init
In this case the error I'm talking about here can't be solved by editing the menu.lst file and it is caused by some problem inside the Ubuntu operating system itself. This error was apparently solved by Senesence it this thread, /bin/sh: can't access tty; job control turned off, try deleting the UUID number in your menu.lst boot entry and reverting to the old /dev/hda2 style for designating the /root partition, (the partition containing /sbin/init). Here's another variation on the same error, SOLUTION: missing /sbin/init causes boot to exit to busybox/initramfs prompt And here's yet another different explanation /bin/sh: can't access tty busybox, tty Looks like this,
Check your file system UUID number is correct in the second line of your operating system entry commands, for example,
That should solve the problem in the vast majority of cases. There is another booting error that looks something similar to this. The last two lines are the same, but it is a completely different error and doesn't seem as if it can be solved by editing the menu.lst file. It seems to be a Ubuntu error message, take a look at, Target filesystem doesn't have /sbin/init fsck died with exit status 8
Usually, pressing your 'Ctrl'+'d' keys will get the computer over this hang-up and resume booting. If that doesn't work, press 'Enter', and then your 'Ctrl'+'d' keys. Your computer should boot up as normal, but possibly not all your filesystems will be mounted. Sometimes it will also have the wrong resolution as well (everything appears very large in your monitor, and you can't fit everything on your screen). A prime cause of a stalled boot up and this message appearing is when we do some work with partitioning software and forget to update /etc/fstab with the changes. For example, we re-install an operating system or remove a filesystem or exhange one filesystem for another. Each time Ubuntu is booted, it does a quick filesystem check automatically to make sure everything is still okay for Ubuntu to start. This is controlled by entries in our our /etc/fstab files. For example, the entry for the root filesystem in /etc/fstab has a number 1 in the '<pass>' column, that means it will be checked Entries for other filesystems usually have the number 2 in the '<pass>' column, that means they are to be checked. Entries for filesystems not to be checked can be edited with a 0 in the <pass> column in /etc/fstab, that means they will be ignored, and this is a cheat's way top aviod this error message. However, it is best to have the filesystem check done, as it can prevent small filesystem errors from developing to the stage where they may become serious. The best thing to do is edit /etc/fstb with the up to date information for your current partitions, along with their 'UUID' numbers. Here is an example of an /etc/fstab file,
the bootsector is not the same as its backup This error message occurs when dos.fsck checks a Windows FAT32 filesystem and finds something wrong with the bootsector. Press your 'Ctrl'+'d' keys to get the computer over this hang-up and resume booting. If that doesn't work, press 'Enter', and then your 'Ctrl'+'d' keys. This can be repaired later either with a Windows 'FIXBOOT' command, from a Windows recovery console, or with Linux's dosfsck from a LiveCD. Run 'sudo dosfsck -ar /dev/hda1' or 'sudo fsck -v -r /dev/hda1' from a Live CD. I favour GParted -- LiveCD, if you use that, you will have a root shell already, so you won't need to type 'sudo' in front of commands. GParted LiveCD works very well for filesystem repair jobs. Once you apply one of the the commands mentioned, after a breif pause, it will give you a report showing you the exact difference between the bootsector and its backup. It will offer you three choices, 1) Copy original to backup 2) Copy backup to original 3) No action ? You type the answer after the '?' prompt. I suggest typing a '2' so the bootsector will be restored from the backup copy. Be careful here because you probably have no way of knowing whether it's your current boot sector (original) or your backup of your boot sector that has been changed somehow. Normally, it would be the boot sector that has been changed, (possibly corrupted?). Then, it will ask you to confirm, Perform changes? (y/n) I suggest typing 'Y' here. That's it, it should be fixed! If that doesn't work, then try running FIXBOOT from a Windows recovery console. Bad Magic Number in Superblock
Usually, you can just press 'Ctrl+d' keys to resume booting, and your system will boot up quite alright. This is most often just another example of what happens when you forget to edit /etc/fstab with the changes after you do some work with disk partitioning sofware. In this example, the hda4 partition is listed as an ext3 partition in /etc/fstab, so the operating system is trying to apply fsck.ext3 to it. That won't work too well if hda4 has been deleted and replaced with a FAT32 or NTFS partition. When the system is running, just do 'sudo parted /dev/hda p', to see what partitions and filesystems you have. Open etc/fstab, (sudo gedit /etc/fstab), and update fstab with the currently correct details. For more information about how to edit your /etc/fstab file, go to this website's Filesystems and Mounting Page. If the partition you recieve this error message for really is an ext3 partition, then you will probably need to fix it by running some filesytem repair commands. Also see this website's Filesystems and Mounting Page for those. |
'Stuck in the middle' Errors and Symptoms Occurs when: Windows fails to chainload from GRUB Looks like,
Black background, white print on monitor Shows list of GRUB commands Ends with a blinking cursor _ Test: Open a GRUB shell and get grub to 'find' boot.ini, and /or ntldr. If GRUB can't 'find' them, but you can see them when you mount the Windows partition with a LiveCD Linux, then maybe the partition is 'hidden'. A Birds's eye view of Windows XP. Check the partition's status with a partitioning program like fdisk or parted. If that's the problem, then use Super GRUB Disk to 'unhide' the partition. You can also 'unhide' a partition with a partition editor like GParted -- LiveCD If that's not the problem then another possibility is you might be trying to boot Windows in a logical partition without any boot loader files. Windows XP needs boot.ini, ntdetect.com and ntldr in the root of it's partition or it won't boot. Try mounting the partition in a Linux Live CD and take a look at the files to see if everything is there. Windows has a habit of deleting its own boot loader files if we install it after another Windows, (dual boot two Windows systems). The intelligent way to install more than one Windows in a computer is to use GRUB from a live CD or a dedicated GRUB partition to 'hide' the old existing Windows system from the new one you are planning on installing. That way the new system will retain it's vital boot loader files. After the installation, you use GRUB's 'hide' and 'unhide' commands to unhide the system you want to boot up, and hide the one you don't want to boot. GAG Boot Manager can do that for you too, GAG Page. To learn how to cope with this problem and fix your Windows installation, look further down this page to my Windows errors section, Error messages from Windows. |