Enquete

Após a última atualização do ubuntu 9.10 no meu netboock não consigo mais acessar o win xp a opção do boot foi sobreescrita, como restaurar?

restaurar entrada
0 (0%)
recupera grub
0 (0%)

Votos Totais: 0

Autor Tópico: Recuperando a entrada do windows xp no grub (Resolvido)  (Lida 5595 vezes)

Offline Possacrer

  • Usuário Ubuntu
  • *
  • Mensagens: 27
    • Ver perfil
Recuperando a entrada do windows xp no grub (Resolvido)
« Online: 15 de MAR?O de 2010, 21:02 »
Galera, inicialmente pedirei desculpas, pode ser que até tenha uma solução para o meu problema já postado no fórum, só que não a achei após uma breve pesquisa, nos moldes que eu preciso. Vamos ao problema: tenho instalado o ubuntu 9.10 e o win xp no meu mininotbock, a meses que os dois so's funcionavam harmonicamente, até a última atualização do ubuntu que é o sistema default. Após a atualização, a opção de entrada no boot para o win xp (que no grub lia-se "windows vista" apesar do SO ser win xp e funcionar assim mesmo), deixou de existir e agora apresenta a seguinte entrada "other operating systems"; ao optar por essa entrada o sistema apresenta um erro (11) e eu não consigo acessar o sistema da microsoft. O ubuntu está funcionando normalmente só que estou sem conexão com a net momentaneament, posto de outro pc. Pergunto como faço para abrir o sistema da microsoft e restaurar a entrada no grub.

Resolvido :D
« Última modificação: 17 de MAR?O de 2010, 18:53 por Possacrer »

Offline jomafras

  • Usuário Ubuntu
  • *
  • Mensagens: 2.009
  • 17.04 Zesty Zapus
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #1 Online: 15 de MAR?O de 2010, 21:39 »
Tenta primeiro :
Código: [Selecionar]
sudo update-grubSe não der certo copie e cole aqui os resultados de;
Código: [Selecionar]
sudo cat /boot/grub/grub.cfg | grep "menuentry" | cut -d '"' -f 2 
Código: [Selecionar]
sudo gedit /boot/grub/grub.cfg
Código: [Selecionar]
sudo gedit /etc/grub.d/30_os-prober
O Ubuntu sem dúvida é a melhor Distro.
Pesquise primeiro... só depois abra um tópico.
Canal do YouTube - Blog

Offline Possacrer

  • Usuário Ubuntu
  • *
  • Mensagens: 27
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #2 Online: 16 de MAR?O de 2010, 21:30 »
Boa noite Pintinho, após seguir o passo a passo, constatei que o grub ainda não foi corrigido; seque abaixo o resultado dos procedimentos.

raptor@raptor-laptop:~$ sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.31-20-generic
Found kernel: /boot/vmlinuz-2.6.31-19-generic
Found kernel: /boot/vmlinuz-2.6.31-17-generic
Found kernel: /boot/vmlinuz-2.6.31-16-generic
Found kernel: /boot/vmlinuz-2.6.28-17-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

raptor@raptor-laptop:~$ sudo cat /boot/grub/grub.cfg | grep "menuentry" | cut -d '"' -f 2
cat: /boot/grub/grub.cfg: Arquivo ou diretório não encontrado
raptor@raptor-laptop:~$

Após os comandos acima segui com o comando abaixo que abriu uma nova janela (arquivo) com os sguintes parâmetros; veja abaixo após a linha de comando.

raptor@raptor-laptop:~$ sudo gedit /etc/grub.d/30_os-prober

#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

found_other_os=

adjust_timeout () {
  if [ "x${found_other_os}" = "x" ] ; then
    if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
      if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
   verbose=
      else
   verbose=" --verbose"
      fi

      if [ "x${GRUB_HIDDEN_TIMEOUT}" = "x0" ] ; then
   cat <<EOF
if [ \${timeout} != -1 ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep$verbose --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
EOF
      else
   cat << EOF
if [ \${timeout} != -1 ]; then
  if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
    set timeout=0
  fi
fi
EOF
      fi
    fi
  fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
  adjust_timeout
  exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
  # missing os-prober and/or linux-boot-prober
  adjust_timeout
  exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
  # empty os-prober output, nothing doing
  adjust_timeout
  exit 0
fi

for OS in ${OSPROBED} ; do
  DEVICE="`echo ${OS} | cut -d ':' -f 1`"
  LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
  LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
  BOOT="`echo ${OS} | cut -d ':' -f 4`"

  if [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
  fi

  echo "Found ${LONGNAME} on ${DEVICE}" >&2
  found_other_os=1

  case ${BOOT} in
    chain)

      cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
      save_default_entry | sed -e "s/^/\t/"
      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

      case ${LONGNAME} in
   Windows\ Vista*|Windows\ 7*)
   ;;
   *)
     cat << EOF
   drivemap -s (hd0) \${root}
EOF
   ;;
      esac

      cat <<EOF
   chainloader +1
}
EOF
    ;;
    linux)
      LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"

      for LINUX in ${LINUXPROBED} ; do
        LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
        LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
        LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
        LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
        LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
        LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

        if [ -z "${LLABEL}" ] ; then
          LLABEL="${LONGNAME}"
        fi

         if [ "${LROOT}" != "${LBOOT}" ]; then
           LKERNEL="${LKERNEL#/boot}"
           LINITRD="${LINITRD#/boot}"
         fi

        cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
   save_default_entry | sed -e "s/^/\t/"
   prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/"
   cat <<  EOF
   linux ${LKERNEL} ${LPARAMS}
EOF
        if [ -n "${LINITRD}" ] ; then
          cat << EOF
   initrd ${LINITRD}
EOF
        fi
        cat << EOF
}
EOF
      done
    ;;
    macosx)
      OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
        cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
   save_default_entry | sed -e "s/^/\t/"
   prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
   cat << EOF
        insmod vbe
        do_resume=0
        if [ /var/vm/sleepimage -nt10 / ]; then
           if xnu_resume /var/vm/sleepimage; then
             do_resume=1
           fi
        fi
        if [ \$do_resume == 0 ]; then
           xnu_uuid ${OSXUUID} uuid
           if [ -f /Extra/DSDT.aml ]; then
              acpi -e /Extra/DSDT.aml
           fi
           xnu_kernel /mach_kernel boot-uuid=\${uuid} rd=*uuid
           if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
              xnu_mkext /System/Library/Extensions.mkext
           else
              xnu_kextdir /System/Library/Extensions
           fi
           if [ -f /Extra/Extensions.mkext ]; then
              xnu_mkext /Extra/Extensions.mkext
           fi
           if [ -d /Extra/Extensions ]; then
              xnu_kextdir /Extra/Extensions
           fi
           if [ -f /Extra/devtree.txt ]; then
              xnu_devtree /Extra/devtree.txt
           fi
           if [ -f /Extra/splash.jpg ]; then
              insmod jpeg
              xnu_splash /Extra/splash.jpg
           fi
           if [ -f /Extra/splash.png ]; then
              insmod png
              xnu_splash /Extra/splash.png
           fi
           if [ -f /Extra/splash.tga ]; then
              insmod tga
              xnu_splash /Extra/splash.tga
           fi
        fi
}
EOF
    ;;
    hurd|*)
      echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
    ;;
  esac
done

adjust_timeout


























Offline jomafras

  • Usuário Ubuntu
  • *
  • Mensagens: 2.009
  • 17.04 Zesty Zapus
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #3 Online: 16 de MAR?O de 2010, 23:17 »
Vc está com o Ubuntu 9.10 mas o Grub não é o Grub 2.
O arquivo que vc tem que modificar é o /boot/grub/menu.lst (do Grub antigo).
Código: [Selecionar]
sudo gedit /boot/grub/menu.lstVc tem que colocar a entrada para o Windows nele.
Supondo que o Windows está em sda1, acrescente abaixo de Others Operating Sistens :

title      Microsoft Windows
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Depois salve a modificação.
« Última modificação: 17 de MAR?O de 2010, 13:01 por pintinho »
O Ubuntu sem dúvida é a melhor Distro.
Pesquise primeiro... só depois abra um tópico.
Canal do YouTube - Blog

Offline Possacrer

  • Usuário Ubuntu
  • *
  • Mensagens: 27
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #4 Online: 17 de MAR?O de 2010, 00:00 »
Blza pintinho,

eu já havia feito a alteração sugerida, só não sei se ela está no local correto,  ;D vou colar abaixo o arquivo menu.lst...
outra pergunta...no netboock não tem drive de cd/dvd, mais eu criei a partir do live cd do ubuntu 9.04 um pen drive bootável, só que a versão atual do ubuntu instalada no "netbock" é a 9.10, eu poderia a partir do pen drive tentar recuperar/restaurar o grub, mesmo sendo uma versão + antiga?

veja abaixo: "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=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR

## default grub root device
## e.g. groot=(hd0,0)
# groot=6107031c-e38d-4dcb-a3d8-6a9eecb0820b

## 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

## 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

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## 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 9.10, kernel 2.6.31-20-generic
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-20-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR quiet splash
initrd      /boot/initrd.img-2.6.31-20-generic
quiet

title      Ubuntu 9.10, kernel 2.6.31-20-generic (recovery mode)
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-20-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR  single
initrd      /boot/initrd.img-2.6.31-20-generic

title      Ubuntu 9.10, kernel 2.6.31-19-generic
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-19-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR quiet splash
initrd      /boot/initrd.img-2.6.31-19-generic
quiet

title      Ubuntu 9.10, kernel 2.6.31-19-generic (recovery mode)
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-19-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR  single
initrd      /boot/initrd.img-2.6.31-19-generic

title      Ubuntu 9.10, kernel 2.6.31-17-generic
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-17-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR quiet splash
initrd      /boot/initrd.img-2.6.31-17-generic
quiet

title      Ubuntu 9.10, kernel 2.6.31-17-generic (recovery mode)
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-17-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR  single
initrd      /boot/initrd.img-2.6.31-17-generic

title      Ubuntu 9.10, kernel 2.6.31-16-generic
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-16-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR quiet splash
initrd      /boot/initrd.img-2.6.31-16-generic
quiet

title      Ubuntu 9.10, kernel 2.6.31-16-generic (recovery mode)
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.31-16-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR  single
initrd      /boot/initrd.img-2.6.31-16-generic

title      Ubuntu 9.10, kernel 2.6.28-17-generic
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.28-17-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR quiet splash
initrd      /boot/initrd.img-2.6.28-17-generic
quiet

title      Ubuntu 9.10, kernel 2.6.28-17-generic (recovery mode)
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
kernel      /boot/vmlinuz-2.6.28-17-generic root=UUID=6107031c-e38d-4dcb-a3d8-6a9eecb0820b ro locale=pt_BR  single
initrd      /boot/initrd.img-2.6.28-17-generic

title      Ubuntu 9.10, memtest86+
uuid      6107031c-e38d-4dcb-a3d8-6a9eecb0820b
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 xp
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Offline Possacrer

  • Usuário Ubuntu
  • *
  • Mensagens: 27
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #5 Online: 17 de MAR?O de 2010, 11:00 »
Vc está com o Ubuntu 9.10 mas o Grub não é o Grub 2.
O arquivo que vc tem que modificar é o /boot/grub/menu.lst (do Grub antigo).
Código: [Selecionar]
sudo gedit /boot/grub/msnu.lstVc tem que colocar a entrada para o Windows nele.
Supondo que o Windows está em sda1, acrecente abaixo de Others Operating Sistens :

title      Microsoft Windows
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Depois salve a modificação.
Pintinho bom dia,
peço desculpas se estou quebrando a regra do fórum não sei se postar duas mensagens uma após a outra configura quebra de regra. O fato é que com suas dicas hoje consequi resolver o problema, por isso estou postando, apenas com o fim didático, para que outros usuários inexperientes como eu possa resolver as suas demandas no que diz respeito a problemas com o grub. Bom vou postar o que foi feito.

Fiz exatamente o que aqui vai:

### END DEBIAN AUTOMAGIC KERNELS LIS

# This is a divider, added to separate the menu items below from the Debian
# ones.
title   Other operating systems:
title   Microsoft Windows
root      (hd0,0)
savedefault
makeactive
chainloader   +1

ai deu tudo certo e a entrada para o win xp foi restabelecida no grub... e na linha logo abaixo aonde tá escrito

# This entry automatically added by the Debian installer for a non-linux OS
# on/dev/sda1

"repeti as mesmas diretivas de other operating systems; ou seja"

title   Microsoft Windows
root      (hd0,0)
savedefault
makeactive
chainloader   +1

Pintinho, meu muito obrigado, suas dicas foram bacanas, peço desculpas se quebrei algumas regras do fórum; éssa não é absolutamente a minha intenção. Gde abraço, mais uma vez o meu muito obr...
obs: há me permita só uma observação o complemento do comando gedit/boot/msnu.lst é na verdade menu.lst e não msnu.lst
« Última modificação: 17 de MAR?O de 2010, 11:04 por Possacrer »

Offline Tota

  • Usuário Ubuntu
  • *
  • Mensagens: 14.982
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub
« Resposta #6 Online: 17 de MAR?O de 2010, 11:45 »

Pintinho, meu muito obrigado, suas dicas foram bacanas, peço desculpas se quebrei algumas regras do fórum; éssa não é absolutamente a minha intenção. Gde abraço, mais uma vez o meu muito obr...


Ola Possacrer

Não há nenhuma quebra de regra em postar duas vezes. Você incluiu uma informação importante e necessária, logo pode postar mais de uma vez.

Up's para manipular o topico e colocar o mesmo no topo da lista do forum é que nós não permitimos. Então fique tranquilo sobre este aspecto.

Fico contente que resolveu seu problema.

Se quiser ajudar ainda mais o forum, edite sua primeira mensagem => http://ubuntuforum-br.org/index.php/topic,63984.msg359021.html#msg359021

Acrescentando o texto ( Resolvido )

Isto dará mais visibilidade àqueles com a mesma dúvida.

[],s

Offline Possacrer

  • Usuário Ubuntu
  • *
  • Mensagens: 27
    • Ver perfil
Re: Recuperando a entrada do windows xp no grub (Resolvido)
« Resposta #7 Online: 17 de MAR?O de 2010, 18:58 »
Ok Tota,

Obrigado pela dica e já editei a primeira mensagem como sugerido  :)