ネットワークからGRUBブート:grub.cfgが見つかりませんか?

ネットワークからGRUBブート:grub.cfgが見つかりませんか?

私は次の設定を進めています。

  • Debian 11 サーバーの DHCP サーバー、ウォーゴン(192.168.50.9)
  • Debian 12 サーバーの TFTP サーバージョーン(192.168.50.111)
  • 現在VirtualBox VMにあるクライアント

関連構成ウォーゴン:

subnet 192.168.50.0 netmask 255.255.255.0 {
  range 192.168.50.10 192.168.50.190;
  option routers 192.168.50.1;
  option broadcast-address 192.168.50.255;
  option boot-size 8208;
  next-server 192.168.50.111;
  option tftp-server-address 192.168.50.111;
  option bootfile-name "/boot/grub/x86_64-efi/core.efi";
  filename "/boot/grub/x86_64-efi/core.efi";
}

存在するジョーンgrub-mknetdir を使用して grub.cfg ディレクトリを作成します。

# ll /srv/tftp/boot/grub/x86_64-efi/*cfg
-rw-r--r-- 1 root root 291 Jun 30 09:52 /srv/tftp/boot/grub/x86_64-efi/grub.cfg
# cat /srv/tftp/boot/grub/x86_64-efi/*cfg
menuentry 'Boot Debian 12' {
  set background_color=black
  linux /debian12/boot/vmlinuz-6.1.0-9-amd64 console=tty0 console=ttyS0 ip=dhcp root=/dev/nfs ro nfsroot=192.168.50.111:/image/debian12,vers=3,nolock panic=60 ipv6.disable=1 rootwait
  initrd /debian12/boot/initrd.img-6.1.0-9-amd64
}

COM1 / ttyS0の出力をファイルに送信するようにVMクライアントを設定しました。ttyS0.log。仮想マシンを起動するとブートローダがダウンロードされ、core.efiそして、最終的にGRUBシェルに入ります。ログファイルには表示されない内容は表示されません。それは次のとおりですグラップ構成ファイル実際にGRUBコマンドラインを少し使用すると、まったく見つからないようです。(tftp)デバイスがまったく検出されない:

grub> ls (tftp)
Device tftp:
grub> ls (tftp,192.168.50.111)
        Partition tftp,192.168.50.111:
grub>

私がここで何を間違っているのか?

ベストアンサー1

したがって、短い答えは次のようになります。grub.cfg作業ディレクトリの下にある必要がありますboot/grub/。通常、実行中のプロセスを見ると値が見つかります。tftp/srv/tftp/etc/default/tftp

# ps -ef | grep tftp
root       16120       1  0 13:49 ?        00:00:00 /usr/sbin/in.tftpd --listen --user tftp --address :69 -vv -s /srv/tftp

PXEから起動すると、ファイルはTFTP経由でダウンロードされます。残念ながら、私のシステム(Debian 12)では、tftpデーモンはtftpデーモンに書き込まれませんが、/var/log/syslog私が見つけたようにtftpログに書き込まれるので、次のメッセージを確認してください。

# journalctl | grep tftpd
...
Jun 30 14:25:22 zorn in.tftpd[16382]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-01-08-00-27-ae-a4-19
Jun 30 14:25:22 zorn in.tftpd[16382]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16383]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A8325D
Jun 30 14:25:22 zorn in.tftpd[16383]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16384]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A8325
Jun 30 14:25:22 zorn in.tftpd[16384]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16385]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A832
Jun 30 14:25:22 zorn in.tftpd[16385]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16386]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A83
Jun 30 14:25:22 zorn in.tftpd[16386]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16387]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A8
Jun 30 14:25:22 zorn in.tftpd[16387]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16388]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0A
Jun 30 14:25:22 zorn in.tftpd[16388]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16389]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C0
Jun 30 14:25:22 zorn in.tftpd[16389]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16390]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg-C
Jun 30 14:25:22 zorn in.tftpd[16390]: sending NAK (1, File not found) to 192.168.50.93
Jun 30 14:25:22 zorn in.tftpd[16391]: RRQ from 192.168.50.93 filename /boot/grub/x86_64-efi/command.lst
Jun 30 14:25:22 zorn in.tftpd[16392]: RRQ from 192.168.50.93 filename /boot/grub/x86_64-efi/fs.lst
Jun 30 14:25:22 zorn in.tftpd[16393]: RRQ from 192.168.50.93 filename /boot/grub/x86_64-efi/crypto.lst
Jun 30 14:25:22 zorn in.tftpd[16394]: RRQ from 192.168.50.93 filename /boot/grub/x86_64-efi/terminal.lst
Jun 30 14:25:22 zorn in.tftpd[16395]: RRQ from 192.168.50.93 filename /boot/grub/grub.cfg
...

これは、以下で実行できる操作と似ています。GRUBマニュアル、第8章- ここではメニューファイルを探していることがわかりますが/boot/grub、tftpデーモンは作業ディレクトリとしてルートが指定されているので、/srv/tftp実際にはこのパスはです/srv/tftp/boot/grub

おすすめ記事