Linux

Parrot Linux 開機黑屏,下劃線閃爍: Can get shell with ctrl + alt + F1

  • June 6, 2018

所以我最近移動了 Linux 交換分區,並調整了我硬碟上 Parrot 安裝的根分區的大小,以增加可用空間。使用 GParted 應用編輯後,我無法使用圖形界面啟動。而是在初始化後螢幕變黑,左上角有一個閃爍的游標。據我推測,這與 GRUB 中的錯誤有關。在過去的兩周里,我研究瞭如何解決這個問題的各種選擇,但沒有找到解決方案。在使用 Ctrl+Alt+F1 獲得 shell 後,我使用 apt-get、grub 和 initramfs 執行了更新腳本。還有一個可能與數組分割有關的錯誤。長話短說,我的一根 SATA 電纜連接到我的 CDROM 驅動器時也遇到了故障。更換後,ata1: error:消息不再與 一起出現mdadm: No arrays found in config file or automatically,但是在bootinfoscript按照各種來源的建議執行之後,問題仍然存在。我在這裡不知所措,因為我嘗試了各種想法但沒有看到任何結果。

以下是該問題的一些資源:

bootinfoscript:

Boot Info Script 0.76      [13 April 2017]

Identifying MBRs...
Computing Partition Table of /dev/sda...
Searching sda1 for information... 
Searching sda2 for information... 
Searching sda4 for information... 
                 Boot Info Script 0.76      [13 April 2017]


============================= Boot Info Summary: ===============================

=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of 
   the same hard drive for core.img. core.img is at this location and looks 
   for (,msdos1)/boot/grub. It also embeds following components:

   modules
   ---------------------------------------------------------------------------
   fshelp ext2 part_msdos biosdisk
   ---------------------------------------------------------------------------

sda1: __________________________________________________________________________

   File system:       ext4
   Boot sector type:  -
   Boot sector info: 
   Operating System:  Parrot GNU/Linux 4.0
   Boot files:        /boot/grub/grub.cfg /etc/fstab 
                      /boot/grub/i386-pc/core.img

sda2: __________________________________________________________________________

   File system:       swap
   Boot sector type:  -
   Boot sector info: 

sda4: __________________________________________________________________________

   File system:       ext4
   Boot sector type:  -
   Boot sector info: 
   Operating System:  
   Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048   697,952,255   697,950,208  83 Linux
/dev/sda2         697,952,256   697,972,735        20,480  82 Linux swap / Solaris
/dev/sda4       1,748,725,760 1,953,525,167   204,799,408  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        b7ff9eea-13c4-4b30-8104-b41cc3258364   ext4       
/dev/sda2        bff285cd-4db4-4ad7-8656-e86cf811808e   swap       
/dev/sda4        8583fa2e-35fe-4064-a277-201e72982afc   ext4       

========================= "ls -l /dev/disk/by-id" output: ======================

