Xenial LTS 16.04 最小化版 - 启动时无法显示控制台和信息

我安装了新的Xenial LTS 16.04 minimal(mini.iso)...我只安装了最基本的系统(没有桌面等)。
我想要启动消息...正常的grub启动,控制台显示启动消息。但是,我只能看到一个空白屏幕,直到启动完成,然后我必须手动打开tty。
我修改了我的/etc/default/grub文件:
root@laptop:/home/one# cat /etc/default/grub 
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

运行了update-grub命令,并验证了/boot/grub/grub.cfg文件中的正确性。
root@laptop:/home/one# cat /etc/default/grub 
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

以下是我从mount命令中得到的指令和输出内容。
root@laptop:/home/one# mount /dev/sda1 /boot/
mount: /dev/sda1 is already mounted or /boot busy
       /dev/sda1 is already mounted on /boot

以下是/boot/grub/grub.cfg的内容。
#
# 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 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
}

terminal_input console
terminal_output console
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
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=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

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

但是还是没有成功……没有控制台,启动过程中也没有带有消息的控制台。
有什么想法吗?

2你为什么没有菜单项?在我的 /boot/grub/grub.cfg 文件中,在由 /etc/grub.d/10_linux 控制的部分有菜单项(在 export linux_gfx_mode 这一行之后)。 - sudodus
1没有,它似乎默认为case ${GRUB_DISTRIBUTOR} in Ubuntu|Kubuntu) OS="${GRUB_DISTRIBUTOR}" - dman
1@sudodus 啊...我明白了。Ubuntu不使用单独的分区。我挂载了一个引导分区,这就是问题所在。 - dman
1@dman 你是说现在问题已经解决了,因为你知道/boot位于/分区内吗? - WinEunuuchs2Unix
1是的.... 正确 - dman
1恭喜,@dman :-) - sudodus
@sudodus 如果你的评论导致了解决方案,你应该为悬赏写一个答案吗?(更不用说我们的点赞了!) - WinEunuuchs2Unix
@dman,Sudodus的回答可接受吗?我见过太多奖励被浪费掉的情况了。Sudodus:+1 :) - WinEunuuchs2Unix
@WinEunuuchs2Unix,谢谢你 :-) - sudodus
3个回答

这个问题的根本原因在你的问题中已经找到,但是被埋在你的/etc/default/grub/boot/grub/grub.cfg之间。我已经编辑了你的帖子,使其更清晰明了。你试图将/dev/sda1挂载到/boot,根据手头的证据来看,它已经挂载在/上了。你应该注释掉GRUB_GFXMODE=640x480,因为对于文本控制台输出来说并不必要,而且可能会干扰。你已经有了GRUB_CMDLINE_LINUX_DEFAULT="text"GRUB_TERMINAL=console,所以看起来你已经涵盖了这里提到的基本内容。
简而言之,进入控制台模式最简单的方法是进入运行级别3。你可以通过编辑以下行来很容易地测试一下: GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable quiet splash zswap.enabled=1" 改为 GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable 3" 保留您实际需要/想要的任何内核参数。这里的3是关键,它将运行级别设置为3,这是大多数服务器的默认级别。
有关运行级别的更多详细信息,请参阅https://www.cyberciti.biz/tips/linux-changing-run-levels.html

在我作为评论提出问题之后,为什么/boot/grub/grub.cfg中没有菜单项,OP明白了问题所在,这个文件位于根分区(而不是独立分区)中的操作系统。
所以问题基本上由@dman自己解决了(受到我的问题的一点启发):-)


没有解决问题。 - dman