我想为所有正在寻找自动 Clonezilla 恢复选项的人提供一个简短的教程。
/dev/sdb1
和图像存储库 /dev/sdb2/images
都位于同一个 USB 记忆棒上/dev/sda
在您的 Clonezilla USB 记忆棒中使用文本编辑器打开
/boot/grub/grub.cfg
。在以下文本Since no network setting in the squashfs image, therefore if ip=, the network is disabled.
后添加以下内容,使其成为第一个 Clonezilla 默认条目:
menuentry "Flysoft RESTORE" {
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 noprompt ocs_prerun="mount /dev/sdb2 /mnt" ocs_prerun1="mount --bind /mnt/images /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k -scr -batch -p reboot restoredisk ask_user sda" keyboard-layouts="de" ocs_live_batch="yes" locales=de_DE.UTF-8 vga=788 ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
ocs_prerun="mount /dev/sdb2 /mnt" ocs_prerun1="mount --bind /mnt/images /home/partimag/"
安装 /dev/sdb2/images
作为图像存储库
ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k -scr -batch -p reboot restoredisk ask_user sda"
将图像恢复为 /dev/sda
并重新启动
#
set pref=/boot/grub
set default="0"
# Load graphics (only corresponding ones will be found)
# (U)EFI
insmod efi_gop
insmod efi_uga
# legacy BIOS
# insmod vbe
if loadfont $pref/unicode.pf2; then
set gfxmode=auto
insmod gfxterm
terminal_output gfxterm
fi
set timeout="30"
set hidden_timeout_quiet=false
insmod png
if background_image $pref/ocswp-grub2.png; then
set color_normal=black/black
set color_highlight=magenta/black
else
set color_normal=cyan/blue
set color_highlight=white/blue
fi
# Uncomment the following for serial console
# The command serial initializes the serial unit 0 with the speed 38400bps.
# The serial unit 0 is usually called ‘COM1’. If COM2, use ‘--unit=1’ instead.
#serial --unit=0 --speed=38400
#terminal_input serial
#terminal_output serial
# Decide if the commands: linux/initrd (default) or linuxefi/initrdefi
set linux_cmd=linux
set initrd_cmd=initrd
export linux_cmd initrd_cmd
if [ "${grub_platform}" = "efi" -a -e "/amd64-release.txt" ]; then
# Only amd64 release we switch to linuxefi/initrdefi since it works better with security boot (shim)
set linux_cmd=linuxefi
set initrd_cmd=initrdefi
fi
insmod play
play 960 440 1 0 4 440 1
# Since no network setting in the squashfs image, therefore if ip=, the network is disabled.
menuentry "Flysoft RESTORE" {
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 noprompt ocs_prerun="mount /dev/sdb2 /mnt" ocs_prerun1="mount --bind /mnt/images /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k -scr -batch -p reboot restoredisk ask_user sda" keyboard-layouts="de" ocs_live_batch="yes" locales=de_DE.UTF-8 vga=788 ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
menuentry "Clonezilla live (Default settings, VGA 800x600)" --id live-default {
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
submenu 'Other modes of Clonezilla live' {
menuentry "Clonezilla live (Default settings, VGA 1024x768)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=791 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
menuentry "Clonezilla live (Default settings, VGA 640x480)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=785 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
menuentry --hotkey=K "Clonezilla live (Default settings, KMS)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=791 ip= net.ifnames=0 splash
$initrd_cmd /live/initrd.img
}
menuentry --hotkey=R "Clonezilla live (To RAM, boot media can be removed later)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
menuentry "Clonezilla live Safe graphic settings (vga=normal)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" ip= net.ifnames=0 nomodeset vga=normal nosplash
$initrd_cmd /live/initrd.img
}
menuentry "Clonezilla live (Failsafe mode)"{
search --set -f /live/vmlinuz
$linux_cmd /live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" acpi=off irqpoll noapic noapm nodma nomce nolapic nosmp ip= net.ifnames=0 nomodeset vga=normal nosplash
$initrd_cmd /live/initrd.img
}
}
menuentry "Local operating system (if available)" --id local-disk {
echo "Booting first local disk..."
# Generate boot menu automatically
configfile /boot/grub/boot-local-efi.cfg
# If not chainloaded, definitely no uEFI boot loader was found.
echo "No uEFI boot loader was found!"
sleep 15
}
#menuentry "memtest"{
# search --set -f /live/memtest
# linux16 /live/memtest
#}
#menuentry "FreeDOS"{
# linux16 memdisk
# initrd /live/freedos.img
#}
menuentry "Network boot via iPXE" {
search --no-floppy --set=root -f /live/ipxe.efi
chainloader /live/ipxe.efi + 1
}
menuentry 'uEFI firmware setup' 'uefi-firmware' {
echo "Entering uEFI firmware setup..."
fwsetup
}
menuentry "Clonezilla live 2.7.0-10-amd64 info"{
echo Clonezilla, the OpenSource Clone System.
echo NCHC Free Software Labs, Taiwan.
echo clonezilla.org, clonezilla.nchc.org.tw
echo \* Boot menu for EFI machine
echo \* Clonezilla live version: 2.7.0-10-amd64. (C) 2003-2020, NCHC, Taiwan
echo \* Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
sleep --verbose --interruptible 10
}
首先 - 非常感谢您的这篇文章。内容相当丰富。我为那些想要稍微不同的人提供一两个调整。
我使用 CloneZilla zip 文件制作了只有一个分区的 USB 记忆棒。我按照他们的说明使用 makeboot.bat (非常小心)使其可启动。我的想法是创建一个“让它像我卖给你这台电脑的那一天一样”启动棒,只会要求用户说“是”几次。我正在用 Mint/Cinnamon 制作几台旧笔记本电脑,并在网上销售,并觉得需要附带救援磁盘。
我最终将图像放入 USB 记忆棒的 /home/partimag 目录中,认为我可能会丢失您的
ocs_prerun
条目。几根白发之后,我会这样做以使其找到图像:
ocs_prerun="mount --bind /run/live/medium/home/partimag /home/partimag"
加入
quiet loglevel=0 noswap
(loglevel=0 可以阻止大量你不关心的 WiFi 错误。
无需
ocs_prerun1
条目。当然,我的 ocs_live_run
线有点不同,因为我使用了 CloneZilla 给我的东西,按照我想要的方式。
再次感谢, 麦奇
感谢您的提示(尽管:通过 StackOverflow 问题写博客的方式很奇怪 - 但它有效!)
这些额外的提示可能对其他人有帮助:
/images/
子目录内),那么您可以跳过 2 ocs_prerun
/ocs_prerun1
部分以及绑定安装并且只有 ocs_prerun="mount /dev/sdb2 /home/partimag/"
mmcblk0
,而不是 sda
。nvme0n1
/dev/sda
”的东西),那么您的源驱动器 可能 是 /dev/sda
,因此您的源映像分区是 可能 /dev/sda2
有没有办法让这与 ventoy 一起工作,我用不同的方式编辑了菜单,但最后我总是启动失败这个系统映像无法启动。
我尝试了https://www.ventoy.net/en/plugin_grubmenu.html和$vtoy_iso_part