"Después del juego es antes del juego"
Sepp Herberger

viernes, 3 de mayo de 2024

Disco usb/pendrive autoarrancable con Clonezilla, otra vez.

Esta entrada complementa a esta otra del pasado. En esta ocasión haremos un pendrive/disco externo USB con clonezilla que tiene solo una partición con todo lo necesario y arrancará mediante Legacy usando syslinux.cfg. Pasos a seguir:
  • Formatea el dispositivo a FAT32 con gparted o manualmente.
  • Descarga el clonezilla.zip que mas te guste: https://clonezilla.org/downloads/download.php?branch=stable
  • Descomprime el ZIP dentro de la raiz del dispositivo (pista: la carpeta GPL debe quedar en la raíz)
  • Ejecutamos makeboot para hacer bootable el pendrive:
    cd util/linux
    bash makeboot.sh /deb/sdXX   # por ejemplo: sda1
  • Metemos en home/partimag las imágenes deseadas (cada una en un subdirectorio, como siempre)

Al fichero syslinux/syslinux.cfg añadimos la parte en negrita de lo siguiente:
# Created by generate-pxe-menu! Do NOT edit unless you know what you are doing! 
# Keep those comment "MENU DEFAULT" and "MENU HIDE"! Do NOT remove them.
# Note!!! If "serial" directive exists, it must be the first directive
default vesamenu.c32
timeout 300
prompt 0
noescape 1
MENU MARGIN 5
 MENU BACKGROUND ocswp.png
# Set the color for unselected menu item and timout message
 MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
 MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
 MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
 MENU COLOR HELP 7;32;41 #c0000090 #00000000

# MENU MASTER PASSWD

say **********************************************************************
say Clonezilla, the OpenSource Clone System.
say NCHC Free Software Labs, Taiwan.
say clonezilla.org, clonezilla.nchc.org.tw
say THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
say **********************************************************************

# Allow client to edit the parameters
ALLOWOPTIONS 1

# simple menu title
MENU TITLE clonezilla.org, clonezilla.nchc.org.tw

# Since no network setting in the squashfs image, therefore if ip=, the network is disabled. That's what we want.
label Clonezilla Live
  MENU DEFAULT
  # MENU HIDE
  MENU LABEL Clonezilla live
  # MENU PASSWD
  kernel /live/vmlinuz
  append initrd=/live/initrd.img boot=live union=overlay username=user config components quiet noswap edd=on nomodeset noeject locales=es_ES.UTF-8 keyboard-layouts=es 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
  TEXT HELP
  * Boot menu for BIOS machine
  * Clonezilla live version: 2.5.5-38-amd64. (C) 2003-2018, NCHC, Taiwan
  * Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

label Clonezilla Live Auto
  # MENU HIDE
  MENU LABEL Clonezilla live - Install xubuntu22 to sda1
  # MENU PASSWD
  kernel /live/vmlinuz
  append initrd=/live/initrd.img boot=live union=overlay username=user config components quiet noswap edd=on nomodeset noeject locales=es_ES.UTF-8 keyboard-layouts=es ocs_prerun="sudo ln -s /lib/live/mount/medium/home/partimag/* /home/partimag/" ocs_live_run="/usr/sbin/ocs-sr -g auto -e1 auto -e2 -c -r -icds -j2 -scr -p choose restoredisk xubuntu22-universal sda" 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  TEXT HELP
  * Boot menu for BIOS machine
  * Clonezilla live version: 2.5.5-38-amd64. (C) 2003-2018, NCHC, Taiwan
  * Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

# Since no network setting in the squashfs image, therefore if ip=, the network is disabled. That's what we want.
label Clonezilla Live SSH
  #MENU DEFAULT
  # MENU HIDE
  MENU LABEL Clonezilla live SSH 
  # MENU PASSWD
  kernel /live/vmlinuz
  append initrd=/live/initrd.img boot=live union=overlay username=user config components quiet noswap edd=on nomodeset noeject locales=es_ES.UTF-8 keyboard-layouts=es ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 ocsnet.ifnames=0  ocs_repository="ssh://root@172.19.X.Y/home/partimag/"  splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
  TEXT HELP
  * Boot menu for BIOS machine
  * Clonezilla live version: 2.5.5-38-amd64. (C) 2003-2018, NCHC, Taiwan
  * Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

MENU BEGIN Other modes of Clonezilla live

... Esta parte no la tocamos ...

MENU END
Lo añadido a la configuración estándar es:
  • La primera opción "Clonezilla live - Install xubuntu22 to sda1" arranca clonezilla y de forma automática restaura la imagen llamada xubuntu22-universal (el nombre del directorio en /home/partimag) sobre sda1.
  • La segunda opción "Clonezilla live SSH" arranca clonezilla, lo conecta a la red y monta /home/partimag por ssh sobre "ssh://root@172.19.X.Y/home/partimag", para que usemos las imágenes que allí haya.
Solo quedaría ajustarlo a nuestras circunstancias personales.

再见! Hasta la próxima.

No hay comentarios:

Publicar un comentario