Utiliser image .iso créée par Clonezilla pour instal autom

Bonjour,

est ce que l’on peut créer une image .iso avec Clonezilla d’un systeme Debian installé puis utiliser ce .iso pour installer automatiquement le systeme Debian ainsi “cloné” sur des machines remote avec PXE?

Merci

bonsoir.

ce ne serait pas clonezilla serveur qui pourrait répondre à votre question?J’ai pas creusé mais renseignez vous sur le site de clonezilla.

une réponse que j’ai donné dans un autre sujet de conversation :

Bonjour
pour faire la sauvegarde clonezilla j’utilise le boot PXE ensuite avec des scripts pour automatiser, par exemple j’ai 180 machines identiques toutes avec la même image, je boot en LAN puis dans mon menue (PXE) je choisi l’action par exemple restaurer disque entier et là tout se fait tout seul.

menu de mon PXE

[code]MENU TITLE CLONEZILLA

MENU SEPARATOR

LABEL clonezilla Live
MENU LABEL Clonezilla LIVE
TEXT HELP
Clonezilla LIVE Standard
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=“ocs-live-general” ocs_live_extra_param="" keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs

LABEL clonezilla live point de montage serveur
MENU LABEL Clonezilla LIVE monte sur serveur
TEXT HELP
point de montage /192.168.1.1/2To_NoRaid/clz/Live
dans le menu choix de montage clonezilla choisir skip
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=“ocs-live-general” ocs_live_extra_param="" ocs_prerun1=“dhclient -v eth0” ocs_prerun2=“sleep 2” ocs_prerun3=“mount -t cifs -o user=isguest,password=npwd //192.168.1.1/2To_NoRaid/clz/Live /home/partimag” ocs_prerun4=“sleep 2” keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs

MENU SEPARATOR
LABEL barre
MENU LABEL ---------------------RESTORE----------------------------
MENU SEPARATOR

LABEL clonezilla RESTORE auto partition C (TOSH)
MENU LABEL clonezilla RESTORE auto partition C (TOSH)
TEXT HELP
Restaure depuis //192.168.1.1/2To_NoRaid/clz/last_tosh_c
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_live_run=“ocs-sr -b -e1 auto -e2 -r -j2 -k -p reboot restoreparts last_tosh_c sda1” ocs_live_extra_param="" ocs_prerun1=“dhclient -v eth0” ocs_prerun2=“sleep 2” ocs_prerun3=“mount -t cifs -o user=isguest,password=npwd //192.168.1.1/2To_NoRaid/clz /home/partimag” ocs_prerun4=“sleep 2” keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs ethdevice-timeout=30

LABEL clonezilla RESTORE auto DISQUE COMPLET (TOSH 320go)
MENU LABEL clonezilla RESTORE auto DISQUE COMPLET (TOSH 320go)
TEXT HELP
Restaure depuis //192.168.1.1/2To_NoRaid/clz/last_tosh_full
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_live_run=“ocs-sr -b -g auto -e1 auto -e2 -r -j2 -p reboot restoredisk last_tosh_full sda” ocs_live_extra_param="" ocs_prerun1=“dhclient -v eth0” ocs_prerun2=“sleep 2” ocs_prerun3=“mount -t cifs -o user=isguest,password=npwd //192.168.1.1/2To_NoRaid/clz /home/partimag” ocs_prerun4=“sleep 2” keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs ethdevice-timeout=30

MENU SEPARATOR
LABEL barre
MENU LABEL ----------------------SAVE------------------------------
MENU SEPARATOR

LABEL clonezilla SAVE auto partition C (TOSH)
MENU LABEL clonezilla SAVE auto partition C (TOSH)
TEXT HELP
Sauve dans //192.168.1.1/2To_NoRaid/clz/last_tosh_c
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_live_run=“ocs-sr -q2 -j2 -z1p -p choose saveparts last_tosh_c sda1” ocs_live_extra_param="" ocs_prerun1=“dhclient -v eth0” ocs_prerun2=“mount -t cifs -o user=isguest,password=npwd //192.168.1.1/2To_NoRaid/clz /home/partimag” ocs_prerun3=“chmod 777 /home/partimag/choix.sh” ocs_prerun4="/home/partimag/choix.sh" keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs

