Grub2를 사용하여 Arch Linux와 함께 FreeBSD를 이중 부팅할 수 없습니다.

Grub2를 사용하여 Arch Linux와 함께 FreeBSD를 이중 부팅할 수 없습니다.

Grub에서 볼 수 있듯이 내 디스크 파티션 구성표는 다음과 같습니다.

hd0,gpt1: EFI system
hd0,gpt2: Linux Swap
hd0,gpt3: Linux Filesystem
hd0,gpt4: FreeBSD UFS`

FreeBSD 11.0-RELEASE의 설치 과정은 순조롭게 진행되었으며, 만약을 대비해 루트를 바꾸고 시스템을 업데이트해 보았습니다. 그런 다음 Arch Linux로 부팅하고 편집하여 /etc/grub/40_custom다양한 구성을 시도했습니다(참조:wiki.archlinux.org의 GRUB에 있는 FreeBSD 메뉴 항목), 그리고 실행했습니다 grub-mkconfig -o /boot/grub/grub.cfg.

(참고: 루트 fs에 대한 올바른 개발 파일을 지정하는 "mountfrom" 매개변수를 편집했습니다. 제 경우에는 ada0p4이고 "bsd1" 항목을 생략하고 (hd0,gpt4)만 설정했습니다. 그렇지 않으면 찾을 수 없습니다. 분할.)

로드 kfreebsd /boot/loader하고 부팅하면 검은 화면이 나타납니다.

내가 로드하면

kfreebsd /boot/kernel/kernel 
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
set kFreeBSD.vfs.root.mountfrom.options=rw

부팅하면 다음과 같은 결과가 나타납니다.

내 노트북은 Thinkpad X220입니다(기본 BIOS가 최신 버전임). 그럽 버전: 2.02.beta3-4.

여기에 무슨 문제가 있습니까? 추가 정보가 필요하면 댓글을 남겨주세요.

나의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 part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  ff637c2e-1e42-4533-9a12-6ac2f6d43c9b
else
  search --no-floppy --fs-uuid --set=root ff637c2e-1e42-4533-9a12-6ac2f6d43c9b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1024x768
  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_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod fat
    set root='hd0,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  BE35-0EC9
    else
      search --no-floppy --fs-uuid --set=root BE35-0EC9
    fi
    echo    'Loading Linux linux ...'
    linux   /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw  
    echo    'Loading initial ramdisk ...'
    initrd  /intel-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
    menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  BE35-0EC9
        else
          search --no-floppy --fs-uuid --set=root BE35-0EC9
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw  
        echo    'Loading initial ramdisk ...'
        initrd  /intel-ucode.img /initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  BE35-0EC9
        else
          search --no-floppy --fs-uuid --set=root BE35-0EC9
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw  
        echo    'Loading initial ramdisk ...'
        initrd  /intel-ucode.img /initramfs-linux-fallback.img
    }
}

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

menuentry 'FreeBSD 11.0' {
    insmod ufs2
    set root=(hd0,gpt4)
    kfreebsd /boot/kernel/kernel
    kfreebsd_loadenv /boot/device.hints
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
    set kFreeBSD.vfs.root.mountfrom.options=rw
}

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

편집하다: 디스크 파티셔닝 직전에 다음 텍스트와 함께 경고가 표시된다는 점을 언급하는 것을 잊어버렸습니다.

귀하의 Lenovo 모델에는 UEFI 없이 GPT 파티션에서 부팅하지 못하게 하는 BIOS 버그가 있는 것으로 알려져 있습니다. 설치 프로그램이 해결 방법을 적용하도록 하시겠습니까?

UEFI로 부팅하기 때문에 적용하지 않기로 결정했습니다(적용을 시도했지만 성공하지 못했습니다).

답변1

동일한 노트북(하드 드라이브 2개가 있는 lenovo X220, 하나는 시스템용, 다른 하나는 데이터용)과 FreeBSD 10을 사용하여 동일한 문제가 발생했습니다. 저를 위한 한 가지 해결책은 다음과 같습니다.

  1. MBR 구성표 설치(이 노트북에서는 GPT 지원이 중단된 것 같습니다)
  2. 그럽 설치
  3. 일부 파티션에 FreeBSD 설치

grub.cfg방법은 간단합니다(오랜 기간 동안 잘 작동함).

menuentry 'FreeBSD' {
  insmod bsd
  insmod ufs2
  set root='hd0,msdos3'
  kfreebsd /boot/loader
}

저는 그냥 FreeBSD를 사용합니다부트로더FreeBSD 커널을 시작하려면(내 사용자 정의 구성을 사용하여)로더.conf). FreeBSD 커널의 옵션을 사용하여 직접 부팅하려고 하면 kfreebsd많은 것을 구성해야 합니다.

그런데, 읽어보셨나요?grub2를 사용한 멀티부트 환경에 대한 공식 FreeBSD 문서?

답변2

대부분의 가이드에서는 체인 로딩에 사용하라고 제안했지만 chainloader +1제게는 효과가 없었습니다.
다음 구성이 트릭을 수행했습니다.

insmod ufs2  
set root=(hd0,gpt4)  
chainloader /boot/loader.efi

관련 정보