Το πρόγραμμα εκκίνησης GRUB

Η ενότητα αυτή περιγράφει:

Πώς να εγκαταστήσετε το grub

Το
GRUB είναι ένα πρόγραμμα εκκίνησης Η/Υ: φορτώνει τον πυρήνα και εκκινεί ολόκληρο το σύστημα. (Ο LILO είναι ένα διαφορετικό, παλιότερο, πρόγραμμα εκκίνησης με λιγότερα χαρακτηριστικά.)

Ελέξτε αν ο grub είναι εγκατεστημένος στο σύστημά σας:

rpm -q grub
package grub is not installed
Αν λάβετε ως απάντηση ότι ο grub δεν είναι εγκατεστημένος, εγκαταστήστε το grub είτε από το CD της Red Hat είτε από το Internet, π.χ. από το: rpmfind. Έπειτα, εγκαταστήστε το rpm:
rpm -i grub-0.92-7.i386.rpm

Πώς να ρυθμίσετε τον grub

Ελέξτε να δείτε αν ο φάκελος /boot/grub υπάρχει στο σύστημά σας. Ο φάκελος /boot/grub δεν θα υπάρχει μέχρις ότου εκτελέσετε την εντολή /sbin/grub-install. Καθορίστε σε ποιον δίσκο θα εγκαταστήσετε τον GRUB boot loader (/dev/hda στην περίπτωση αυτή):
/sbin/grub-install /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/hda

Ακολουθεί ένα δείγμα του αρχείου /boot/grub/menu.lst που ρυθμίζει ποιος πυρήνας εκκινείται (μόνο ένας πυρήνας εμφανίζεται εδώ, οπότε δεν υπάρχουν και πολλές επιλογές). Το αρχείο αυτό πρέπει να ονομάζεται menu.lst (μετά την τελεία είναι ένα"ελ", όχι "ένα").

# Boot automatically after 30 seconds.
timeout 30

# Comment lines begin with '#'
#
# "(hd0,1)" means "/dev/hda2".
# "(hd0,1)" refers to disk 0 (the first disk), and the SECOND
# partition (partition 1), which is /dev/hda2 (NOT /dev/hda1):
#       - GRUB numbers partitions and disks starting at 0, not 1.
#
#       - The "root=/dev/hda2" section is also referring to the
#         second partition, but the kernel (not GRUB) starts
#         numbering partitions at 1, not 0.
#
title Linux
    root (hd0,1)
    kernel /boot/summer-usb ro root=/dev/hda2 hdc=ide-scsi
Note: In the GRUB menu.lst file the partition numbers in the "root (hd0, X)" line start at 0 (not 1), while the partition numbers in the "root=/dev/hdaY" kernel argumentline start at 1 (not 0).

Άλλο ένα αρχείο ρυθμίσεων του GRUB, αυτή τη φορά με 2 πυρήνες για να διαλέξετε:

# By default, boot the first entry (Red Hat rather than Debian).
default=0
#Start booting automatically after waiting 10 seconds.
timeout=10

splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title Red Hat Linux 9 with kernel (2.4.20-8)
    root (hd0,0)
    kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
    initrd-2.4.20-8.img

# Note you can tell GRUB where to find the "/boot/summer-debian"
# kernel without a separate "root (hd0,4)" line.  Instead,
# the device is specified to GRUB on the kernel line.
#
# Also, note that "(hd0,4)" refers to "/dev/hda5".  GRUB
# starts numbering partitions at 0, which means partition 4
# "(..,4") is the 5th partition, which is /dev/hda5, not /dev/hda4.
title Debian Linux
        kernel (hd0,4)/boot/summer-debian ro root=/dev/hda5
Κι άλλο ένα παράδειγμα, αυτή τη φορά με μια διαμέριση Windows 2000:
default=0
timeout=30
# Fallback to the second entry, if the first one fails.
fallback 1

title windows 2000
        root (hd0,0)
        chainloader +1
        makeactive

title Debian Linux
        root (hd0,4)
        kernel /boot/vmlinuz-2.2.20 ro root=/dev/hda5

#   Device Boot    Start       End    Blocks   Id  System
#/dev/hda1   *         1       305    307408+   6  FAT16
#/dev/hda2           306       789    487872    5  Extended
#/dev/hda5==(hd0,4)  306       741    439456+  83  Linux
#/dev/hda6           742       789     48352+  82  Linux swap

Και ακόμα ένα παράδειγμα, αυτή τη φορά με πολλούς πυρήνες για να διαλέξετε:

# Note that you do not have to rerun GRUB after
# making changes to this file
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# This is for disk 0, partition 0 ["root (hd0,0)"],
# which is /dev/hda1
title Red Hat Linux (2.4.20-8)
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hda1
        initrd /boot/initrd-2.4.20-8.img

# This is for disk 0, partition 1 ["root (hd0,1)"],
# which is /dev/hda2
title Mandrake Linux
        root (hd0,1)
        kernel /boot/vmlinuz root=/dev/hda2

# This is for disk 0, partition 2 ["root (hd0,2)"],
# which is /dev/hda3
title SuSE Linux
        root (hd0,2)
        kernel /boot/vmlinuz ro root=/dev/hda3

# This is for disk 0, partition 3 ["root (hd0,3)"],
# which is /dev/hda4
title Debian Linux
        root (hd0,3)
        kernel /boot/vmlinuz-2.4.20 ro root=/dev/hda4

# This is for disk 0, partition 4 ["root (hd0,4)"],
# which is /dev/hda5
title Turbo Linux
        root (hd0,4)
        kernel /boot/vmlinuz-2.4.20 ro root=/dev/hda5


Για περισσότερες πληροφορίες

Linux Quick Reference Home
Linux Migration Home
Αρχική σελίδα μετάβασης στο Linux