Autor Tópico: Grub  (Lida 2336 vezes)

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Grub
« Online: 06 de MAR?O de 2008, 16:52 »
Eu fui deletar uma partição e depois que eu fiz isso aparece na tela do grub um "erro 7" criei um floppy com o grub, só que não conseigo reintalar ele nem nem logar no linux, sómente no winxp.


como eu faço pra ageitar isso?


obrigado pela atenção.

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: Grub
« Resposta #1 Online: 06 de MAR?O de 2008, 17:49 »
Eu fui deletar uma partição e depois que eu fiz isso aparece na tela do grub um "erro 7" criei um floppy com o grub, só que não conseigo reintalar ele nem nem logar no linux, sómente no winxp.


como eu faço pra ageitar isso?


obrigado pela atenção.

Ao deletar uma partição você pode ter mudado as informações de UUID de suas partições. Caso seja isto mesmo os arquivos /boot/grub/menu.lst e /etc/fstab devem ser alterados.

Você poderia entrar usando o LiveCD, e executar o comando sudo fdisk -l no terminal, de formas a sabermos exatamente onde esta cada partição para poder proceder com a alteração dos arquivos.

[]'s

Cristiano
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #2 Online: 06 de MAR?O de 2008, 19:35 »
Deu isso:


Disco /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe688e688
 
Dispositivo Boot Início Fim Blocos Id Sistema
/dev/sda1   *           1        6885    55303731    7  HPFS ou NTFS
/dev/sda2            6886        9729    22844430    5  Estendida
/dev/sda5            8925        9679     6064506   83  Linux
/dev/sda6            9680        9729      401593+  82  Linux swap / Solaris



e agora?

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: Grub
« Resposta #3 Online: 07 de MAR?O de 2008, 00:31 »
Agora vamos montar a partição do Linux:

Código: [Selecionar]
sudo  mount   /dev/sda5    /mnt
Ai cole aqui o conteúdo dos arquivos:

  • /mnt/etc/fstab
  • /mnt/boot/grub/menu.lst

Com isto acho que conseguiremos fazer seu sistema voltar ao normal.

[]'s

Cristiano
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #4 Online: 07 de MAR?O de 2008, 16:07 »
Dá acesso negado msmo como root.


ah desculpe mais o erro que aparece é o "error 17".

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: Grub
« Resposta #5 Online: 07 de MAR?O de 2008, 17:58 »
Dá acesso negado msmo como root.


ah desculpe mais o erro que aparece é o "error 17".

Não entendi.

Você entrou usando o LiveCD, montou a partição e deu o erro na montagem?

Detalhes por favor, senão fica difícil ajudar.

[]'s

Cristiano
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #6 Online: 07 de MAR?O de 2008, 18:58 »
Eu usei o live e montei a partição, ate ai tudo bem mais quando eu fui colocar


/mnt/etc/fstab
/mnt/boot/grub/menu.lst


dá uma msg de acesso negado( em inglês )

sendo que eu estava logado como root.



Acho que vou ter que acabar instalando o linux de novo, vc sabe como fazer backup, pois da ultima vez que eu tentei tambem dava acesso negado com os meus arquivos.

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: Grub
« Resposta #7 Online: 07 de MAR?O de 2008, 22:57 »
O que você quer dizer por:

Citar
Eu usei o live e montei a partição, ate ai tudo bem mais quando eu fui colocar

Edite os arquivos:

Código: [Selecionar]
gedit /mnt/etc/fstab
Código: [Selecionar]
gedit /mnt/boot/grub/menu.lst
Copie o conteúdo (marcando tudo e dando Ctrl + C) e depois cole-os no tópico (com Ctrl + V).

[]'s

Cristiano
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!

Offline lmx

  • Usuário Ubuntu
  • *
  • Mensagens: 50
    • Ver perfil
Re: Grub
« Resposta #8 Online: 08 de MAR?O de 2008, 12:52 »
Boas!!
Aproveito este tópico para tentar resolver também o meu problema relacionado com o boot.
Para resumir fiz exactamente o mesmo que o colega Emanuel.c, apaguei uma partição e poff desapareceu-me uma...de seguida arranquei com um cd de boot e foi recuperar a minha partição perdida(é a partição mais valiosa), ate aqui tudo bem, posteriormente tento arrancar e erro 17 no grub!!
bom arranco outra vez com o cd de boot e restauro o MBR para o Win XP, so depois me lembrei que o meu grub estava instalado no MBR, ou seja tenho XP, mas nao Ubuntu.
E estou a precisar de usar este SO.
Tentei arrancar com o live cd do Ubuntu e fiz grub-install xx=shell(onde tenho as configurações do meu menu.lst antigo) xx=(local onde vou instalar o grub presumo) e /media/sda2(partição onde vai ser instalado) isto claro como root(sudo).
Dá-me um erro pois diz-me que a minha partição sda2 nao esta no formato xfs(presumo que seja o formato de ficheiros do cd)????Não sei o que fazer como ei-de eu instalar o GRUB de novo???