LABEL clonezilla SAVE auto DISQUE COMPLET (TOSH 320go)
MENU LABEL clonezilla SAVE auto DISQUE COMPLET (TOSH 320go)
TEXT HELP
Sauve dans //192.168.1.1/2To_NoRaid/clz/last_tosh_full
ENDTEXT
KERNEL imgs/clz/vmlinuz
APPEND initrd=imgs/clz/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_live_run=“ocs-sr -q2 -j2 -z1p -p choose savedisk last_tosh_full sda” ocs_live_extra_param="" ocs_prerun1=“dhclient -v eth0” ocs_prerun2=“mount -t cifs -o user=isguest,password=npwd //192.168.1.1/2To_NoRaid/clz /home/partimag” ocs_prerun3=“chmod 777 /home/partimag/choix.sh” ocs_prerun4="/home/partimag/choix.sh" keyboard-layouts=fr locales=fr_FR.UTF-8 ocs_live_batch=“no” vga=788 nosplash fetch=tftp://192.168.1.1/imgs/clz/filesystem.squashfs

MENU SEPARATOR

LABEL Retour Menu
MENU LABEL <- Retour Menu
KERNEL vesamenu.c32
APPEND menuconf/design.conf ~
[/code]

les options du script clonezilla

Setting the TERM as linux /opt/drbl/sbin/ocs-sr: -h: invalid option Usage: To save or restore image ocs-sr [OPTION] {savedisk|saveparts|restoredisk|restoreparts} IMAGE_NAME DEVICE Options for saving: -fsck-src-part, --fsck-src-part Run fsck interactively on the source file system before saving it. -fsck-src-part-y, --fsck-src-part-y Run fsck automatically on the source file system before saving it. This option will always attempt to fix any detected filesystem corruption automatically. //NOTE// Use this option in caution. -gm, --gen-md5sum Generate the MD5 checksum for the image. Later you can use -cm|--check-md5sum option to check the image when restoring the image. Note! It might take a lot of time to generate if the image size is large. -gs, --gen-sha1sum Generate the SHA1 checksum for the image. Later you can use -cs|--check-sha1sum option to check the image when restoring the image. Note! It might take a lot of time to generate if the image size is large. -j2, --clone-hidden-data Use dd to clone the image of the data between MBR (1st sector, i.e. 512 bytes) and 1st partition, which might be useful for some recovery tool. -ntfs-ok, --ntfs-ok Assume the NTFS integrity is OK, do NOT check again (for ntfsclone only) -rm-win-swap-hib, --rm-win-swap-hib Try to remove the MS windows swap file in the source partition. -q, --use-ntfsclone If the partition to be saved is NTFS, use program ntfsclone instead of partimage (i.e. Priority: ntfsclone > partimage > dd) -q1, --force-to-use-dd Force to use dd to save partition(s) (inefficient method, very slow, but works for all the file system). -q2, --use-partclone Use partclone to save partition(s) (i.e. partclone > partimage > dd). -rescue, --rescue Turn on rescue mode, i.e. try to skip bad sectors. -sc, --skip-check-restorable By default Clonezilla will check the image if restorable after it is created. This option allows you to skip that. -z0, --no-compress Don't compress when saving: very fast but very big image file (NOT compatible with multicast restoring!!!) -z1, --gzip-compress Compress using gzip when saving: fast and small image file (default) -z1p, --smp-gzip-compress Compress using parallel gzip program (pigz) when saving: fast and small image file, good for multi-core or multi-CPU machine -z2, --bz2-compress Compress using bzip2 when saving: slow but smallest image file -z2p, --smp-bzip2-compress Compress using parallel bzip2 program (pbzip2) when saving: faster and smallest image file, good for multi-core or multi-CPU machine -z3, --lzo-compress Compress using lzop when saving: similar to the size by gzip, but faster than gzip. -z4, --lzma-compress Compress using lzma when saving: slow but smallest image file, faster decompression than bzip2. -z5, --xz-compress Compress using xz when saving: slow but smallest image file, faster decompression than bzip2. -z5p, --smp-xz-compress Compress using parallel xz when saving: slow but smallest image file, faster decompression than bzip2. -z6, --lzip-compress Compress using lzip when saving: slow but smallest image file, faster decompression than bzip2. -z6p, --smp-lzip-compress Compress using parallel lzip when saving: slow but smallest image file, faster decompression than bzip2. -z7, --lrzip-compress Compress using lrzip when saving. -i, --image-size SIZE Set the split image file volume size SIZE (MB). When ocs-sr is run with -x, the default SIZE is set as 2000, if without -x, we will not split it. Three words are reserved for IMAGE_NAME, "ask_user" is used to let user to input a name when saving an image. "autoname" is used to automatically generate the image name based on network card MAC address and time. "autohostname" is used to automatically generate the image name based on hostname. A word is reserved for DEVICE, "ask_user" could be used to let user to select the source device when saving an image. Options for restoring: -g, --grub-install GRUB_PARTITION Install grub in the MBR of the disk containing partition GRUB_PARTITION with root grub directory in the same GRUB_PARTITION when restoration finishs, GRUB_PARTITION can be one of "/dev/hda1", "/dev/hda2"... or "auto" ("auto" will let clonezilla detect the grub root partition automatically). If "auto" is assigned, it will work if grub partition and root partition are not in the same partition. -r, --resize-partition Resize the partition when restoration finishes, this will try to fix the problem when small partition image is restored to larger partition. Warning!!! Use this carefully... Backup your data first -k, --no-fdisk, --no-create-partition Do NOT create partition in target harddisk. If this option is set, you must make sure there is an existing partition table in the current restored harddisk. Default is to create the partition table. -icrc, --icrc Skip Partclone CRC checking. -irhr, --irhr Skip removing the Linux udev hardware records on the restored GNU/Linux. -ius, --ius Skip updating syslinux-related files on the restored GNU/Linux. -icds, --ignore-chk-dsk-size-pt Skip checking destination disk size before creating the partition table on it. By default it will be checked and if the size is smaller than the source disk, quit. -k1, Create partition table in the target disk proportionally. -k2, Enter command line prompt to create partition table manually before restoring image. -t, --no-restore-mbr Do NOT restore the MBR (Mater Boot Record) when restoring image. If this option is set, you must make sure there is an existing MBR in the current restored harddisk. Default is Yes -u, --select-img-in-client Input the image name in clients -e, --load-geometry Force to use the saved CHS (cylinders, heads, sectors) when using sfdisk -e1, --change-geometry NTFS-BOOT-PARTITION Force to change the CHS (cylinders, heads, sectors) value of NTFS boot partitoin after image is restored. NTFS-BOOT-PARTITION can be one of "/dev/hda1", "/dev/hda2"... or "auto" ("auto" will let clonezilla detect the NTFS boot partition automatically) -e2, --load-geometry-from-edd Force to use the CHS (cylinders, heads, sectors) from EDD (Enhanced Disk Device) when creating partition table by sfdisk -y, -y0, --always-restore, --always-restore-default-local Let Clonezilla server as restore server, i.e. client will always has restore mode to choose (However default mode in PXE menu is local boot) -y1, --always-restore-default-clone Let Clonezilla server as restore server, i.e. client will always has restore mode to choose (The default mode in PXE menu is clone, so if client boots, it will enter clone always, i.e. clone forever) -j, --create-part-by-sfdisk Use sfdisk to create partition table instead of using dd to dump the partition table from saved image (This is default) -j0, --create-part-by-dd Use dd to dump the partition table from saved image instead of sfdisk. ///Note/// This does NOT work when logical drives exist. -j1, --dump-mbr-in-the-end Use dd to dump the MBR (total 512 bytes, i.e. 446 bytes (executable code area) + 64 bytes (table of primary partitions) + 2 bytes (MBR signature; # 0xAA55) = 512 bytes) after disk image was restored. This is an insurance for some hard drive has different numbers of cylinder, head and sector between image was saved and restored. -j2, --clone-hidden-data Use dd to clone the image of the data between MBR (1st sector, i.e. 512 bytes) and 1st partition, which might be useful for some recovery tool. -hn0 PREFIX Change the hostname of M$ Windows based on the combination of hostname prefix and IP address, i.e. PREFIX-IP -hn1 PREFIX Change the hostname of M$ Windows based on the combination of hostname prefix and NIC MAC address, i.e. PREFIX-MAC --max-time-to-wait TIME When not enough clients have connected (but at least one), start anyways when TIME seconds since first client connection have pased. This option is used with --clients-to-wait -cm, --check-md5sum Check the MD5 checksum for the image. To use this option, you must enable -gm|--gen-md5sum option when the image is saved. Note! It might take a lot of time to check if the image size is large. -cs, --check-sha1sum Check the SHA1 checksum for the image. To use this option, you must enable -gs|--gen-sha1sum option when the image is saved. Note! It might take a lot of time to check if the image size is large. --mcast-port NO Assign the udp port number for multicast restore. This is used by clonezilla server. Normally it's not necessary to manually assign this option. A word is reserved for IMAGE_NAME, "ask_user" is used to let user to input a name when saving an image. A word is reserved for DEVICE, "ask_user" could be used to let user to select the source device when saving an image. General options: -l, --language INDEX Set the language to be shown by index number: [0|en_US.UTF-8]: English, [1|zh_TW.BIG5]: Traditional Chinese (Big5) - Taiwan, [2|zh_TW.UTF-8]: Traditional Chinese (UTF-8, Unicode) - Taiwan [a|ask]: Prompt to ask the language index -b, -batch, --batch (DANGEROUS!) Run program in batch mode, i.e. without any prompt or wait for pressing enter key. //NOTE// You have to use '-batch' instead of '-b' when you want to use it in the boot parameters. Otherwise the program init on system will honor '-b', too. -c, --confirm Wait for confirmation before saving or restoring -d, --debug-mode Enter command mode to debug before saving/restoring --debug=LEVEL Output the partimage debug log in directory /var/log/ with debug LEVEL (0,1,2... default=0) -m, --module MODULE Force to load kernel module MODULE, this is useful when some SCSI device is not detected. NOTE! Use only one module, more than one may cause parsing problem. -o0, --run-prerun-dir Run the script in the direcoty /opt/drbl/share/ocs/postrun before clone is started. The command will be run before MBR is created or saved. -o1, -o, --run-postrun-dir Run the script in the direcoty /opt/drbl/share/ocs/postrun when clone is finished. The command will be run before that assigned in -p or --postaction. -w, --wait-time TIME Wait for TIME secs before saving/restoring --nogui Do not show GUI of partimage, use text only -a, --no-force-dma-on Do not force to turn on HD DMA -mp, --mount-point MOUNT_POINT Use NFS to mount MOUNT_POINT as directory ocsroot (ocsroot is assigned in drbl.conf) -or, --ocsroot DIR Specify DIR (absolute path) as directory ocsroot (i.e. overwrite the ocsroot assigned in drbl.conf) -p, --postaction [choose|poweroff|reboot|command|CMD] When save/restoration finishs, choose action in the client, poweroff, reboot (default), in command prompt or run CMD -ns, --ntfs-progress-in-image-dir Save the ntfsclone progress tmp file in the image dir so that if cloning is in DRBL client, the progress can be check in the server (Default in to be put in local /tmp/, which is local tmpfs). -um, --user-mode [beginner|expert] Specify the mode to use. If not specified, default mode is for a beginner. -v, --verbose Prints verbose information -d0, --dialog Use dialog -d1, --Xdialog Use Xdialog -d2, --whiptail Use whiptail -d3, --gdialog Use gdialog -d4, --kdialog Use kdialog -x, --interactive Interactive mode to save or restore. Example: To save or restore image in client (Only that DRBL client will join, and its local partitions is NOT mounted). NOTE!!! You should run the command in DRBL client or you have to make sure the target device is NOT busy!. To save all the data in local first IDE harddrive 'hda' as image 'IMAGE1', use ntfsclone instead of partimage, and lzop compression (NOTE!!! You should run the command in DRBL client or make sure hda is NOT busy/mounted!): ocs-sr --use-ntfsclone -z3 savedisk IMAGE1 hda To save the data in first and second partitions in local first IDE harddrive 'hda' as image 'IMAGE2', use ntfsclone instead of partimage, and lzop compression (NOTE!!! You should run the command in DRBL client, or make sure hda is NOT busy/mounted!): ocs-sr --use-ntfsclone -z3 saveparts IMAGE2 "hda1 hda2" To restore image IMAGE1 to local hda. grub-install will be run after cloning (image IMAGE1 is already in DRBL server. NOTE!!! You should run the command in DRBL client or make sure hda is NOT busy/mounted!): ocs-sr -g auto restoredisk IMAGE1 hda To restore image first and second partitions from IMAGE2 to local hda1 and hda2. grub-install will be run after cloning (image IMAGE2 is already in DRBL server. NOTE!!! You should run the command in DRBL client or make sure hda is NOT busy/mounted!): ocs-sr -g auto restoreparts IMAGE2 "hda1 hda2" To save disk(s)/partitition(s) as an image or restore an image to disk(s)/partitition(s) interactively, use: ocs-sr -x

