Clonezilla: Difference between revisions

From Leo's Notes
This page was last edited on 1 September 2017, at 18:17.
Line 38: Line 38:


== Automated Imaging ==
== Automated Imaging ==
To automatically reimage a computer on boot (either via PXE or USB), create a boot entry in {{code|isolinux.cfg}} that contains the restore (or imaging) command specified by the {{code|ocs_live_run}} parameter.
To automatically reimage a computer on boot (either via PXE or USB), create a boot entry in {{code|syslinux/syslinux.cfg}} that contains the restore (or imaging) command specified by the {{code|ocs_live_run}} parameter.


For example, to restore an image located on the root of the USB drive at {{code|/partimag/display-v1.1}} automatically:
For example, to restore an image located on the root of the USB drive at {{code|/partimag/display-v1.1}} automatically:

Revision as of 18:17, 1 September 2017

Clonezilla is a disk imaging distro.

USB Setup

For other ways to set up a clonezilla USB drive, see http://clonezilla.org/liveusb.php.

To set up a USB key with Clonezilla manually:

Partition a USB stick so it looks something like this. Set the type to 'b' and make it bootable with 'a'.

# fdisk /dev/sdg
Command (m for help): p
Disk /dev/sdg: 28.9 GiB, 31004295168 bytes, 60555264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x10cfca7b

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdg1  *     2048 60555263 60553216 28.9G  b W95 FAT32

## Format the drive
# mkfs.vfat -F 32 /dev/sdg1

Download the clonezilla zip archive, then extract it to the USB drive.

# wget http://gigenet.dl.osdn.jp/clonezilla/68244/clonezilla-live-20170829-zesty-i386.zip
# mount /dev/sdg1 /mnt/usb
# cd /mnt/usb
# tar -xzf ~/clonzilla*zip
## Install the MBR using the built in script
# cd /mnt/usb/utils/linux
# bash makeboot.sh /dev/sdg1

Automated Imaging

To automatically reimage a computer on boot (either via PXE or USB), create a boot entry in syslinux/syslinux.cfg that contains the restore (or imaging) command specified by the ocs_live_run parameter.

For example, to restore an image located on the root of the USB drive at /partimag/display-v1.1 automatically:

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

# Automatic Restore for display-v1.1
label Clonezilla restore display
  # MENU HIDE
  MENU LABEL Clonezilla Restore Display v1.1
  # MENU PASSWD
  kernel /live/vmlinuz
  append initrd=/live/initrd.img boot=live union=overlay username=user hostname=zesty config  components noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -icds -j2 -p reboot restoredisk ../../lib/live/mount/medium/partimag/display-v1.1 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
  Automatically images from USB for the TTuff 1U computer
  ENDTEXT

label Clonezilla live
...