Clonezilla: Difference between revisions
No edit summary |
|||
| Line 36: | Line 36: | ||
# bash makeboot.sh /dev/sdg1 | # bash makeboot.sh /dev/sdg1 | ||
}} | }} | ||
== Network Boot / NFS == | |||
Clonezilla can be booted via PXE over NFS. First, download the Clonezilla zip package and extract it to a directory that is exported via NFS. Then, add the following menu entry to the {{code|pxelinux.cfg}} menu: | |||
{{highlight|lang=text|code= | |||
LABEL ClonezillaAlt | |||
MENU LABEL ClonezillaAlt | |||
kernel boot/clonezilla | |||
append initrd=boot/clonezilla.img nfsroot=X.X.X.X:/data/pxe/clonezilla-alt union=aufs netboot=nfs ocs_live_keymap boot=live vga=788 noswap ocs_live_batch=no ocs_live_extra_param ocs_lang ocs_live_run=ocs-live-general live-config hostname=ClonezillaAlt domain=local.lan suite=generic26 | |||
IPAPPEND 2 | |||
}} | |||
Replace {{code|X.X.X.X}} with the NFS server hostname/IP address and ensure that the NFS path leads to the zip contents. | |||
== Automated Imaging == | == Automated Imaging == | ||
Revision as of 22:10, 29 November 2018
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
Network Boot / NFS
Clonezilla can be booted via PXE over NFS. First, download the Clonezilla zip package and extract it to a directory that is exported via NFS. Then, add the following menu entry to the pxelinux.cfg menu:
LABEL ClonezillaAlt
MENU LABEL ClonezillaAlt
kernel boot/clonezilla
append initrd=boot/clonezilla.img nfsroot=X.X.X.X:/data/pxe/clonezilla-alt union=aufs netboot=nfs ocs_live_keymap boot=live vga=788 noswap ocs_live_batch=no ocs_live_extra_param ocs_lang ocs_live_run=ocs-live-general live-config hostname=ClonezillaAlt domain=local.lan suite=generic26
IPAPPEND 2
Replace X.X.X.X with the NFS server hostname/IP address and ensure that the NFS path leads to the zip contents.
Automated Imaging
You can automatically image a drive or restore an image by using the ocs_live_run option that is passed to the kernel on boot. This will work with PXE or USB.
To do this on a USB stick, create a boot entry in syslinux/syslinux.cfg that contains the restore (or imaging) command specified by the ocs_live_run parameter. On an EFI system, you will want to edit /EFI/boot/grub.cfg instead.
To restore an image located in /partimag, create a boot entry similar to the one below:
...
# simple menu title
MENU TITLE clonezilla.org, clonezilla.nchc.org.tw
# Automatic Restore for display-v1.1
label Clonezilla restore display
# MENU DEFAULT
# 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
...
If you want the entry to boot by default, uncomment the MENU DEFAULT line and then comment out the one that is.