Pengalaman berpindah dari Lilo ke Grub (quick and dirty)

Alasan :

– Saya membutuhkan memuat beragam system operasi dalam PC saya, karena tuntutan pekerjaan. Dengan adanya beragam
System Operasi dalam PC saya maka hal tersebut menuntut bootloader yang bisa meload beragam OS dalam HD saya
tersebut. Dalam beberapa hal, saya menyukai LILO. Namun keterbasan LILO dalam menangani kondisi yang saya
harapkan membuat saya harus memikirkan bootloader lain. Salah satu bootloader lain yang saya kenal adalah
GRUB (GRand Unified Bootloader).

Pendahuluan :


  • – GRUB Mendukung GNU Linux, FreeBSD, NetBSD, OpenBSD, GNU HURD, DOS, Windows 95, 98, NT, maupun 2000 (XP dan *BSD saya belum coba,.. )

  • – Dalam PC saya terinstall 4 macam OS, yaitu :
    hda1 –> Windows 2000
    hda2 –> Slackware 8.1
    hda3 –> Debian Woody 3.0
    hda5 –> Linux Mandrake 8.2

    Berikut output dari cfdisk :
                                                    cfdisk 2.11n



    Disk Drive: /dev/hda

    Size: 10005037056 bytes

    Heads: 255 Sectors per Track: 63 Cylinders: 1216



    Name Flags Part Type FS Type [Label] Size (MB)

    ————————————————————————————————————-

    hda1 Primary Win95 FAT32 3676.71

    hda2 Primary Linux ext2 1497.01

    hda3 Boot Primary Linux ext2 1497.01

    hda5 Logical Linux ext2 1497.01

    hda6 Logical Linux swap 386.59

    hda7 Logical Win95 FAT32 1447.65






    – Setelah utek-utek sebentar, akhirnya saya temukan quick and dirty dalam implementasi GRUB.


    1. Mother OS tempat GRUB Dikontrol

    ===================================
    – Saya memilih debian sebagai ‘mother OS’ untuk memanaje grub, dimana dari tabel partisi HD saya terletak di hda3.
    (Fans baru debian, rek…! 😀 )

    Kemudian mencari paket grub :

    buraq:~# apt-cache search grub

    grub – GRand Unified Bootloader



    Instal pake grub :

    apt-get -y install grub



    Atau dalam redhat dan mandrake :

    rpm -Uvh /path-ke-dir-RPMS-dalam-redhat-atau-mandrake/RPMS/grub******




    Cek apakah dir /boot/grub sudah ada atau belum, bila belum maka kita buat :

    buraq:~# mkdir /boot/grub/

    buraq:~# cp /usr/lib/grub/i386-pc/stage1 /boot/grub/

    buraq:~# cp /usr/lib/grub/i386-pc/stage2 /boot/grub/

    buraq:~# cp /usr/lib/grub/i386-pc/stage2 /boot/grub/

    buraq:~# cp /usr/lib/grub/i386-pc/e2fs_stage1_5 /boot/grub/


    Test grub :

    buraq:~# grub

    Probing devices to guess BIOS drives. This may take a long time.

    GRUB version 0.91 (640K lower / 3072K upper memory)



    [ Minimal BASH-like line editing is supported. For the first word, TAB

    lists possible command completions. Anywhere else TAB lists the possible

    completions of a device/filename. ]



    grub> root (hd0, <– ketik [TAB disini]

    Possible partitions are:

    Partition num: 0, Filesystem type is fat, partition type 0xb

    Partition num: 1, Filesystem type is ext2fs, partition type 0x83

    Partition num: 2, Filesystem type is ext2fs, partition type 0x83

    Partition num: 4, Filesystem type is ext2fs, partition type 0x83

    Partition num: 5, Filesystem type unknown, partition type 0x82

    Partition num: 6, Filesystem type is fat, partition type 0xb



    grub> root (hd0,




    Sedikit bingung ?
    begini konversinya : cfdisk membaca dari angka 1 sedangkan grub dari 0
    Sehingga (cek dengan output cfdisk saya):
    hda1 –> Partition num: 0, Filesystem type is fat, partition type 0xb
    hda2 –> Partition num: 1, Filesystem type is ext2fs, partition type 0x83
    …dst


    2. Setting Up GRUB

    ======================================================
    Sekarang hapus ketikan anda di grub sheel dan ketik :

    grub> quit


    Pindah ke /boot/grub

    buraq:~# cd /boot/grub/



    Buat file yang berisi daftar yang ingin di load

    buraq:/boot/grub# vi menu.lst



    #———————-start file—————————-

    default 0

    timeout 30

    color white/blue blue/green



    title Windows-2000

    root (hd0,0)

    makeactive

    chainloader +1



    title Slackware

    kernel (hd0,1)/boot/vmlinuz root=/dev/hda2



    title Debian

    kernel (hd0,2)/boot/vmlinuz root=/dev/hda3



    title Mandrake

    kernel (hd0,4)/boot/vmlinuz root=/dev/hda5 devfs=mount

    initrd (hd0,4)/boot/initrd.img



    title Slackware-failsafe

    kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 failsafe



    title Debian-failsafe

    kernel (hd0,2)/boot/vmlinuz root=/dev/hda3 failsafe



    title Mandrake-failsafe

    kernel (hd0,4)/boot/vmlinuz root=/dev/hda5 failsafe devfs=nomount

    initrd (hd0,4)/boot/initrd.img

    #———————-end file—————————-



    Keterangan :
    Baris-baris ini :
    #—————————–
    title Windows-2000
    root (hd0,0)
    makeactive
    chainloader +1
    #—————————–
    Untuk meload OS WIndows


    Baris-baris berikut :
    #—————————–
    title Slackware
    kernel (hd0,1)/boot/vmlinuz root=/dev/hda2

    title Debian
    kernel (hd0,2)/boot/vmlinuz root=/dev/hda3

    title Mandrake
    kernel (hd0,4)/boot/vmlinuz root=/dev/hda5 devfs=mount
    initrd (hd0,4)/boot/initrd.img
    #—————————–
    Untuk meload OS Linux

    Baris-baris berikut :
    #—————————–
    title Slackware-failsafe
    kernel (hd0,1)/boot/vmlinuz root=/dev/hda2 failsafe

    title Debian-failsafe
    kernel (hd0,2)/boot/vmlinuz root=/dev/hda3 failsafe

    title Mandrake-failsafe
    kernel (hd0,4)/boot/vmlinuz root=/dev/hda5 failsafe devfs=nomount
    initrd (hd0,4)/boot/initrd.img
    #—————————–
    Akan memberikan efek seperti kita mengetikkan :
    LILO: linux -s

    Kemudian simpan file /boot/grub/menu.lst


    3. Menuliskan GRUB ke MBR menggantikan LILO
    =============================================
    Masuk ke dalam shell grub :

    buraq:/boot/grub# grub

    Probing devices to guess BIOS drives. This may take a long time.





    GRUB version 0.91 (640K lower / 3072K upper memory)



    [ Minimal BASH-like line editing is supported. For the first word, TAB

    lists possible command completions. Anywhere else TAB lists the possible

    completions of a device/filename. ]



    grub> root (hd0, <<– ketik [TAB]

    Possible partitions are:

    Partition num: 0, Filesystem type is fat, partition type 0xb

    Partition num: 1, Filesystem type is ext2fs, partition type 0x83

    Partition num: 2, Filesystem type is ext2fs, partition type 0x83

    Partition num: 4, Filesystem type is ext2fs, partition type 0x83

    Partition num: 5, Filesystem type unknown, partition type 0x82

    Partition num: 6, Filesystem type is fat, partition type 0xb



    grub> root (hd0,2)

    Filesystem type is ext2fs, partition type 0x83



    grub> setup (hd0)

    Checking if “/boot/grub/stage1” exists… yes

    Checking if “/boot/grub/stage2” exists… yes

    Checking if “/boot/grub/e2fs_stage1_5” exists… yes

    Running “embed /boot/grub/e2fs_stage1_5 (hd0)”… 16 sectors are embedded.

    succeeded

    Running “install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,2)/boot/grub/stage

    2 /boot/grub/menu.lst”… succeeded

    Done.



    grub> quit





    OK selesai setting Up GRUB. Silahkan reboot PC anda dan voila…. GRUB anda telah berjalan

    NOTE :

  • – Tidak seperti LILO yang tiap kali ada perubahan untuk boot harus menuliskan ke dalam MBR, GRUB cukup mengedit file /boot/grub/menu.lst

  • – Masih banyak lagi feature-feature GRUB. More fun if you read all the manual first….

    Bacaan :
    http://www-105.ibm.com/developerworks/education.nsf/dw/linux-onlinecourse-bytitle


    Note: bermanfaat sekali dan kereeennn. makasih xeno!
  • Similar Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *