quarta-feira, 23 de fevereiro de 2011

Usando o LILO para gerenciar partições

O LILO(Linux Loader) é um utilitário do GNU/Linux que gerencia as partições. Hoje ele encontra-se praticamente extinto, sobrevive em poucas distros e tem presença assegurada no Slackware. Ele é usado como um "boot manager" que divide cada boot para cada tipo de sistema.
O LILO tem seu arquivo de configuração em /etc/lilo.conf lá ele armazena as informações necessárias para que ele faça a "divisão" de partições.
Aqui segue um exemplo de um lilo.conf com duas distros: Slackware e kubuntu.
Mais a frente eu mostro como editar uma partição Windows.

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# Append any additional kernel parameters:
append=" vt.default_utf8=0"
boot = /dev/hda

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 150
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# VESA framebuffer console @ 1024x768x256
vga = 773
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda1
label = Slackware
read-only


image =/mnt/kubuntu/boot/vmlinuz-2.6.28-19-generic
root = /dev/sda2
label = Kubuntu
read-only


# Linux bootable partition config ends

Vamos agora ver as partes do arquivo passo a passo:

1. A linha: boot = /dev/hda

Ela indica onde será o funcionamento do LILO, nesta linha, o LILO está configurado para rodar no MBR. Mas podemos mudar o /dev/hda para outro tipo de funcionamento. Um exemplo é colocar para funcionar em um disquete: substituímos o boot = /dev/hda pelo boot = /dev/fd0 (ou fd1, fd2... dependendo de onde está seu driver de disco).

2. bitmap = /boot/slack.bmp
Essa linha indica uma imagem que aparecerá no Lilo.

3. timeout = 150

Esta linha indica em quanto tempo a partição padrão (você verá mais a frente) vai entrar automaticamente, ou seja, sem você mexer em nada.
Essa linha está configurada para rodar em 15 segundos.

Agora vamos ver como configurar quais partições estão disponíveis.
A linha que coloca a partição disponível é...

Para partições GNU/Linux:
---
image = /boot/vmlinuz
root = /dev/hda1
label = Slackware
read-only


image =/mnt/kubuntu/boot/vmlinuz-2.6.28-19-generic
root = /dev/sda2
label = Kubuntu
read-only

---
image= edite apontando para o vmlinuz da sua distro.
root = /dev/hda1 <--- em vez de /dev/hda1 coloque a partição linux
label = Slackware ou Kubuntu <--- Onde tem o nome dos sistemas você muda dependendo do seu Linux.

Para uma partição não Linux:

other = /dev/hda3
label = Windows 7
table = /dev/hda



other = /dev/hda3 <--- em vez de /dev/hda3 coloque a partição que você queira
label = Windows 7 <--- Onde tem Windows 7 você muda para a versão do seu Windows.
table = /dev/hda <--- Você coloca em que "table" está a partição (/dev/hda3)

Lembre-se depois de fazer as alterações tem que executar o comando lilo como root.

Abraço e até mais.

Nenhum comentário:

Postar um comentário