GRUB: arquivo não encontrado após uma atualização do Debian Wheezy para Jessie

2

Eu tenho um servidor online que estava rodando Debian Wheezy. Ontem atualizei para Jessie.

Não tive problemas durante a atualização, mas quando reinicializei a máquina, ela não foi ativada.

Consigo acessar a máquina por meio de um KVM, o que me mostra um prompt do grub, após uma mensagem de erro que não consegue encontrar um arquivo (mas não diz qual).

Depois de algumas pesquisas na Web, consegui fazer a inicialização do sistema operacional usando os seguintes comandos:

linux (hd0,msdos1)/vmlinuz-3.16.0-4-646-pae root=/dev/sda4
initrd (hd0,msdos1)/initrd.img-3.16.0-4-686-pae
boot

FYI, aqui estão os valores de $ prefix e $ root:

echo $root
hd0,msdos4

echo $prefix
(hd0,msdos1)/grub

Agora que o sistema operacional foi iniciado, eu poderia fazer login normalmente e usar os seguintes comandos para reparar o GRUB:

sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.16.0-4-686-pae
Found initrd image: /boot/initrd.img-3.16.0-4-686-pae
Found linux image: /boot/vmlinuz-3.2.0-4-686-pae
Found initrd image: /boot/initrd.img-3.2.0-4-686-pae
done

e

sudo grub-mkconfig

Generating grub configuration file ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi


function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 --hint='hd0,msdos4'  87b34327-2d5b-429e-8cdb-5fd379f12fa2
else
  search --no-floppy --fs-uuid --set=root 87b34327-2d5b-429e-8cdb-5fd379f12fa2
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode

Found linux image: /boot/vmlinuz-3.16.0-4-686-pae
Found initrd image: /boot/initrd.img-3.16.0-4-686-pae
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
        else
          search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
        fi
        echo    'Loading Linux 3.16.0-4-686-pae ...'
        linux   /vmlinuz-3.16.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.16.0-4-686-pae
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
        menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-686-pae' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-686-pae-advanced-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.16.0-4-686-pae ...'
                linux   /vmlinuz-3.16.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.16.0-4-686-pae
        }
        menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-686-pae (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-686-pae-init-sysvinit-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.16.0-4-686-pae ...'
                linux   /vmlinuz-3.16.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro  quiet init=/lib/sysvinit/init
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.16.0-4-686-pae
        }
 menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-686-pae (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-686-pae-recovery-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.16.0-4-686-pae ...'
                linux   /vmlinuz-3.16.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.16.0-4-686-pae
        }
Found linux image: /boot/vmlinuz-3.2.0-4-686-pae
Found initrd image: /boot/initrd.img-3.2.0-4-686-pae
        menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-4-686-pae-advanced-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.2.0-4-686-pae ...'
                linux   /vmlinuz-3.2.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.2.0-4-686-pae
        }
        menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-4-686-pae-init-sysvinit-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.2.0-4-686-pae ...'
                linux   /vmlinuz-3.2.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro  quiet init=/lib/sysvinit/init
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.2.0-4-686-pae
        }
menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-4-686-pae-recovery-87b34327-2d5b-429e-8cdb-5fd379f12fa2' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9db62512-db87-4bbd-8dfd-02a642f0f772
                else
                  search --no-floppy --fs-uuid --set=root 9db62512-db87-4bbd-8dfd-02a642f0f772
                fi
                echo    'Loading Linux 3.2.0-4-686-pae ...'
                linux   /vmlinuz-3.2.0-4-686-pae root=UUID=87b34327-2d5b-429e-8cdb-5fd379f12fa2 ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.2.0-4-686-pae
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
done

Depois disso, eu reiniciei para verificar se tudo estava bem, mas ainda tenho o mesmo problema.

Uma última informação: eu atualizei a variável GRUB_TIMEOUT para -1 (marcada com 180 também) em / etc / default / grub, mas quando eu reinicio, não consigo ver o prompt. Eu vou diretamente para o prompt do GRUB.

O que posso fazer para corrigir o problema? Estou um pouco sem noção no momento.

Obrigado!

    
por Mike 22.09.2015 / 15:18

1 resposta

2

E agora funciona, depois de um:

sudo grub-install / dev / sda

O comando eu estava com medo de escrever :) Mas acontece que tinha que ser feito ...

    
por 22.09.2015 / 15:53

Tags