ArchLinux に正しい grub をインストールできない

ArchLinux に正しい grub をインストールできない

仮想マシンに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.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

なぜなら:アーチLinuxを初めてインストールすると、ファイルシステムをマウントし/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に対して少し異なるインストール構成を使用しています。

おすすめ記事