Obrigado

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #9 Online: 08 de MAR?O de 2008, 15:34 »
Desculpa mais aqui hora parece e hora desaparece as msg, tah um pouco confuso, mais vou fazer o q vc me pediu.
« Última modificação: 08 de MAR?O de 2008, 15:43 por Emanuel.c »

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #10 Online: 08 de MAR?O de 2008, 16:24 »
gedit /mnt/etc/fstab:


# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda6
UUID=e868591a-f1c0-4d8d-a5e6-c922c1146b32 /               ext3    defaults,errors=remount-ro 0       1
# /dev/sda1
UUID=8E9C5CE69C5CC9FB /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
 
# /dev/sda7
UUID=21589720-a764-4a07-bb8a-5200b6f8ac67 none            swap    sw              0       0
/dev/hdb        /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec 0       0





gedit /mnt/boot/grub/menu.lst:


# 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 use 'savedefault' 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=UUID=e868591a-f1c0-4d8d-a5e6-c922c1146b32 ro
 
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
 
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)
 
## 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 locale=pt_BR
 
## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false
 
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
 
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
 
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) 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
 
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
 
## ## End Default Options ##
 
title      Ubuntu 7.10, kernel 2.6.22-14-generic
root      (hd0,5)
kernel      /boot/vmlinuz-2.6.22-14-generic root=UUID=e868591a-f1c0-4d8d-a5e6-c922c1146b32 ro quiet splash locale=pt_BR
initrd      /boot/initrd.img-2.6.22-14-generic
quiet
 
title      Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root      (hd0,5)
kernel      /boot/vmlinuz-2.6.22-14-generic root=UUID=e868591a-f1c0-4d8d-a5e6-c922c1146b32 ro single
initrd      /boot/initrd.img-2.6.22-14-generic
 
title      Ubuntu 7.10, memtest86+
root      (hd0,5)
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      Microsoft Windows XP Professional
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: Grub
« Resposta #11 Online: 09 de MAR?O de 2008, 00:58 »
Emanuel volte a entrar com o LiveCD, remonte a partição exatamente como indicado antes e vamos ao trabalho.

1o) Backup dos arquivos por segurança:

fstab
Código: [Selecionar]
sudo   cp    /mnt/etc/fstab   /mnt/etc/fstab.bkp.20080309
menu.lst
Código: [Selecionar]
sudo   cp    /mnt/boot/grub/menu.lst   /mnt/boot/grub/menu.lst.20080309
2o) Feito isto vamos acertar o arquivo fstab, então volte a editar ele, conforme abaixo:

Código: [Selecionar]
sudo  gedit   /mnt/etc/fstab
3o) Substitua o conteúdo do arquivo pelo conteúdo abaixo (as alterações estão em negrito):

Citar
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda5
/dev/sda5     /               ext3    defaults,errors=remount-ro 0       1
# /dev/sda1
/dev/sda1     /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
 
# /dev/sda6
/dev/sda6    none            swap    sw              0       0
/dev/hdb        /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec 0       0

4o) Agora vamos acertar o arquivo menu.lst, então edite ele:

Código: [Selecionar]
sudo  gedit   /mnt/boot/grub/menu.lst
5o) Substitua o conteúdo do arquivo pelo conteúdo abaixo (as alterações estão em negrito):

Citar
# 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 use 'savedefault' 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=UUID=e868591a-f1c0-4d8d-a5e6-c922c1146b32 ro
 
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
 
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)
 
## 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 locale=pt_BR
 
## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false
 
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
 
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
 
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) 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
 
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
 
## ## End Default Options ##
 
title      Ubuntu 7.10, kernel 2.6.22-14-generic
root      (hd0,4)
kernel      /boot/vmlinuz-2.6.22-14-generic root=/dev/sda5 ro quiet splash locale=pt_BR
initrd      /boot/initrd.img-2.6.22-14-generic
quiet
 
title      Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root      (hd0,4)
kernel      /boot/vmlinuz-2.6.22-14-generic root=/dev/sda5 ro single
initrd      /boot/initrd.img-2.6.22-14-generic
 
title      Ubuntu 7.10, 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      Microsoft Windows XP Professional
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Agora é dar boot e esperar que funcione tudo.

Estou no aguardo de um retorno.

[]'s

Cristiano
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!

Offline Emanuel.c

  • Usuário Ubuntu
  • *
  • Mensagens: 19
    • Ver perfil
Re: Grub
« Resposta #12 Online: 09 de MAR?O de 2008, 13:12 »
Segui passo a passo mais continua com o mesmo erro.



Então já to desistindo de ageitar, acho que vou esperar pelo ubuntu 8.04.

Mais antes queria fazer um backup das coisas que eu tenho, mais não sei como já que todo arquivo (muiscas, apostilas e etc) eu não consigo ver nem copiar, sempre dá acesso negado.

como eu faço o backup?