sábado, 28 de julio de 2007

Como personalizar nuestro Grub

Bien, si habéis usado supergrub o en cualquier actualización de vuestra distro se ha bajado algún kernel nuevo, tenemos el grub abarrotado de entradas a Kernel antiguos. Esto por lo general no nos interesa a la mayoría ya que el uso mas común del Grub es elegir entre Windows y Linux.

Partiremos de tener una Grub así:



Para llegar a un Grub así:



Primero haremos una copia de seguridad de la configuración del grub para poder restaurarlo si algo fallara pegando esto en una consola:

sudo mv /boot/grub/menu.lst menu.lst_old

Segundo editaremos el archivo de configuración del grub:

sudo gedit /boot/grub/menu.lst

Veremos algo parecido a esto:

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=f30157b5-7836-4f37-8680-dba374c53801 ro quiet splash locale=es_ES
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,4)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=f30157b5-7836-4f37-8680-dba374c53801 ro single
initrd /boot/initrd.img-2.6.20-16-generic


title Ubuntu, memtest86+
root (hd0,4)
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 Windows NT/2000/XP
root (hd0,0)
savedefault
makeactive
chainloader +1


Es tan sencillo como poner almohadillas o borrar las partes que no queremos que salgan y opcionalemente podemos cambiar el campo title y poner lo que nosotros queramos:

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=f30157b5-7836-4f37-8680-dba374c53801 ro quiet splash locale=es_ES
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

#title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
#root (hd0,4)
#kernel /boot/vmlinuz-2.6.20-16-generic #root=UUID=f30157b5-7836-4f37-8680-dba374c53801 ro single
#initrd /boot/initrd.img-2.6.20-16-generic


#title Ubuntu, memtest86+
#root (hd0,4)
#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 Windows NT/2000/XP
root (hd0,0)
savedefault
makeactive
chainloader +1

Guardamos el archivo y ya tendríamos el grub mucho mas ligero sin las opciones que no nos interesan.

No hay comentarios: