从 13 升级到 14.04 后,我无法重新启动 Ubuntu 服务器。我该怎么做才能让它恢复正常?
我尝试通过 ssh 将服务器升级到 ubuntu 14.04。安装完成后,我看到“需要重启系统”的消息,所以我执行了“sudo reboot”。之后我无法通过 ssh 重新连接。好吧,我可以访问服务器,所以我去那里看了看。
重启后,我有一个 rEFind 和一个 Grub 引导加载程序对话框,我可以在里面选择 Ubuntu。执行此操作后,我收到消息
“The disk drive for / is not ready yet or not present.
Continue to wait, or Press S to skip mounting or M for manual recovery.”
但是,当我按“S”或“M”时,什么也没有发生。
我有一个可以在机器上访问的 Macintosh 安装,但到目前为止无法安装 ubuntu 设备。这里和 Google 上有很多关于这个主题的问题,但大多数问题都恰好需要按“M”。这对我来说是不可能的,所以我有这个问题。
当我使用高级选项在 GRUB 中启动 Ubuntu 时,我现在可以使用 Linux 3.11.0-19-generic 内核启动 Ubuntu。但是,键盘确实可以工作,因此我现在明白了为什么上面的“M”或“S”选项从未被激活。
按照 tendons 的建议,我似乎犯了一个错误,最后仍然显示上面的消息。以下是我按照此操作所做的回答:
- 创建 KNOPPIX-Live USB 棒并启动它(Mac 用户:“C”代表 CD/DVD/USB)
挂载分区
sudo mount /dev/sda3 /mnt/foo
绑定 grub 需要访问的目录
sudo mount --bind /dev /mnt/foo/dev sudo mount --bind /dev/pts /mnt/foo/dev/pts sudo mount --bind /proc /mnt/foo/proc sudo mount --bind /sys /mnt/foo/sys
设置 chroot 环境
sudo chroot /mnt/foo
创建grub的配置文件:
sudo grub-mkconfig -o /boot/grub/grub.cfg
我安装了多个操作系统,并尝试确保上述命令列出了所有操作系统(还有其他消息,如“未找到图像”):
Generating grub.cfg ... Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-*-amd64 ... done
现在我希望将其安装到驱动器的 MBR 中
grub-install /dev/sda
退出 chroot 并卸载所有内容。
sudo umount /mnt/foo/dev/pts /mnt/foo/dev /mnt/foo/proc /mnt/foo/sys /mnt/foo
当我重新启动时,rEFInd 无法再启动。但是,我再次进入 grub,但它的行为与以前一样...
这是我的 grub.cfg - sda4 是分区,ubuntus / 位于其中。当我启动 KNOPPIX 并想要访问该分区时,我必须挂载 /dev/sda4。
#
# 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
set default="0"
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 recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; 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_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda4 ro quit splash processor.max_cstate=2 $vt_handoff
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
menuentry 'Ubuntu, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.13.0-24-generic ...'
linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda4 ro quit splash processor.max_cstate=2 $vt_handoff
}
menuentry 'Ubuntu, with Linux 3.13.0-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-recovery-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.13.0-24-generic ...'
linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda4 ro recovery nomodeset
}
menuentry 'Ubuntu, with Linux 3.11.0-19-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-19-generic-advanced-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-19-generic ...'
linux /boot/vmlinuz-3.11.0-19-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro quit splash processor.max_cstate=2 $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-19-generic
}
menuentry 'Ubuntu, with Linux 3.11.0-19-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-19-generic-recovery-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-19-generic ...'
linux /boot/vmlinuz-3.11.0-19-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-19-generic
}
menuentry 'Ubuntu, with Linux 3.11.0-18-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-18-generic-advanced-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-18-generic ...'
linux /boot/vmlinuz-3.11.0-18-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro quit splash processor.max_cstate=2 $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-18-generic
}
menuentry 'Ubuntu, with Linux 3.11.0-18-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-18-generic-recovery-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-18-generic ...'
linux /boot/vmlinuz-3.11.0-18-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-18-generic
}
menuentry 'Ubuntu, with Linux 3.11.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-17-generic-advanced-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-17-generic ...'
linux /boot/vmlinuz-3.11.0-17-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro quit splash processor.max_cstate=2 $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-17-generic
}
menuentry 'Ubuntu, with Linux 3.11.0-17-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.0-17-generic-recovery-1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
echo 'Loading Linux 3.11.0-17-generic ...'
linux /boot/vmlinuz-3.11.0-17-generic root=UUID=1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.11.0-17-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
else
search --no-floppy --fs-uuid --set=root 1b12d4dd-8a3c-47b1-8b9d-7c6cbe5371ea
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Mac OS X (32-bit) (on /dev/sda2)' --class osx --class darwin --class os $menuentry_id_option 'osprober-xnu-32-8a6a66edd559aa12' {
insmod part_gpt
insmod hfsplus
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 8a6a66edd559aa12
else
search --no-floppy --fs-uuid --set=root 8a6a66edd559aa12
fi
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ $do_resume = 0 ]; then
xnu_uuid 8a6a66edd559aa12 uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
if [ /kernelcache -nt /System/Library/Extensions ]; then
xnu_kernel /kernelcache boot-uuid=${uuid} rd=*uuid
else
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
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/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
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
}
menuentry 'Mac OS X (64-bit) (on /dev/sda2)' --class osx --class darwin --class os $menuentry_id_option 'osprober-xnu-64-8a6a66edd559aa12' {
insmod part_gpt
insmod hfsplus
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 8a6a66edd559aa12
else
search --no-floppy --fs-uuid --set=root 8a6a66edd559aa12
fi
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ $do_resume = 0 ]; then
xnu_uuid 8a6a66edd559aa12 uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
if [ /kernelcache -nt /System/Library/Extensions ]; then
xnu_kernel64 /kernelcache boot-uuid=${uuid} rd=*uuid
else
xnu_kernel64 /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
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/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
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
}
### 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 ###
对我来说这似乎很好......