Debian Wheezy를 실행하는 온라인 서버가 있습니다. 어제 Jesse를 업데이트했습니다.
업그레이드에는 문제가 없었지만 컴퓨터를 다시 시작했을 때 온라인 상태가 되지 않았습니다.
KVM을 통해 시스템에 액세스할 수 있으며 파일을 찾을 수 없다는 오류 메시지가 표시된 후(어떤 파일인지는 알 수 없음) grub 프롬프트가 표시됩니다.
웹에서 검색한 후 다음 명령을 사용하여 운영 체제를 성공적으로 부팅할 수 있었습니다.
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
참고로 $prefix와 $root의 값은 다음과 같습니다.
echo $root
hd0,msdos4
echo $prefix
(hd0,msdos1)/grub
이제 OS가 부팅되었으므로 다음 명령을 사용하여 정상적으로 로그인하고 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
그리고
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
그 후 모든 것이 정상인지 확인하기 위해 재부팅했지만 여전히 같은 문제가 있습니다.
마지막 메시지: /etc/default/grub에서 GRUB_TIMEOUT 변수를 -1로 업데이트했지만(180으로도 확인) 재부팅할 때 프롬프트가 표시되지 않습니다. GRUB 프롬프트로 바로 이동합니다.
이 문제를 해결하려면 어떻게 해야 합니까? 나는 지금 약간 압도 당하고 있습니다.
감사해요!
답변1
이제 작동합니다:
sudo grub-install /dev/sda
이 명령을 쓰기가 두려웠어요 :) 하지만 결국엔 해야 한다는 사실이 밝혀졌습니다...