2

I have an online server which was running Debian Wheezy. Yesterday, I updated it to Jessie.

I had no problems during the upgrade, but when I rebooted the machine, it didn't go live.

I'm able to access the machine through a KVM, which shows me a grub prompt, after an error message that it can't find a file (but doesn't tell which one).

After some searches on the web, I was able to make the OS boot successfully using the following commands:

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, here are the values of $prefix and $root:

echo $root
hd0,msdos4

echo $prefix
(hd0,msdos1)/grub

Now that the OS was started, I could log in normally and use the following commands to repair 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

And

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

After that, I rebooted to check everything was fine, but I still have the same problem.

A last information : I updated the variable GRUB_TIMEOUT to -1 (checked with 180 too) in /etc/default/grub, but when I restart, I can't see the prompt. I go directly to the GRUB prompt.

What can I do to fix the problem? I'm a bit clueless at the moment.

Thanks !

2

And now it works, after a:

sudo grub-install /dev/sda

The command I was afraid to write :) But it turns out it had to be done...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.