menuentry 'System reboot' {
echo 'System rebooting...'
reboot
}
注意:很多地方看上去占了几行,其实是在一行上。
4.添加 SystemRescueCD 镜像文件:
将 systemrescuecd-x86-4.3.0.iso 复制到 U 盘根目录下。
将 syslinux 的 memdisk 文件复制到/grub2_boot/syslinux 下。
注:
(1)在使用 U 盘上的 GRUB 2 启动时,进入命令模式。用 ls 命令发现 U 盘是 hd0,电脑内部硬盘
是 hd1。
(2)获取分区的 UUID :
mount /dev/sda7 /mnt/custom
执行:grub2-probe --target=fs_uuid /mnt/custom/opensuse.iso 或 Gparted 中选中
分区,右键 Info 查看 UUID。
结果:1A3EFE68351760D7
(3)获取分区的 hints_string:
执行:grub2-probe --target=hints_string /mnt/custom/opensuse.iso
结果:--hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-
baremetal=ahci0,msdos7 --hint='hd0,msdos7'
由于上面第(1)点,最好改为:
--hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7
--hint='hd1,msdos7'
不修改也能正确找到安装程序,只要 UUID 是正确的。
(4) rescue32:32 位系统
rescue64:64 位系统
altker32:32 位备用系统
altker64:64 位备用系统
(5)使用 SYSLINUX 的 memdisk 文件,主要是为了将整个 SystemRescueCD 加载到内存中,
包括 Offline NT Password and Registry editor、FreeDos、MemTest+、Aida 等, 对应菜
单项:'SystemRescueCD ISO' 。
二、硬盘分区,安装准备
1.重启,在 BIOS 中选择从 U 盘启动,即可看到 GRUB 2 菜单。
选择进入 SystemRescueCd rescue64 的图形界面。
2.执行:gparted,进入图形界面分区。
使用 Gparted 分区结果:
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes