시작 시 명령줄을 제공하는 대신 grub이 Kali를 직접 시작하도록 하는 방법은 무엇입니까?

시작 시 명령줄을 제공하는 대신 grub이 Kali를 직접 시작하도록 하는 방법은 무엇입니까?
  1. USB 장치를 사용하여 Windows 10 듀얼 부팅에 Kali Linux 2.0 64비트(정식 버전)를 설치했는데 제 기억이 맞다면 설치에는 오류가 없었습니다. 내 장치는 BIOS에서 CSM이 활성화되고 보안 부팅이 비활성화된 Asus TP300LA(UEFI)입니다.
  2. 설치 후 Shift 키를 누르고 있어도 grub이 표시되지 않습니다. Windows 10으로 직접 부팅합니다.
  3. 온라인 연구는 거의 없습니다. "부팅 복구" iso를 사용하여 grub에 대한 액세스 권한을 다시 얻었지만...:
  4. 나는 지금 여기에 갇혀있습니다:

                      GNU GRUB version 2.02~beta2-22ubuntu1
    
    Minimal BASH-like line editing is supported. For the first word, TAB...
    
    grub> _
    

온라인에서 찾은 몇 가지 명령을 사용하여 kali에 액세스할 수 있습니다(ls, 파티션 선택, 커널 로드(그렇다고 생각합니다), initrd, 부팅...(일부 그런 것임)). 하지만 grub을 복구/업그레이드해도 문제는 남아 있습니다. 복구 도구 시작을 다시 시도하는 이벤트: /

내 파티션이 있습니다.

일부 갈라진

그런데 이것이 무엇인지 이해가 되지 않습니다. Windows, 데이터 파티션 및 Kali만 있습니다.


이것이 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
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt10'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
else
  search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
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=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 0 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod ext2
set root='hd0,gpt10'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
else
  search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
fi
insmod png
if background_image /usr/share/images/desktop-base/kali-grub.png; then
  set color_normal=white/black
  set color_highlight=black/white
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}"
    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 'Kali GNU/Linux' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8047cda5-cffa-4d3f-9481-cef578f83efc' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt10'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
    else
      search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
    fi
    linux   /boot/vmlinuz-4.0.0-kali1-amd64 root=UUID=8047cda5-cffa-4d3f-9481-cef578f83efc ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-4.0.0-kali1-amd64
}
submenu 'Advanced options for Kali GNU/Linux' $menuentry_id_option 'gnulinux-advanced-8047cda5-cffa-4d3f-9481-cef578f83efc' {
    menuentry 'Kali GNU/Linux, with Linux 4.0.0-kali1-amd64' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.0-kali1-amd64-advanced-8047cda5-cffa-4d3f-9481-cef578f83efc' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt10'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
        else
          search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
        fi
        echo    'Loading Linux 4.0.0-kali1-amd64 ...'
        linux   /boot/vmlinuz-4.0.0-kali1-amd64 root=UUID=8047cda5-cffa-4d3f-9481-cef578f83efc ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-4.0.0-kali1-amd64
    }
    menuentry 'Kali GNU/Linux, with Linux 4.0.0-kali1-amd64 (recovery mode)' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.0-kali1-amd64-recovery-8047cda5-cffa-4d3f-9481-cef578f83efc' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt10'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
        else
          search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
        fi
        echo    'Loading Linux 4.0.0-kali1-amd64 ...'
        linux   /boot/vmlinuz-4.0.0-kali1-amd64 root=UUID=8047cda5-cffa-4d3f-9481-cef578f83efc ro single nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-4.0.0-kali1-amd64
    }
    menuentry 'Kali GNU/Linux, with Linux 3.19.0-15-generic' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.19.0-15-generic-advanced-8047cda5-cffa-4d3f-9481-cef578f83efc' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt10'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
        else
          search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
        fi
        echo    'Loading Linux 3.19.0-15-generic ...'
        linux   /boot/vmlinuz-3.19.0-15-generic.efi.signed root=UUID=8047cda5-cffa-4d3f-9481-cef578f83efc ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.19.0-15-generic
    }
    menuentry 'Kali GNU/Linux, with Linux 3.19.0-15-generic (recovery mode)' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.19.0-15-generic-recovery-8047cda5-cffa-4d3f-9481-cef578f83efc' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt10'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  8047cda5-cffa-4d3f-9481-cef578f83efc
        else
          search --no-floppy --fs-uuid --set=root 8047cda5-cffa-4d3f-9481-cef578f83efc
        fi
        echo    'Loading Linux 3.19.0-15-generic ...'
        linux   /boot/vmlinuz-3.19.0-15-generic.efi.signed root=UUID=8047cda5-cffa-4d3f-9481-cef578f83efc ro single nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.19.0-15-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/25_custom ###

menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 523E-93B4
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 523E-93B4
chainloader (${root})/EFI/Boot/bootx64.efi
}
### END /etc/grub.d/25_custom ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-523E-93B4' {
    insmod part_gpt
    insmod fat
    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  523E-93B4
    else
      search --no-floppy --fs-uuid --set=root 523E-93B4
    fi
    chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}
### 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 ###

답변1

UEFI를 통해 Windows를 부팅하고 BIOS를 통해 다른 부팅을 수행하면 합리적인 이중 부팅을 얻을 수 없습니다. 불행히도 지금까지 본 다른 모든 답변은 처음에 이 사실을 무시하기 때문에 완전한 쓰레기입니다.

CSM을 비활성화하고 UEFI 모드에서 Kali를 설치하는 것이 더 나을 것입니다. UEFI 부트로더(예: grub-efi)가 제대로 설치되어야 하기 때문입니다. /boot/efi현재 마운트가 부족한 것으로 판단하면 BIOS 부팅이 가능합니다.

가서 무슨 일이 일어나고 있는지 확인하는 것이 좋을 것 같습니다. Rod Smith가 하나 가지고 있습니다.UEFI 부트로더에 대한 훌륭한 소개-- UEFI 지원을 소개하는 데 매우 도움이 되었습니다.리눅스의 대안.

행운을 빕니다. 도움이 된다면 답변하는 사람들에게 링크를 전달하는 것이 좋습니다. 단서 없이 답변하는 것은 모든 사람의 시간 낭비일 뿐입니다.

러시아의 사랑으로 ;-)

답변2

당신이 해야 할 일은 grub.cfg실행 명령이 포함된 파일을 만드는 것입니다. 그런 다음 시작할 때마다 정의한 항목이 포함된 메뉴가 표시되며 grub.cfg항상 다시 입력할 필요 없이 하나만 선택할 수 있습니다.

명령줄에서 성공적으로 실행했다면 수동으로 입력한 명령 grub만 지정하면 됩니다. 파일은 또는 유사한 디렉토리에 grub.cfg있습니다 . (Kali 내에서) 시스템에 어떤 디렉토리가 있는지 확인하세요. 최소한의 예를 포함하겠습니다./boot/grub/boot/grub2

set timeout=5
set default=0

menuentry "Title for the boot menu" {
        set root='(hd0,gpt2)'
        linux /kernel-4.2.3 root=/dev/sda3
        initrd /initramfs-4.2.3.img
}

실행 중인 정확한 명령과 일치하도록 편집해야 합니다. 중괄호 사이에 사용 중인 내용을 입력하면 됩니다.

grub.cfg또는 전체 경로 (예 : ) 를 파악한 후 /boot/grub/grub.cfg명령줄에 다음을 입력할 수 있습니다.

grub-mkconfig -o /path/to/grub.cfg

이렇게 하면 grub.cfg다른 장소의 설정을 사용하여 눈에 띄게 작은 최소화가 생성됩니다. 원하는 대로 작동할 가능성이 높지만 사용자 정의하는 것은 약간의 고통이 될 수 있습니다.

답변3

구성 파일을 생성하기만 하면 됩니다.

grub-mkconfig -o /boot/grub/grub.cfg

사용은 다른 운영 체제(예: Windows)를 감지하고 메뉴 항목을 작성하여 자동으로 실행하는 grub-mkconfig기능을 사용하므로 생활이 더 쉬워집니다 . os-prober사용자 정의하려면 무언가를 사용하여 편집하세요 /etc/default/grub.

그런 다음 다시 시작을 사용하십시오 reboot.

그래도 작동하지 않는 경우:

  • UEFI 설정이 "UEFI First" 또는 "UEFI Only"와 같은지 확인하세요. efibootmgrKali에서 실행하여 EFI 부팅 순서 목록에 있는 내용을 확인할 수도 있습니다 .

  • grub이 시스템에 올바르게 설치되어 있는지 확인하고 싶을 수도 있습니다.ESP, 시동 복구가 제대로 수행되지 않는 경우:

    # run all those commands in this answer as root
    # I think boot-repair has done all those already
    mkdir -p /boot/efi # first create the mount point
    mount -t vfat /dev/sda2 /boot/efi # so we mount the ESP
    grub-install --target=x86_64-efi --bootloader-id=grub --recheck
    
  • grub-install추가 인수를 사용하여 위를 실행합니다 --boot-directory=/boot/efi. 그런 다음 ESP에 있는 모든 grub 파일을 얻을 수 있도록 사용하십시오 grub-mkconfig -o /boot/efi/grub/grub.cfg(이로 인해 ESP가 채워질 수 있음).

grub이 여전히 이를 찾을 수 없고 명령줄을 제공한다면 다른 배포판을 사용해 보십시오.

관련 정보