GRUB desapareceu!

JPgod

Moderador
Staff
Boas...

Já é a 2ª vez que me acontece>( Tenho o windows XP no raid 0 e o ubuntu 5.10 noutro disco...

Entretanto tinha neste mesmo disco outra partição com o windows 2000 e entretanto instalei o windows XP nesta mesma partição, o problema que quando arranco agora a partir deste disco, entra directo no windows XP em vez de entrar no GRUB:005:
 
O instalador do window$ faz isso. Podes instalar de novo o grub, para isso agarras num live-cd de GNU/Linux, fazes um chroot à / do sistema instalado, e executa o comando grub-install ("man grub-install" para detalhes)
 
Penso que o livecd do Mepis tem uma ferramenta mesmo para reinstalar o grub...

Senao conseguires podes fazer a mao com um livecd do gentoo (como o falco estava a dizer)

1 - Sacar o livecd do gentoo...

http://darkstar.ist.utl.pt/gentoo/releases/x86/current/installcd/install-x86-minimal-2005.1-r1.iso

2 - Montar as tuas particoes:

Código:
mount /dev/hda1 (particao onde tens o linux) /mnt/gentoo
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev

3 - Chroot para entrares no mesmo ambiente do Ubuntu (basicamente, mexes no sistema como se la estivesses :) )

Código:
chroot /mnt/gentoo /bin/bash
env-update
 * Caching service dependencies...
source /etc/profile
export PS1="(chroot) $PS1"

4 - Reinstalar o GRUB

Código:
grub-install /dev/hda (disco onde tens o linux)

Se precisares de mais ajuda, avisa :P
 
Isso é normal. Qd se volta a instalar um so tem k se fazer de novo o setup ao grub.
Basta iniciares com um qualquer live cd que contenha o grub (gentoo por exemplo) e fazer:

cd /boot/grub
grub

já dentro da consola do grub

root (hdx,y) -> onde o x é o número do disco e o y o número da partição que contém o /boot (nota que os números começam em 0).

setup (hdx)

quit

depois é só reiniciar. (shutdown -r now)
 
Isso é normal. Qd se volta a instalar um so tem k se fazer de novo o setup ao grub.

Não é normal! O que acontece é que o window$ limpa a master boot record do computador, o que é completamente desnecessário e só serve para sabotar a utilização de outros sistemas operativos, porque normalmente é aí que se instalam os boot loaders
 
EDIT: problem solved... Para quem ficar nas lonas como eu o procedimento é muito simples...

-> Arrancar o PC com CD de instalação do ubuntu
-> quando aparecer o ecran onde diz "boot", escrever "rescue" (sem as aspas) e ENTER
-> Seguir instruções no ecrã
-> Depois na linha de comando no modo de restauro, escrever "grub-install /dev/hda" [enter] (hda é o disco onde se pretende reescrever o grub
-> Se tudo ocorrer bem, vais mostras uma mensagem e pode reiniciar, prestar atenção se não vai dar erro de disco não reconhecido
-> E voilá! Grub is back como estava dantes :D
 
Última edição:
boas...

Agora o problema é o inverso... Não consigo aceder o windows XP pelo grub... Já ajustei a particão, mas dá-me este erro:

ntldr is missing

press ctrl+alt+del to restart

não percebo porque ele não reconhece o ficheiro :( Se antes estava a funcionar...
 
ui...
o famoso "ntldr is missing"
isso acontece a muita gente, independentemente de ter o linux instalado no sistema ou não.

isso não esta bem relacionado com o GRUB.
faz o backup do grub para uma disquete
e depois tenta usar a consola de reparação do windows xp
experimenta usar o chkdsk /r, e, eventualmente o fix mbr (tou a dizer os comandos de cabeça, n sei se é mm isto)

se procurares aí por ntldr aparece muita coisa :P
mas o problema esta na partição do windows.
 
No Ubuntu numa consola faz:

sudo gedit /boot/grub/menu.lst

O que aparece?

Vê se tens alguma coisa parecida com isto que eu tinha:

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda3 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title Ubuntu, kernel 2.6.15-23-686
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-686 root=/dev/hda3 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-686
savedefault
boot

title Ubuntu, kernel 2.6.15-23-686 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-686 root=/dev/hda3 ro single
initrd /boot/initrd.img-2.6.15-23-686
boot

title Ubuntu, kernel 2.6.15-23-386
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda3 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot

title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda3 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot

title Ubuntu, memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin
boot


### 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/hda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

Só interessa ver o que meti aq bold.
 
Sim, tenho +- isso... A não ser que tenho o dobro de entradas do Ubuntu :007: (tenho que tb limpar um bocado disso, aquilo meteu todos os kernels que foi sakando, desde o defaut de instalação até o amd 64 k8-smp

No que toca ao windows tenho assim:

title Microsoft Windows XP Professional
root (hd0,2)
savedefault
makeactive
chainloader +1

Se fosse hd0,0 o grub dá um erro e volta ao menu de escolha do SO... Mas se aparece o erro do NLDLR, é porque já achou a partição do windows, mas este tem o boot marado!
 
tens de entrar na repair console do windows e fazer o fixmbr.
Depois tens de voltar a instalar o grub.
O problema como já foi dito anteriormente não tem nada a ver com o grub, é uma panca qualquer estranha do windows que de vez em quando se auto-corrompe.
 
Back
Topo