Disk-Image

來自單個 U 盤/筆的 Clonezilla

  • March 23, 2022

我正在嘗試創建一個自定義的 clonezilla 安裝程序,作為從記憶棒刷新我們的標準機器的工具。

我可以從 syslinux/syslinux.cfg 自定義開始菜單就好了,但我希望大記憶棒也包含要恢復的圖像。該圖像在 /lib/live/mount/medium/myImage 中,可以從命令行中看到,但安裝程序似乎想在 /home/partimag 上找到它

有沒有辦法修改 ocs-live-run=“ocs-sr …” 等以指向本地路徑,而不必掛載 /home/partimag ?

在此先感謝-我正在拔頭髮。

如下邁克爾的腳本:

# 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

我為自定義載入程序執行此操作的方式是在 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

引用自:https://serverfault.com/questions/943666