Dalam suatu kasus setelah windows terinstall pertama kali kemudian di installkan kembali sistem operasi linux ubuntu maka secara otomatis grub linux yang mengambil alih menu entry semua sistem. Namun terkadang kita sebagai user sangat tidak terpuaskan dengan penamaan default yang di berikan oleh system dalam menamai menu entry sistem tersebut serta di tambahnya opsi recovery masing-masing sistem yang akhirnya menambah daftar entry booting sistem, jika merasa di risihkan dengan kasus tersebut pengguna ubuntu dapat dapat mengatu entry pada grub sesuka hati.
Berikut ialah isi dari default file grub di /boot/grub/grub.cfg ubuntu 10.04
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro quiet splash
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
echo 'Loading Linux 2.6.32-25-generic ...'
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 3cd8dc8ed8dc4832
chainloader +1
}
menuentry "Fedora (2.6.33.3-85.fc13.i686) (on /dev/sda5)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set c5af168b-2121-4615-808b-06c9eff2f151
linux /boot/vmlinuz-2.6.33.3-85.fc13.i686 ro root=UUID=c5af168b-2121-4615-808b-06c9eff2f151 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=lat$
initrd /boot/initramfs-2.6.33.3-85.fc13.i686.img
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
Yang ditandai warna merah ialah entry-entry yang di tampilkan pada saat komputer/laptop di hidupkan, banyak bukan? Contoh tampilah entry-nya standart setelah ubuntu di update sebagi berikut :
Ubuntu, with Linux 2.6.32-25-genericUbuntu, with Linux 2.6.32-25-generic (recovery mode)Ubuntu, with Linux 2.6.32-21-genericUbuntu, with Linux 2.6.32-21-generic (recovery mode)Memory test (memtest86+)Memory test (memtest86+, serial console 115200)Windows 7 (loader) (on /dev/sda1)Fedora (2.6.33.3-85.fc13.i686) (on /dev/sda5)
Jadi untuk mengeditnya dan memsimple tampilan entry dari grub ikuti langka-langkahnya seperti di bawah ini, dalam hal ini saya akan menghilangkan beberapa entry dan menamai ulang menjadi :
Ubuntu
Ubuntu (recovery mode)
Win Xp - Win7
Fedora
diketahui : dalam contoh berikut didalam 1 hardisk berisi windows xp, windows 7, fedora 13, ubuntu 10.04
Buka terminal dan login sebagi root
Backup terlebih dahulu grub defaultnya, di terminal ketikan
cp /boot/grub.cfg /boot/grub.cfg.asli
sekarang buka dan edit file grub.cfg, ketikan
nano /boot/grub/grub.cfg
Hilangkan dan namai sesuai yang kalian inginkan pada isi file grub.cfg seperti di berikut
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro quiet splash
initrd /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 81bf0b2a-8c8f-44f4-b901-2a7522548ceb
echo 'Loading Linux 2.6.32-25-generic ...'
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=81bf0b2a-8c8f-44f4-b901-2a7522548ceb ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-25-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Win Xp - Win7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 3cd8dc8ed8dc4832
chainloader +1
}
menuentry "Fedora" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set c5af168b-2121-4615-808b-06c9eff2f151
linux /boot/vmlinuz-2.6.33.3-85.fc13.i686 ro root=UUID=c5af168b-2121-4615-808b-06c9eff2f151 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=lat$
initrd /boot/initramfs-2.6.33.3-85.fc13.i686.img
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
- Jika dirasa sudah cukup dan tidak ada lagi yang di edit tekan Ctrl+O untuk Save dan Ctrl+X untuk keluar dari teks editor nano.
- Yang di warnai biru pada angka 10 itu menandakan waktu tunggu si entry, bisa juga kalian rubah nilainya.
- Untuk lebih memahaminya bandingkan saja isi file grub.cfg default dengan file grub.cfg yang di edit diatas, semoga berhasil!!
No comments:
Post a Comment
Berkomentarlah dengan bijak untuk pengembangan dan sekaligus menjadi pembelajaran kita bersama.
Pilih Name/Url untuk mempermudah memasukan id anda!