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
}
相关推荐
啊吧怪不啊吧20 分钟前
UU远程协助迎来升级!第一期更新实测
运维·服务器·远程工作
C_心欲无痕6 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6006 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston7 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20188 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟8 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston8 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式8 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode8 小时前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务8 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php