grub引导LinuxMint

注意事项:文件系统必须是FAT32

安装 sudo apt install gparted -y 分区管理软件

使用gparted分区和查看设备路径

bash 复制代码
sudo apt-get install grub-efi-amd64
#/dev/sdd1 是需要制作分区引导的设备路径
sudo mount /dev/sdd1 /mnt/123
#bios
sudo grub-install --target=i386-pc \
--boot-directory=/mnt/123/boot --recheck /dev/sdd
#efi
sudo grub-install --target=x86_64-efi \
--efi-directory=/mnt/123 --boot-directory=/mnt/123/boot \
--removable --recheck

boot/grub 路径创建 grub.cfg 文件内容如下

bash 复制代码
set timeout=2
set default=0
set is_preload=false
set fallback=1
set color_normal=white/black
set color_highlight=black/light-gray
export color_normal color_highlight;
#----------------------
#加载文件系统支持
insmod part_gpt
insmod part_msdos
insmod fat
insmod ntfs
insmod ext2
insmod exfat
insmod btrfs
insmod gfxterm
insmod png
insmod all_video
insmod iso9660
insmod udf
#------------------------
#设置显示模式
insmod font
if loadfont ${prefix}/Fonts/unicode.pf2; then
	set gfxmode=auto
	export gfxmode
	insmod efi_gop
	insmod efi_uga
	insmod all_video
	insmod video_bochs
	insmod video_cirrus
	insmod font
	insmod gfxterm
	insmod gfxmenu
	insmod gettext
	insmod jpeg
	insmod png
	if terminal_output gfxterm; then
		
		set locale_dir=/boot/grub/Locale/
		set lang=zh_CN
		export lang
	fi
fi
#------------------------
#设置背景图片 boot/gurb/image
terminal_output  gfxterm
background_image $prefix/image/TETER.png
#------------------------
#启动镜像
menuentry "Mint 21.2 镜像系统" --class gnu-linux --class gnu --class os {
  echo ""
  echo "正在启动 Mint 21.2 镜像系统......"
  set isofile=/pe/LinuxMint21.2/VM17-Mint-21.3-DOCKER-SMB.iso
  search --file --no-floppy --set=root $isofile
  loopback loop $isofile
  linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile
  locales=zh_CN.UTF-8
  initrd (loop)/casper/initrd.lz
}
相关推荐
laocui11 分钟前
Ubuntu22.04开机运行程序
linux·运维·服务器
遇见火星13 分钟前
Linux 防火墙 firewalld 实战配置教程!
linux·防火墙·firewalld
卡戎-caryon17 分钟前
【Linux网络与网络编程】12.NAT技术&&内网穿透&&代理服务
linux·运维·服务器·网络·网络协议·https
我的老子姓彭18 分钟前
LWIP的Socket接口
运维·服务器·网络
朱包林20 分钟前
day10-别名-MD5,aide-堡垒机
linux·运维·安全·ubuntu·centos·云计算
好吃的肘子29 分钟前
Zookeeper 入门(二)
linux·分布式·zookeeper
Javis2111 小时前
【Linux高级全栈开发】2.1.3 http服务器的实现
linux·服务器·http
GoWjw1 小时前
Linux虚拟文件系统(1)
运维·服务器·数据库
SunTecTec1 小时前
Linux grep -r 查找依赖包是否存在依赖类 Class
linux·运维·服务器
Johny_Zhao2 小时前
AI+自动化测试系统方案:网络设备与网络应用智能测试
linux·网络·人工智能·python·网络安全·docker·ai·信息安全·云计算·ansible·shell·cisco·huawei·系统运维·itsm·华三·deepseek