![ArchLinux에 올바른 grub을 설치할 수 없습니다](https://linux55.com/image/55889/ArchLinux%EC%97%90%20%EC%98%AC%EB%B0%94%EB%A5%B8%20grub%EC%9D%84%20%EC%84%A4%EC%B9%98%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
가상 머신에 ArchLinux를 설치하려고 하는데 다음 오류가 발생합니다.
grub을 설치하기 위한 마지막 단계를 따를 때https://wiki.archlinux.org/index.php/GRUB#Install_to_disk
grub-install --target=i386-pc --recheck --debug /dev/sdx
grub-mkconfig -o /boot/grub/grub.cfg
저는 이렇게 입력합니다.
grub-install --target=i386-pc --recheck --debug /dev/sda
좋은 결과.
grub-mkconfig -o /mnt/boot/grub/grub.cfg
이것도...(있어야 할 곳에 cfg를 저장하세요).
/mnt
때문에 다 설치했어요새로 설치한 내용입니다그래서 아래의 모든 단계를 따랐습니다.https://wiki.archlinux.org/index.php/Installation_guide
"초보자 가이드"를 확인하고 동일한 답변을 얻었지만 grub이 올바르게 설치되지 않았습니다...
grub이 시작되고 존재하지 않는 장치 UUID를 찾습니다. 따라서 grub은 grub 복구 모드에서 시작됩니다.
그렇다면 어떻게 하면 이것을 올바르게 할 수 있을까요?
//편집하다
이것은 내 grub.cfg입니다.
root@archiso /mnt/boot/grub # ls
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 ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
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 ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 9de3d09f-5b66-48f7-9fcb-f832a684a04f
else
search --no-floppy --fs-uuid --set=root 9de3d09f-5b66-48f7-9fcb-f832a684a04f
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_input console
terminal_output gfxterm
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
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_archlinux ###
### END /etc/grub.d/10_archlinux ###
### BEGIN /etc/grub.d/10_linux ###
### 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/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 ###
### BEGIN /etc/grub.d/60_memtest86+ ###
if [ "${grub_platform}" == "pc" ]; then
menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
search --fs-uuid --no-floppy --set=root 9de3d09f-5b66-48f7-9fcb-f832a684a04f
linux16 /boot/memtest86+/memtest.bin
}
fi
### END /etc/grub.d/60_memtest86+ ###
이것은 모두 UUID입니다
ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 9 Sep 17 16:36 2014-04-01-03-36-48-00 -> ../../sr0
lrwxrwxrwx 1 root root 10 Sep 17 16:36 6b4d5963-c7dd-409a-b8cb-bc28f7119a4b -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 17 16:36 9de3d09f-5b66-48f7-9fcb-f832a684a04f -> ../../dm-0
lrwxrwxrwx 1 root root 10 Sep 17 16:36 f2844853-8f7f-43b7-a9ca-1df878849bf4 -> ../../sda1
알았어 blkid가 추가될 거야
root@archiso /mnt/boot/grub # blkid /dev/sda*
/dev/sda: PTUUID="756a4dfc" PTTYPE="dos"
/dev/sda1: UUID="f2844853-8f7f-43b7-a9ca-1df878849bf4" TYPE="swap" PARTUUID="756a4dfc-01"
/dev/sda2: UUID="6b4d5963-c7dd-409a-b8cb-bc28f7119a4b" TYPE="ext4" PARTUUID="756a4dfc-02"
root@archiso /mnt/boot/grub # blkid /dev/dm-*
/dev/dm-0: UUID="9de3d09f-5b66-48f7-9fcb-f832a684a04f" TYPE="ext4
답변1
모드 에 있다면 arch-chroot
실행해야합니다
grub-mkconfig -o /boot/grub/grub.cfg
밖의
grub-mkconfig -o /mnt/boot/grub/grub.cfg
왜냐하면: 아치 리눅스를 처음 설치하게 되면 파일 시스템을 마운트 /mnt
하고, 베이스 시스템을 외부적으로 설치하게 됩니다. 기본 패키지가 완성되면 arch-chroot
해당 패키지로 이동할 수 /mnt
있으며 모든 명령은 일반 운영 체제에서와 마찬가지로 실행됩니다.
그래도 문제가 해결되지 않으면 계속하세요.
파티션에 부팅 가능한 플래그가 있는지 확인하세요.
lsblk -f
다음을 실행할 수 있습니다.
mkdir -p /boot/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
조금이라도 피하기 위해비공격적grub으로 부팅할 때 오류 메시지가 나타납니다. 그렇지 않을 수도 있지만 시도해 볼 수 있습니다.
문제의 원인이 무엇인지 잘 모르겠지만, 예를 들어 다른 부트로더를 설치하여 syslinux
문제가 grub이나 파일 시스템으로 인해 발생한 것인지 확인할 수 있습니다.
가상 머신에 설치하는 것이므로 샌드박스로 자유롭게 사용하고 다양한 설치 방법을 모두 시도해 보세요.
VM에서 어떻게 작동하는지 모르겠지만 UEFI 하드 드라이브가 있으므로 grub에 대해 약간 다른 설치 구성을 사용하고 있습니다.
답변2
이 문제에 대해 제가 찾은 해결책은 부팅할 별도의 파티션을 만드는 것이었습니다. 그러면 모든 설치 작업이 발견됩니다.
Grub 설치에서 내가 한 일은 다음과 같습니다.
부팅 파티션을 부팅 디렉터리에 마운트합니다. (저는 / 이전에 만들었습니다)
따라서 마운트 /dev/sda2
(/)가 있고 /mnt
마운트 /dev/sda3
(/boot)가 있습니다./mnt/boot
pacstrap /mnt grub-bios
genfstab -U -p /mnt >> /mnt/etc/fstab
마침내
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
성공!
다들 감사 해요.