我正在尝试创建一个自定义的 clonezilla 安装程序,作为从记忆棒刷新我们的标准机器的工具。
我可以从 syslinux/syslinux.cfg 中自定义开始菜单,但我希望大容量内存条也包含要恢复的映像。映像位于 /lib/live/mount/medium/myImage 中,可以从命令行中看到,但安装程序似乎想在 /home/partimag 上找到它
有没有办法修改 ocs-live-run="ocs-sr ... ”等以指向本地路径,而不必挂载 /home/partimag ?
提前致谢-我正在拔掉我的头发。
按照 Michael 的描述,脚本如下:
# mount the image where Clonezilla wants to find it
echo Mounting /lib/live/mount/medium/image on to /home/partimag/
mount --bind /lib/live/mount/medium/image /home/partimag/
RET=$?
if [ ${RET} -ne 0 ]
then
echo "FAILURE: Mount failed! Image missing?"
exit 2
fi
# now actually do the restore.
# -p true - exit with success
# -g auto - grub install in the right place
# -e* <whatever> - geometry
# -r – resize when restore done
# -j2 – clone hidden data
# -c – wait for confirm
# -p true – just exit
# -src – skip image check on restore
echo Now doing restore (disk)
ocs-sr -g auto -e1 auto -e2 -r -j2 -c -p true -scr restoredisk gen4image sda
#ocs-sr -g auto -e2 -c -r -j2 -k true restoreparts aks_user sda1
RET=$?
echo Returned $RET
if [ ${RET} -ne 0 ]
then
echo "FAILURE: Imaging failed! Bad image? Bad drive?"
exit 1
fi
答案1
我对自定义加载器执行的操作是在 syslinux/syslinux.cfg 中设置 ocs_live_run="/lib/live/mount/medium/MyScript.sh"
将 MyScript.sh 放到闪存驱动器的根目录上。
将您的图像放入闪存驱动器根目录下名为 Image 的目录中。
您的脚本应该绑定挂载图像目录,然后运行 clonezilla(来自我的一个自动加载脚本的片段):
# mount the image where Clonezilla wants to find it
mount --bind /lib/live/mount/medium/Image /home/partimag/
RET=$?
if [ ${RET} -ne 0 ]
then
echo "FAILURE: Mount failed! Image missing?"
exit 2
fi
# now actually do the restore.
# -p true - exit with success
# -g auto - grub install in the right place
# -e* <whatever> - geometry
# -r – resize when restore done
# -j2 – clone hidden data
# -c – wait for confirm
# -p true – just exit
# -src – skip image check on restore
ocs-sr -g auto -e1 auto -e2 -r -j2 -c -p true -scr restoredisk L06_05-A.14.14-img sda
RET=$?
if [ ${RET} -ne 0 ]
then
echo "FAILURE: Imaging failed! Bad image? Bad drive?"
exit 1
fi