【ipxe、clonezilla】iPXE启动Clonezilla实现镜像自动恢复及硬盘健康值检测探索

更多内容请点击 我的博客 查看,欢迎来访。

ipxe参数迭代

Ver1.0

#!ipxe

kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
imgargs vmlinuz boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/filesystem.squashfs username=user hostname=wily config quiet components noswap edd=on nomodeset nodmraid noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="mount -t cifs  -o user={
   { user_name }},password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-live-restore" ocs_live_extra_param="-g auto -scr -batch -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_batch=yes vga=788 ip= net.ifnames=0  splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
boot

Ver2.0

#!ipxe

kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
imgargs vmlinuz boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/filesystem.squashfs username=user hostname=wily config quiet components noswap edd=on nomodeset nodmraid noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="mount -t cifs  -o user={
   { user_name }},password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-live-restore" ocs_live_extra_param="-g auto -nogui -batch -r -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_batch=yes vga=788 ip= net.ifnames=0  splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
boot

探索

ocs_prerun3="mount -t cifs  -o user=imagman,password=pxe-svr //192.168.96.166/images  /home/partimag"

ocs_live_run="ocs-live-restore"

ocs_live_extra_param="-g auto -nogui -batch -r -p reboot restoredisk Vostro3900-GTX745-Win7 sda"

reboot --> choose

ocs_live_batch=yes  确认执行

-p 参数

poweroff
reboot
cmd
return1

Ver3.0

#!ipxe

kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
imgargs vmlinuz boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/filesystem.squashfs username=user hostname=wily config quiet components noswap edd=on nomodeset nodmraid noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="mount -t cifs  -o user={
   { user_name }},password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-live-restore" ocs_live_extra_param="-g auto -nogui -batch -r -o0 -o1 -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_batch=yes vga=788 ip= net.ifnames=0  splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
boot

Ver4.0(2017.07.03)

#!ipxe

kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
imgargs vmlinuz boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/lr.filesystem.squashfs username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="LC_ALL=C mount -t cifs  -o user={
   { user_name }},vers=2.1,password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -nogui -batch -r -j2 -o0 -o1 -scr -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_extra_param="" ocs_live_batch="yes" vga=791 ip= net.ifnames=0  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
boot

Ver5.0(2017.07.13,支持UEFI+Leagcy)

修改为支持UEFI加传统启动方式

#!ipxe
kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz initrd=initrd.img boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/lr.filesystem.squashfs username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="LC_ALL=C mount -t cifs  -o user={
   { user_name }},vers=2.1,password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -nogui -batch -r -j2 -o0 -o1 -scr -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_extra_param="" ocs_live_batch="yes" vga=791 ip= net.ifnames=0  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
boot

Ver6.0(安装前后脚本执行)

增加恢复前后访问服务器功能,修改 filesystem.squashfs 文件名
支持-o0-o1参数,即安装前后执行脚本

#!ipxe
kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz initrd=initrd.img boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/v1.web.filesystem.squashfs username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="LC_ALL=C mount -t cifs  -o user={
   { user_name }},vers=2.1,password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -nogui -batch -r -j2 -o0 -o1 -scr -p reboot restoredisk {
   { image_name }} {
   { disk_num }}" ocs_live_extra_param="" ocs_live_batch="yes" vga=791 ip= net.ifnames=0  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
boot

Ver7.0(自动选择硬盘)

自动选择硬盘增加,修改 filesystem.squashfs 文件名
使用ep-ocs-sr脚本代替ocs-sr脚本执行恢复

#!ipxe
kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz initrd=initrd.img boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/v2.autodisk.filesystem.squashfs username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1="dhclient -v eth0" ocs_prerun2="sleep 2" ocs_prerun3="LC_ALL=C mount -t cifs  -o user={
   { user_name }},vers=2.1,password={
   { user_password }} {
   { image_server_path }}  {
   { image_path }}" ocs_live_run="ep-ocs-sr -g auto -e1 auto -e2 -nogui -batch -r -j2 -o0 -o1 -scr -p reboot restoredisk {
   { image_name }}" ocs_live_extra_param="" ocs_live_batch="yes" vga=791 ip= net.ifnames=0  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
initrd {
   {
    http_svr }}/clonezilla/live/initrd.img
boot

Ver8.0(更新到新版Clonezilla参数)

Clonezilla版本升级到2.6.6
重新对 filesystem.squashfs 镜像进行修改:增加ep-ocs-srcheck_disk_health.sh脚本
增加-icds-ps等参数

#!ipxe
kernel {
   {
    http_svr }}/clonezilla/live/vmlinuz initrd=initrd.img boot=live union=overlay fetch={
   {
    http_svr }}/clonezilla/live/v2.autodisk.filesystem.squashfs username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun1=
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值