total 0
lrwxrwxrwx 1 root root  9 Jun  3 01:37 ata-ASUS_DRW-24F1ST_a_S10K68EF300420 -> ../../sr0
lrwxrwxrwx 1 root root  9 Jun  3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS -> ../../sda
lrwxrwxrwx 1 root root 10 Jun  3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun  3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun  3 01:37 ata-TOSHIBA_DT01ACA100_Y3GYH74NS-part4 -> ../../sda4
lrwxrwxrwx 1 root root  9 Jun  3 01:37 wwn-0x5000039ff7cd67ef -> ../../sda
lrwxrwxrwx 1 root root 10 Jun  3 01:37 wwn-0x5000039ff7cd67ef-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun  3 01:37 wwn-0x5000039ff7cd67ef-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun  3 01:37 wwn-0x5000039ff7cd67ef-part4 -> ../../sda4

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda1        /                        ext4       (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1        /var/lib/docker/overlay2 ext4       (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1        /var/lib/docker/plugins  ext4       (rw,relatime,errors=remount-ro,data=ordered)


=========================== sda1/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 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,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  b7ff9eea-13c4-4b30-8104-b41cc3258364
else
 search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
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=C
 insmod gettext
fi
terminal_output gfxterm
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 ###
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  b7ff9eea-13c4-4b30-8104-b41cc3258364
else
 search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
fi
insmod png
if background_image /usr/share/desktop-base/parrot-theme/grub/grub-4x3.png; then
 true
else
 set menu_color_normal=cyan/blue
 set menu_color_highlight=white/blue
fi
### 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
menuentry 'Parrot GNU/Linux' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
   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  b7ff9eea-13c4-4b30-8104-b41cc3258364
   else
     search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
   fi
   echo    'Loading Linux 4.16.0-parrot12-amd64 ...'
   linux   /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
   echo    'Loading initial ramdisk ...'
   initrd  /boot/initrd.img-4.16.0-parrot12-amd64
}
submenu 'Advanced options for Parrot GNU/Linux' $menuentry_id_option 'gnulinux-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
   menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot12-amd64' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot12-amd64-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
       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  b7ff9eea-13c4-4b30-8104-b41cc3258364
       else
         search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
       fi
       echo    'Loading Linux 4.16.0-parrot12-amd64 ...'
       linux   /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
       echo    'Loading initial ramdisk ...'
       initrd  /boot/initrd.img-4.16.0-parrot12-amd64
   }
   menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot12-amd64 (recovery mode)' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot12-amd64-recovery-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
       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  b7ff9eea-13c4-4b30-8104-b41cc3258364
       else
         search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
       fi
       echo    'Loading Linux 4.16.0-parrot12-amd64 ...'
       linux   /boot/vmlinuz-4.16.0-parrot12-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro single noautomount
       echo    'Loading initial ramdisk ...'
       initrd  /boot/initrd.img-4.16.0-parrot12-amd64
   }
   menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot5-amd64' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot5-amd64-advanced-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
       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  b7ff9eea-13c4-4b30-8104-b41cc3258364
       else
         search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
       fi
       echo    'Loading Linux 4.16.0-parrot5-amd64 ...'
       linux   /boot/vmlinuz-4.16.0-parrot5-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro noautomount quiet
       echo    'Loading initial ramdisk ...'
       initrd  /boot/initrd.img-4.16.0-parrot5-amd64
   }
   menuentry 'Parrot GNU/Linux, with Linux 4.16.0-parrot5-amd64 (recovery mode)' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.0-parrot5-amd64-recovery-b7ff9eea-13c4-4b30-8104-b41cc3258364' {
       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  b7ff9eea-13c4-4b30-8104-b41cc3258364
       else
         search --no-floppy --fs-uuid --set=root b7ff9eea-13c4-4b30-8104-b41cc3258364
       fi
       echo    'Loading Linux 4.16.0-parrot5-amd64 ...'
       linux   /boot/vmlinuz-4.16.0-parrot5-amd64 root=UUID=b7ff9eea-13c4-4b30-8104-b41cc3258364 ro single noautomount
       echo    'Loading initial ramdisk ...'
       initrd  /boot/initrd.img-4.16.0-parrot5-amd64
   }
}

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

=============================== sda1/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
/dev/sda1 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
/dev/sda2 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

          GiB - GB             File                                 Fragment(s)

187.522518158 = 201.350770688  boot/grub/grub.cfg                             3
  4.466430664 = 4.795793408    boot/grub/i386-pc/core.img                     1
190.794677734 = 204.864225280  boot/vmlinuz-4.16.0-parrot12-amd64             1
116.404052734 = 124.987899904  boot/vmlinuz-4.16.0-parrot5-amd64              1
190.794677734 = 204.864225280  vmlinuz                                        1
116.404052734 = 124.987899904  vmlinuz.old                                    1
  7.262573242 = 7.798128640    boot/initrd.img-4.12.0-parrot6-amd64.old-dkms  3
131.342136383 = 141.027545088  boot/initrd.img-4.13.0-parrot4-amd64.dpkg-bak  2
185.904907227 = 199.613874176  boot/initrd.img-4.13.0-parrot4-amd64.old-dkms  1
 19.698547363 = 21.151154176   boot/initrd.img-4.14.0-parrot13-amd64.old-dkms  5
 55.503704071 = 59.596648448   boot/initrd.img-4.15.0-parrot17-amd64.old-dkms  1
 91.322883606 = 98.057199616   boot/initrd.img-4.16.0-parrot12-amd64          2
 85.414760590 = 91.713400832   boot/initrd.img-4.16.0-parrot5-amd64           4
 91.322883606 = 98.057199616   initrd.img                                     2
 85.414760590 = 91.713400832   initrd.img.old                                 4

=============================== StdErr Messages: ===============================

mdadm: No arrays found in config file or automatically

** 使用 GParted 應用編輯後,我無法使用圖形界面啟動。而是在初始化後螢幕變黑,左上角有一個閃爍的游標。**

我有類似的問題,不完全相同,你可能想試試這個:

$$ Fixing the black screen after grub boot-up (screen/video settings mismatch) $$

引用自:https://unix.stackexchange.com/questions/447835