蘭雅sRGB 个人笔记 https://262235.xyz
提供编程和电脑应用视频教程,工具和源代码
C, C++, Python Programming, Source Code, Video

旧Hexo博客 | Github | IP定位WebAPI | Docker Hub
编程中文文档 | 网盘分享 | 中文Linux命令

手工配置GRUB2+iPXE引导netboot.xyz进行 Linux 远程重新安装系统

ipxe-small.png

netboot.xyz:基于iPXE的网络可引导操作系统安装
netboot.xyz 可以方便地引导到任何类型的操作系统或实用程序磁盘,而不需要花时间去检索 ISO 来运行它。
iPXE 是用来在 BIOS 内提供一个用户友好的菜单,让您可以轻松地选择您想要的操作系统,以及任何特定类型的版本或可引导标志。

如果你的系统支持EFI引导,可以看 云主机EFI_SHELL方式使用 netboot.xyz 远程重新安装系统

menu_graphic.png

如上图 netboot.xyz 引导能选择多种系统在线安装;下面来介绍怎么添加 netboot.xyz 引导

# 进入移动目录或者分区
cd /boot

# 下载 netboot.xyz 内核到 /boot 目录
wget https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn

修改 grub.cfg 能引导 netboot.xyz

# vim grub/grub.cfg
# 按键盘大写 G , 向上找到类似下面几行

echo    'Loading Linux 5.10.0-8-amd64 ...'
linux   /boot/vmlinuz-5.10.0-8-amd64 root=UUID=8e2fd8fe-3832-481b-9403-fa2cf303fb76 ro single
echo    'Loading initial ramdisk ...'
initrd  /boot/initrd.img-5.10.0-8-amd64


# 注释掉这行 initrd  /boot/initrd.img-5.10.0-8-amd64
# 添加一行
linux16 /boot/netboot.xyz.lkrn

如下面改好后,:wq! 强制保存退出

netboot.xyz.png

如图重启,VNC 方式选择 Recovery Mode ,就能引导带 netboot.xyz

上面方法使用替换 Recovery 菜单来方式来傻瓜模式配置 netboot.xyz

Install netboot.xyz.lkrn into grub

wget https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn -O /boot/netboot.xyz.lkrn
nano /etc/grub.d/40_custom
#/etc/grub.d/40_custom
menuentry "netboot.xyz.lkrn" {
    linux16 (hd0,msdos1)/netboot.xyz.lkrn # /boot is (hd0,msdos1) drive
}
#
# One of
grub2-mkconfig -o /boot/grub2/grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
reboot

使用 netboot.xyz 引导 除了用来安装系统用处,还可以用来帮助 DD windows

123.png

选择 Rescue Mode 配置好网络,选定好 系统root根,再进入Shell

mod.png

本原创文章自由转载,转载请注明本博来源及网址 | 当前页面:兰雅sRGB个人笔记 » 手工配置GRUB2+iPXE引导netboot.xyz进行 Linux 远程重新安装系统