Results 1 to 4 of 4

Thread: Configuring & Installing Linux Grub

  1. #1
    Join Date
    May 2008

    Configuring & Installing Linux Grub

    In all of our products we always talked about in various ways, software and GNU / Linux. However, we never really focused on topics a little more delicate and more at low level. What we'd like to talk about today is GRUB, the boot loader of the GNU become almost the standard in a GNU / Linux. Almost as long as the boot loader used by Linux-based operating systems was definitely LiLo. Over time, however, GRUB has been able to realize all its potential to become an excellent platform boot loader completely flexible and powerful. But what exactly is a boot loader?

    When we turn on a normal computer program launched the first is the boot loader. The latter is thus, in effect, the main responsible for initiating the various operating systems on your machine. The task of each boot loader should be able to load and transfer control of the system to operating system kernel that is about to launch. In turn, the kernel runs and manages the operating system.

    GRUB is the Grand Unified Bootloader (GNU Grand Unified Bootloader), a project that attempts to solve the entire problems boot once and for all. There are two versions of GRUB: GRUB Legacy and GRUB 2. The legacy version (which is "inherited") is what continues to be used by most distributions even if the development team for the boot loader has long since ceased to add something new. Version 2, however, is that which has the greater contribution of the developers even though it is still considered a version under development and not completely reliable.

    One of the most interesting features is that you have not installed a new partition or a new kernel, you can change all parameters at boot using the GRUB console, and who knows the filesystems. The GRUB boot loader pre-installed on most distributions of GNU / Linux art, including Debian , Ubuntu and its derivatives. Previously, the most commonly used boot loader was LILO.

    Some of the features that have made GRUB are those concerning the possibility of dynamic configuration, meaning that users can change parameters and settings even before the operating system, support for various operating systems and different file systems and finally the possibility of use a graphical interface that is a textual and command-line, to allow users the choice of operating system to run.

    It is the first thing that loads when the computer starts. Provide for multiple operating systems , and different versions of them in the same hard disk. For example, we have Windows and GNU / Linux on the same computer, GRUB will load before any of them allowing us to choose which one to boot. Grub 2.0 is the default bootloader for some of the latest versions of Linux.

    Grub vs. LILO

    Hard disks and partitions are numbered from GRUB and are in parentheses: (hd0, 0) = hda1 GRUB can read directly from file systems, after installing a new kernel of a new OS has only the menu.lst (grub 0.x) and grub. cfg (grub 2.x) will be adjusted, not a call to GRUB, LILO as necessary.

    The amazing advantage of Grub over Lilo is possible during the boot process to change the parameters - it also can be compensated quickly typo. This supplement works even with the tab key as Grub conventional file systems (FAT, ext2 / 3, reiserfs) can read. It also offers the possibility to use MD5 encrypted passwords.

    GRUB has two distinct methods of starting. The first is to load an operating system directly, the other to launch another initiator, which will then load the operating system. In general, the first method is preferable because you do not need to install or maintain multiple managers and GRUB is flexible enough to load a system from a disk or partition arbitrarily. However, the latter is sometimes required, since GRUB does not natively support all existing operating systems.

    How Grub works:

    Sometimes happens that after installing Linux or some other distribution, we have installed in case our original copy of Windows. After installation (making sure that we have not installed Windows on the Linux partition), we realize that GRUB disappeared and we can only boot Windows. Sometimes happens that the system (Windows or Linux) fails with the same or even more disastrous results (may not boot any other operating system.).

    The solution for both cases (and some more rare as to corrupt the first sector and break GRUB) is the same. We install GRUB again. How to do this if you do not start anything (for that matter, you start Windows is like nothing)? For this we use a LiveCD of some distribution that we like, who walks fast and above all, to use GRUB to boot. You can use Knoppix, GentooLiveCD, Linux Live CD or one we have at hand. Ubuntu can be used, but on machines with more than 256 MB of RAM.

    The naming of the disks follows a different logic, as it may be used. The partitions and hard drives are counted from "0". For example, is (hd0, 2) for first hard drive and third partition (hd1, 0) for second disk, first partition 1. The order of IDE - and SCSI hard disks depends on the BIOS. Floppy drives are called (fd0) and (fd1). Grub numbers the partitions from 0 (as (hd0, 0)), so it was in case the first disk is installed and the second hda hdb. The numbering is done in number of disk installed. There is no correlation between / dev / hda hd0 and grub. If your primary disk is hdc hde or it will
    • still be numbered hd0
    • partition hda1 is (hd0, 0)
    • the partition hda2 is (hd0, 1)
    • hdb1 partition becomes (hd1, 0)

    It is assumed that the hard disk is partitioned as follows:
    • hda1: Windows
    • hda2: swap
    • hda3: knoppix
    • hda4: other linux

  2. #2
    Join Date
    May 2008

    Re: Configuring & Installing Linux Grub

    Grub Interface

    If Grub is installed, the boot will show the classic menu with entries for each operating system installed. If you type "and" you get into editing mode and you can edit the entries in the start menu or you can enter commands to start another kernel do not appear on the menu. Grub can read the various partitions and display file names and through auto-completion you are sure not to miss the paths or filenames. This makes it easy to quickly make many tests with different kernel boot parameters, on the fly, without modifying any files. For comparison, with lilo (another boot loader common), or change a boot parameter or to start a new kernel (just for test) is required to boot, edit lilo.conf , run lilo and reboot. With Grub instead just write the changes to the boot: if there is an error and the kernel does not charge enough to reset the system and try again. Found the right parameters can be stored in /boot/grub/menu.lst so that it no longer necessary to insert them by hand.
    • Opens a DOS window that asks the configuration style
    • Next question the GRUB screen resolution leave it as is and click OK.
    • Now ask where we want to install GRUB, write dev/sda1 and click OK.
    • It's the turn of the type of configuration, we chose the third option and click OK MBR.
    • Various information windows will appear, when we reach the final press OK and close the console.
    • Access to K menu / Sitema / Installer wifislax 3.0/ GRUB / Step 3: Install GRUB in MBR.
    • Look in Device place / mnt/sda1 and click Apply.
    • Leave another window to press OK.

    Installing GRUB

    Normally Grub is already installed in Debian. But if you have installed, finally, an OS (like MS-Windows) that ignores the presence of other systems on the disc and want to monopolize your PC, you are in need to reinstall Grub to regain the freedom to choose. Once you find the boot directory, we are installing GRUB. Assuming that we know the partition, which is mounted on / tmp / part, and that / dev / sda is the main drive system, which runs at startup, run this command: sudo grub-install - root-directory = / tmp / part / dev / sda. If we mounted the partition in another site there to change / tmp / part of the mount point.

    Now we hope to load GRUB and detect operating systems. When finished, should be able to restart without the disk and have GRUB working again perfectly. I hope this can solve problems with boot loaders.

    Grub Menu Settings

    The Grub menu is selected through the file /boot/grub/menu.lst . The header of this file can contain many commands. We see only a very simple example, but fully sufficient for our purposes:
    • default 0
    • timeout 5
    • light-gray/blue color yellow / blue

    Insert these lines at the beginning of menu.lst in Grub say that startup will have to wait 5 seconds (timeout) and after that choose the first kernel of the list (the number 0, remember that Grub starts counting from zero?) . The menu will be presented with the colors shown, according to the scheme "character / background", respectively for normal text and highlighted text.

    Now, insert the blocks for the various kernels. As seen to do from a kernel are three commands: root, kernel, boot (or if there is the root initrd, kernel, initrd, boot). In menu.lst should only be used in the first command ( title ) that specifies the name that will appear during boot to that kernel in the Grub menu.

  3. #3
    Join Date
    May 2008

    Re: Configuring & Installing Linux Grub

    Boot from Floppy

    Sometimes you get it in the awkward position of wanting to boot disk system to another, like any disk drive, memory tester (such as memtest86 ) or Flash tools. This is also without a floppy with GRUB particularly simple:
    • A (current) syslinux install if not already present.
    • Determine the position of memdisk (e.g. / usr / lib / syslinux / memdisk)
    • Disk image in / or / boot store (e.g. boot/dft32_v361_b12.bin /)
    • The next time you want GRUB boot into the command line (C key) and enter the following (you can use TAB):
    • kernel / usr / lib / syslinux / floppy memdisk
    • initrd / boot/dft32_v361_b12.bin
    • boot

    It possibly must be activated in the BIOS the floppy drive, even if you have any! Otherwise you get when booting the error message that no valid system could be displayed on the image.

    How to change the Boot Menu

    To change the timeout, the default operating system, the name of the operating systems and boot all the information each of them (as was done earlier in / boot / grub / menu.lst) can be made by / boot / grub / grub.cfg do not recommend doing it this way, as this file is a file created automatically by the system using other files that are to be amended to change the settings Grub2. The file is generated grub.cfg also writing in terminal: sudo update-grub2.
    With this command we can see the names of all the operating systems - sudo cat / boot / grub / grub.cfg | grep "menuentry" | cut-d '"'-f 2

    How to Restore GRUB

    I stressed that we must be careful with the procedure, you may let the computer boot worse if you make mistakes, and we are not responsible Genbeta that your computer decides to take some little legs and thrown through a window. Fortunately, the boot loader is independent of the data, and damage what you have stored on the disk is nearly impossible. And now, once I have put the fear in the body, go with it.

    Boot directory

    The first thing we have to do is know what your hard drive and the data partition with the boot. As you may not have a graphical interface, we will do everything based commands. Quiet will not bite. The data partition with the boot is usually on the Linux distribution to install, at its root is a directory called boot. If you do not know for sure what we have to use trial and error.
    Execute cat / proc / partitions to see the partitions on your computer.

    Should output a list of partitions, style / dev / sdX # (X is a letter and # is a number) as you see in the image. To mount the partitions, create a new directory mkdir / tmp / part, and reassemble with sudo mount / dev / sdX # / tmp / part. To view the contents of the directory, execute ls / tmp / part, and look if there's famous boot directory. If you are, go to the next step. If not, unmount sudo umount / tmp / part and assemble another partition.

    Boot Partition Size :

    The optimal size of a boot partition about 20 to 50MB. With a partition size of 50 MB can be held for up to 10 standard kernels and stock, in my experience, that is more than enough for a normal user. If a lot of boot kernel to be stocked (such as developers or people who build and often much your kernel) is a quantity of up to 100 Mb sense. About this size, it is hardly a meaningful application. For beginners in Linux / Unix, I would personally recommend any / boot partition. Another partition complicates the setup of the computer, so just let / boot into the root file system location (ie /) and not create a separate partition.

    Is it technically calls for a separate partition for / boot properly only if the root partition (i.e. /) at boot is not directly readable. That is, for example, when using hard disk encryption or LVM the case. On very old computers also makes the 1024-cylinder limit of the BIOS problems, even a separate partition on top of the board is required to boot at all.

    It may make sense to use their own common partition for / boot, if multiple Linux or Unix variants (distributions) are installed at the same time in dual boot. Thus eliminating the need for each system installed its own boot manager to install, without the can, the systems interact. Just the partition as / boot in every distribution Hook, when installing a new distribution ensure that this partition is not reformatted. For example, Debian is the data received.

    It can also be useful when using software RAID also create a separate boot partition. Furthermore, a separate partition makes sense for curing a host, the partition is in normal operation, read-only or not at all hung and hung with an update of the kernel rw. This kind of compromise is made more difficult by the kernel. That's on normal desktop computers but no sense. Besides the above mentioned cases, it is not necessary to use a separate partition for / boot and depends on personal preference of the user / administrator, it is always possible.

  4. #4
    Join Date
    May 2008

    Re: Configuring & Installing Linux Grub

    Super Grub Disk

    Super Grub Disk will want a small powerful toolbox to start on its preferred operating system in case of failure, find the sight of windows after installing a Linux distribution or restore GRUB in case of loss. Super Grub Disk is a tool that comes in the form of a LiveCD and is exclusively dedicated to restoring the GRUB boot loader. Available in several versions, including an ISO by just 4.4 MB to burn to CD, Floppy edition and one for installation on a USB device, in a very short space features excellent tools for reinstalling GRUB.

    What you can do with this :
    • Grub remove when needed;
    • Grub restore any loss (either manually or automatically);
    • activate the Windows partition;
    • booting Windows;
    • start a station under Hurd and Solaris;
    • exchange of boot disk drive to another.

    After you download the version best suited to their needs, and you start it, it will show what is the main interface to Super Grub Disk: Using the first item you can choose the language, then you are ready for recovery. Choosing the GNU / Linux, in fact, will open a new page that will offer different solutions, including the ability to reinstall GRUB, start a partition from the hard drive partition to manage the organization, to activate one, and, in If you choose to go forward to the editor, you can use a beta version of the instrument to restore the LILO boot loader is widely used. The method is simple: start on LiveCD (USB versions and disk are also available), wait a few seconds and you'll see a menu asking you which language to use (no less than 9 languages available). Then it will navigate the menus according to what we want to do.

    Other features of Super Grub Disk you are a tool to restore the Windows boot loader, the ability to access the configuration file of a version of GRUB is already installed to make changes, access to partitions as root or as a simple user and manage its own hard drive. One of the methods used for recovery is to use a live distro that can install GRUB again. To get a complete and functional system to boot in live mode, for example, can come in handy ISO image of any version of Ubuntu , and for those who need a small tool from a good solution may be System Rescue CD.

    The way to restore via Live distro is different, and all make use of a simple terminal, and in the following examples will use the Live version of Ubuntu Jaunty Jackalope 9.04.

    Windows, BeOS, OpenBSD

    For some operating systems boot from boot-loader is more delicate because they need the partition from which is "made active (and in many cases this must be a primary partition). Moreover, while Linux Grub can load the kernel and boot with other operating systems, the kernel can only be started by the boot-loader and then Grub native cannot help but bring up the boot-loader native (chain loading) that turn loads the kernel and boot the system.

    Operating systems that must be undertaken in this way are basically three Windows, BeOS, and OpenBSD. The most versatile, even with regard to the installation partition is not primary, it's definitely BeOS. . To start one of these operating systems you need to write (take Windows as an example, assuming that the first partition on a second disc):
    • title Windows
    • rootnoverify (hd1, 0)
    • makeactive
    • chainloader +1
    • boot

    The first command ( rootnoverify ) basically says what is the Windows partition (in our case the first partition of second disk is hd1, 0, corresponding, in Linux, /dev/hdb1 ), the second command, however, makes the partition active (essential for Windows), the third command tells essentially the fact of reading the first record of this partition, and the last command will cause the system to start, running in order all your previous choices.

Similar Threads

  1. GRUB not loading after Installing Centos
    By Buggers in forum Operating Systems
    Replies: 6
    Last Post: 02-05-2011, 10:41 PM
  2. Problem with Grub in Linux Mint
    By aILKE in forum Operating Systems
    Replies: 5
    Last Post: 18-01-2011, 11:13 AM
  3. Installing and Configuring NIS in Linux
    By Xiomar in forum Tips & Tweaks
    Replies: 3
    Last Post: 13-11-2010, 05:44 AM
  4. GRUB messed up while installing Kubuntu 10.10
    By HoGaN 77 in forum Operating Systems
    Replies: 5
    Last Post: 11-11-2010, 11:46 PM
  5. Linux - Configuration Grub
    By JPGargoyle in forum Operating Systems
    Replies: 2
    Last Post: 15-11-2008, 02:26 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Page generated in 1,713,378,519.50951 seconds with 17 queries