intéressant sinozis, mais ça ne répond pas à la question: est ce qu’on peut cloner une debian opérationnelle.
Sur le principe, je dirais oui, mais elles auront toutes le même mot de passe root, et le même utilisateur non privilégié.
*évidement, pas question d’utiliser une IP fixe sur la machine clonée.

Amha le format de sortie .iso n’a aucun intérêt…il suffit de demander la restauration du disque ou de la partition depuis son format natif (.img de mémoire)
Clonezilla server ne sert que pour automatiser le déploiement en évitant de passer les machines une à une.
Etre bien sur que les machines sont bien toutes le mêmes car souvent les fabricants utilisent des variantes notamment sur les cartes ethernet.

Oui le mot de passe root est le même mais je ne vois pas le problème, mes clones sont des windows XP j’ai fait plusieurs script de premier lancement, par exemple j’ai une petite bdd qui regroupe les num de série de la carte mère et le hostname et un batch qui s’occupe de mettre automatiquement le bon nom
On peut aussi lancer des scripts avec clonezilla sur la machine hôte
Exemple dans mon fichier,le script à lancer avant l’execution du script clonezilla:

il y a l’option ocs_postrun pour lancer le script après le script clonezilla

Autre inconvénient de la méthode iso : les mises à jour. Ton iso va rapidement se retrouver dépassé, et dés le premier lancement, tu va devoir faire une grosse mise à jour.
un dépot debian local, et une netinstall automatisée me semble plus judicieux. La machine est ainsi opérationnelle dés la fin de l’install, tout est à jour. Et parfaitement adaptée au matériel sur un parc pas toujours homogéne.
Si maintenant, tes clones sont des machines “jetables”, qui nécessitent une réinstall from scratch tout les 2 jours, l’iso est plus approprié.

Il parle de d’installation via pxe je vois le gain de temps depuis que j’ai tout automatiser dans ce cas la l’usage de clonezilla est pertinent, il peut tres bien installer une debian 8 via clonezilla avec des softs et des configs bien spécifique à son infrastructure et ensuite faire des updates en auto (depot local) pour le premier lancement.
Si son parc machine est homogène pourquoi pas.
Il n’a pas détaillé son infrastructure ni ses besoins. Si c’est pour faire quelques PC pour des personnes les plus simple (ce que je faisais) apres l’installation de debian un gros script bash avec des aptitude a tout va et des modifications de fichier conf.

hello,

j’ai 1 machine de reference A installée en Debian 8.1 avec des personnalisations et des updates.
J’ai 100 machines strictement identiques et vierges.
J’ai un server B installé en Debain 8.1
je fais une image de A avec clonezilla.
je depose cette image sur le server B
je veux installer via PXE cette image sur les 100 machines A

voila, c’est tout

il me semble qu’il suffit de dire au client A qui se connecte en PXE où prendre l’image et l’installer
mais bon…!