Clonezilla-SysRescCD - Installing on USB - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ Until recently installing Clonezilla-SysRescCD on a USB disk would not be such a great idea, because of its size. But since USB devices become cheaper and cheaper, it is an interesting alternative. In order to install it to a USB disk, you will use the Clonezilla-SysRescCD ISO file (or CD). You will copy and modify a couple of files on the USB disk, and finally make it bootable, using syslinux and its configuration file syslinux.cfg. Incorrect use of syslinux could cause your operating system (GNU/Linux / Windows) not to boot. Confirm the command before you run it. The only thing that's important is that your USB disk must contain a VFAT (Windows 98 or DOS) file system. If this is not the case, refer to the section "Troubleshooting", to find out how you can format it, before copying files to it. The bootable USB disk creation procedure can be performed either from Linux or Windows. If you want to create a bootable USB flash drive for this version or later, remember to use the syslinux command from syslinux 3.71 or later. Otherwise the boot menu won't work. Installation from Linux ------------------------------------------------------------------------------ There are two ways you can proceed, if you are going to use Linux to perform the USB installation, either using a running linux box, or using Clonezilla-SysRescCD. I will assume that you have saved clonezilla-sysresccd-full-mod-3.1.0.iso in your home directory (~). Using a linux box --------------------- If you already have a linux box up and running, you can use it to create your Clonezilla-SysRescCD USB, without even having to burn it to CD beforehand. The only thing here is that you have to have syslinux installed. I will assume that your CD drive is /dev/sr0 and that your USB device is /dev/sdc4. You may have to change any of them to reflect your system configuration. Boot into linux, connect your USB device and execute the following commands: mkdir /mnt/mycd mount ~/clonezilla-sysresccd-full-mod-3.1.0.iso /mnt/mycd -o loop mkdir /mnt/usbdevice mount /dev/sdc4 /mnt/usbdevice cp -r /mnt/mycd/* /mnt/usbdevice umount /mnt/mycd; rmdir /mnt/mycd cd /mnt/usbdevice rm isolinux/*.cfg mv isolinux/* . rmdir isolinux cd; umount /dev/sdc4 rmdir /mnt/usbdevice Finally make your USB device bootable, by executing syslinux /dev/sdc4 and you are done. Using Clonezilla-SysRescCD --------------------- If you already burnt Clonezilla-SysRescCD to CD, you can use it to create your Clonezilla-SysRescCD USB. I will assume that your CD drive is /dev/sr0 and that your USB device is /dev/sdc4. You may have to change any of them to reflect your system configuration. Boot SystemRescueCD using the option To RAM, and when it is fully loaded, execute the following commands: mkdir /mnt/mycd mount /dev/sr0 /mnt/mycd mkdir /mnt/usbdevice mount /dev/sdc4 /mnt/usbdevice cp -r /mnt/mycd/* /mnt/usbdevice umount /mnt/mycd cd /mnt/usbdevice rm isolinux/*.cfg mv isolinux/* . rmdir isolinux cd; umount /dev/sdc4 Finally make your USB device bootable, by executing syslinux /dev/sdc4 and you are done. Installation from Windows ------------------------------------------------------------------------------ Installing Clonezilla-SysRescCD from Windows is as easy as it is in Linux. You have to burn Clonezilla-SysRescCD to CD or use a CD/DVD ROM emulator software like Daemon Tools to mount the ISO file. I will assume that your USB device is drive K:\ and your CD drive or mounted ISO file is drive D:\. You may have to change any of them, in order to reflect your system configuration. You will have to * Copy all files from drive D:\ (CD or mounted ISO file) to drive K:\ (USB disk) * Delete all cfg files from K:\isolinux * Move all files from K:\isolinux to K:\ * Delete folder K:\isolinux Now all you have to do is make your USB disk bootable. In order to do that you have to open a DOS window (in Windows XP press "Start / Run " and type cmd). Then type at DOS prompt: K: cd bootprog syslinux -ma K: Booting from USB ------------------------------------------------------------------------------ Before trying to boot from your USB device, you have to set your boot device at your BIOS. This means you have to reboot having your USB device connected, get into your BIOS (usually pressing DEL) and make the appropriate settings in the BOOT section. Booting Clonezilla Live should not be a problem. Just select the desired option and press ENTER to boot. Booting SystemRescueCD has been made equally simple with SystemRescueCD v 1.0.0, so you shouldn't have any problem (option cdroot is not required any more). If you have any problems here, you may try adding any of these boot parameters: usbstick doscsi Troubleshooting ------------------------------------------------------------------------------ Whether you can successfully boot from a USB disk or not, depends mainly on your BIOS. Chances are that you will not be able to boot on an old computer, with an old (and possibly buggy) BIOS. So I would recommend testing your Clonezilla-SysRescCD USB on a new computer. * I can't boot (I don't even see the splash screen) or Clonezilla Live does not boot The first thing you should do is double check your BIOS settings. Reboot having your USB device connected, get into your BIOS (usually pressing DEL) and make the appropriate settings in the BOOT section. If you are on linux, check that the partition on the USB disk is active (bootable), executing: fdisk -l /dev/sdc You should get something similar to this: Disk /dev/sdc: 1031 MB, 1031798272 bytes 64 heads, 32 sectors/track, 983 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdc4 * 1 983 1006576 6 FAT16 If the partition is not active (no astrisk), execute: fdisk /dev/sdc and issue "Command: " a (toggle a bootable flag) and "Partition number:" 4 (for /dev/sdc4). If you are on Windows, this is taken care of by syslinux (parameters -ma). If you still have problems booting, you should try to execute syslinux -s /dev/sdc4 from Linux, or syslinux -sma K: from Windows (from folder K:\syslinux). syslinux man page reads: (Option) -s Install a "safe, slow and stupid" version of syslinux. This version may work on some very buggy BIOSes on which syslinux would otherwise fail. If you find a machine on which the -s option is required to make it boot reliably, please send as much info about your machine as you can, and include the failure mode. * I still can't boot In this case you will have to format your USB disk. If you are using linux to perform the installation, execute the command: mkdosfs -F 16 /dev/sdc4 to create a FAT16 file system, or mkdosfs -F 32 /dev/sdc4 to create a FAT32 file system. When you are done go back to section "Installation from Linux". If you are on Windows, you should download the HP-USB Format tool, install it and format your USB drive using the Fat or Fat32 option. This program can be used to format USB devices that won't boot properly when formatted with Windows format tool. When you are done go back to section "Installation from Windows". * I still can't boot (after formating) Things are getting tough!!! Try to format your USB disk using the option you did not use previously. So, if you have created a FAT32 file system, create a FAT16 file system this time, and recreate Clonezilla-SysRescCD on USB. If nothing works, you are out of luck; you will not be able to use Clonezilla-SysRescCD USB on this computer... If you do manage to boot it, please send me a message. * SystemRescueCD does not boot Ok, you have managed to get to the splash screen and successfully booted Clonezilla Live. But you still can't boot SystemRescueCD. Refer to section Booting from USB to find out the boot parameters you can you with SystemRescueCD. Customizing sysresc.cfg ------------------------------------------------------------------------------ As stated previously, Clonezilla-SysRescCD USB is booted by syslinux through its configuration file syslinux.cfg. This file loads sysresc.cfg in order to boot SystemRescueCD. If you have to specify any additional boot parameters for SystemRescueCD, you may want to write these changes to the configuration file, so that you don't have to insert them by hand every time. The procedure to do that is the following: Boot SystemRescueCD (or if that's not possible yet, bot Clonezilla Linux and get to the command line) using the option To RAM, and when it is fully loaded, execute the following commands: mkdir /mnt/usbdevice mount /dev/[device] /mnt/usbdevice cd /mnt/usbdevice cp sysresc.cfg sysresc.bak sed 's|scandelay=5|scandelay=x [additional params]|' \ sysresc.cfg > sys.cfg mv sys.cfg sysresc.cfg cd; umount /dev/[device] syslinux /dev/[device] reboot where x is a number from 1 to 10. After executing these commands, you will have a new sysresc.cfg file, and a backup file called sysresc.bak (in case things go wrong). If, for example, you want to increase the device scan delay to maximum, the above commands would become: mkdir /mnt/usbdevice mount /dev/sdc4 /mnt/usbdevice cd /mnt/usbdevice cp sysresc.cfg sysresc.bak sed 's|scandelay=5|scandelay=10|' sysresc.cfg > sys.cfg mv sys.cfg sysresc.cfg cd; umount /dev/sdc4 syslinux /dev/sdc4 reboot If, in addition to that, you had to use the boot parameter usbstick, then it would be: mkdir /mnt/usbdevice mount /dev/sdc4 /mnt/usbdevice cd /mnt/usbdevice cp sysresc.cfg sysresc.bak sed 's|scandelay=5|scandelay=10 usbstick|' sysresc.cfg > sys.cfg mv sys.cfg sysresc.cfg cd; umount /dev/sdc4 syslinux /dev/sdc4 reboot In case something goes wrong with your new settings, you can always rename sysresc.bak to sysresc.cfg, either from linux or Windows. Clonezilla-SysRescCD - Boot parameters - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ Booting a linux system means loading a kernel, which is actually the operating system. Well, this is not exactly true, and it is not the only thing that happens during boot up phase, but it is not my intension to explain it here. The kernel is loaded by Isolinux (the CD boot manager), which is able to pass a number of parameters to it, through its configuration file isolinux.cfg. These parameters, called boot parameters, are documented by the kernel itself, and can differentiate its behavior dramatically. In our case, each CD (SystemRescueCD and Clonezilla Live) accept a different set of parameters, because they are based on gentoo and debian, respectively. While in the splash screen of Clonezilla-SysRescCD, you can edit the boot parameters by pressing TAB. They will be presented to you, and you can add or remove what you want. You must be careful not to change or remove the parameters that are dedicated to the CD itself, as altering them will certainty make it unbootable. When you are done, just press ENTER to boot. SystemRescueCD boot parameters ------------------------------------------------------------------------------ The following info applies to SystemRescueCD v. 1.3.3. In case you need to get info for a more recent version of SystemRescueCD please see the page "Sysresccd-manual-en Booting the CD-ROM" A typical sysresccd isolinux entry is: kernel rescuecd append initrd=initram.igz video=ofonly The kernel used is rescuecd, and anything after the word append is a boot parameter. Available kernels (boot images): * rescuecd This is the default choice for 32bits systems, with Framebuffer disabled, best choice. * altker32 This is an alternative kernel for 32bits systems. Boot with this kernel in case you have problems with rescuecd. altker32 was named vmlinuz2 in versions prior to SystemRescueCd-1.0.0. * rescue64 This is the default 64 bits kernel. Use it if you want to chroot to a 64bits linux system installed on your hard disk, or if you have to run 64 bits programs. This kernel is able to boot SystemRescueCd from the cdrom with 32bits programs, and it required a processor with 64bits instructions (amd64 / em64t). * altker64 This is an alternative kernel for 64bits systems. Boot with this kernel in case you have problems with rescue64. Only available from SystemRescueCd-1.0.0 and newer. The boot parameters you can use are: General boot options * setkmap=xx: if you don't want to be asked for the keymap, you can choose which keymap to load automatically. Replace xx with your keymap (for example: setkmap=de for german keyboards) * docache: this option is very useful if you need to insert another disc in the CD drive after booting. The CD-ROM will be fully loaded into memory, and you will be able to remove the disc from the drive. The docache option requires 400MB of memory if you want to cache everything (including the bootdisks and isolinux directories). You can add the lowmem option if you have less that 400MB of memory of to prevent these directories to be copied into memory. * root=xxx: the root= option lets you boot an existing linux system. For example, if you have a linux gentoo installed on /dev/sda6, you can type rescuecd root=/dev/sda6 and Gentoo Linux will be started instead of the system that is on the CD-ROM. Keep in mind that you must use a 64bits kernel if your system is made of 64bits programs. For instance, you can boot a 64bits linux system installed on /dev/sda6 with rescue64 root=/dev/sda6. From SystemRescueCd-1.0.4, this option works with LVM disks, so you can write something like rescuecd root=/dev/VolGroup00/LogVol00. SystemRescueCd-1.0.4 and newer versions also supports root=auto, that will scan all the block devices of the computer to find a linux system. The first linux system found on the disks will be started. So with root=auto let you start the system installed from the CD-ROM in case you have problem with your boot loader or with your kernel for instance. You can have more details about that option. * initscript=service:action: This options allows you to automatically start/stop a service at boot time. For instance if you need the samba service to be started, you can boot with the following option: initscript=samba:start. This does the same thing as /etc/init.d/samba start. You can use this option several times with different services. All the action that are supported by an initscript can be used. This option is available with SystemRescueCd-1.0.2 and newer. * backstore=xxx: SystemRescueCd-1.1.x comes with support for the backing-stores. Basically, a backing-store is a loopback filesystem which saves all the changes you can make in SystemRescueCd when you use it. In other words it allows you to save all the files which changes in SystemRescueCd while you use it, so that you keep these changes the next time you boot it. By default, sysresccd automatically scan all your removable devices (eg: usb sticks) at boot time and uses the first backing-store it finds if there is one. A backing-store is not mandatory and it the scan fails it will just store the files which change in memory. To disable the disks scan at boot time you can specify backstore=off on the boot command line. If you want to save your backing-store file on an harddisk, you will have to boot with backstore=alldev so that it scans all devices not just removable devices. The default place for backing-stores file is any file named sysrcd.bs located at the root of a disk which is often an USB key. You can change the path by using an option such as backstore=/sysrcd/mybackstore.bs and then sysresccd will try to find a file named mybackstore.bs located in /sysrcd in any block-device (partition, USB-stick, ...). You can find more information about on the page about backing-stores. Hardware, drivers and troubleshooting options * nonet: this will disable the network auto detection at startup * scandelay=x: pauses x seconds during the startup to allow slow devices to initialize. This is required when you boot an usb device. A delay of only few seconds should be enough. * doxdetect: Since version 0.3.5 the auto-configuration is done in X.Org itself, and then mkxf86config is disabled by default. This option forces the system to run the mkxf86config startup script to run the hardware auto-detection from this script. Use this option if you have problems with the graphical environment configuration. This option replaces the option noxdetect that was useful in previous versions. * nodetect: prevents the generic hardware auto-detection. Use this option if you have problems with the hardware auto-detection. * doload=xxx: forces to load one/several modules at startup (example: doload=3c59x) * noload=xxx: prevents the system to load one/several modules at startup (example: noload=3c59x). Use this option if you have a problem when the system loads a particular module at boot time. * dostartx: This option will force the system to load the X.Org graphical environment at boot time. You won't have to type startx by hand to get it. * forcevesa: Forces X.Org to work with the safe vesa driver instead of the best video driver detected for your video card. Use this option if you cannot get the graphical environment working with the default options. * forcevesa=xxx: The startx command will load the Xvesa server instead of Xorg, and Xvesa will use the screen resolution given as parameter (eg: 1024x768, 1280x1024x32). The forcevesa option can take a parameter from SystemRescueCd-1.0.0 and more recent. * all-generic-ide: In case of problems related to your hard disk, try to enable this option (eg rescuecd all-generic-ide) * acpi-off / noapic / irqpool: use these options if you have any problem when the kernel boots: if it hangs on a driver or if it crashes, ... * dodebug: Enables verbose messages in the linuxrc script. * lowmem: Prevents non critical things to be loaded into memory (like the sshd and nfsd services) * skipmount=/dev/xxx: The system mounts all the storage devices at boot time to find the sysrcd.dat file. You may not want it to mount a device, for instance if your hard disk is broken because it would crash the system. You can just boot with skipmount=/dev/sda1 skipmount=/dev/sda2 if you want SystemRescueCd to ignore these two partitions. This boot option requires SystemRescueCd-1.0.1 or more recent. * nodmraid: Disable dmraid, which is the program that drives RAID disks based on cheap RAID controller built-in motherboards. * nomdadm: Disable mdadm, which is the program that drives software RAID. Network auto-configuration and remote access * dodhcp: Use dodhcp if you have a DHCP server on your network and you want the system to get a dynamic IP address at boot time. * ethx=ipaddr/cidr: Sets the static IP address of all the ethernet interfaces found on the system. The /cidr extension is optional. For instance, if you use option ethx=192.168.0.1 on a machine with two ethernet adapters, both eth0 and eth1 will be configured with 192.168.0.1. You can also write something like ethx=10.0.0.1/24 (using the cidr notation) if you don't use the default netmask. * eth0=ipaddr/cidr: This option is similar to ethx=ipaddr/cidr but it configures only one interface at a time. Of course, you can use the eth0=ipaddr/cidr option it for all the ethernet interfaces, not just eth0. For instance if you want to configure the network on a server that has two interfaces, you can write something like this: eth0=192.168.10.1/24 eth1=192.168.20.1. This option requires SystemRescueCd-1.0.2 or newer. * dns=ipaddr: Sets the static IP address of the DNS nameserver you want to use to resolve the names. For instance dns=192.168.0.254 means that you want to use 192.168.0.254 as the DNS server. * gateway=ipaddr: Sets the static IP address of the default route on your network. For instance gateway=192.168.0.254 means that the computer can connect to a computer outside of the local network via 192.168.0.254. * rootpass=123456: Sets the root password of the system running on the livecd to 1234. That way you can connect from the network and ssh on the livecd and give 123456 password as the root password. * vncserver=x:123456: The vncserver boot option has been introduced in SystemRescueCd-1.0.2. This options forces the system to configure the VNC-server and to start it automatically at boot time. You have to replace x with the number of displays you want, and 123456 with your password The password must be between 5 and 8 characters, else the boot option will be ignored. In other words the vncserver=2:MyPaSsWd option will give you access to two displays (display=1 on tcp/5901 and display=2 on tcp/5902). Display 0 is reserved for X.Org since SystemRescueCd-1.1.0. * nameif=xxx: You can can specify what interface name to give to a particular interface using the mac address. You need SystemRescueCd-1.1.0 or newer to do that. Here is how you can specify which interface is using which mac address on a machine with two network interfaces: nameif=eth0!00:0C:29:57:D0:6E,eth1!00:0C:29:57:D0:64. Be careful, you have to respect the separator (comma between the interfaces and exclamation marks between the name and the mac address). Options provided by the autorun * ar_source=xxx: place where the autorun are stored. It may be the root directory of a partition (/dev/sda1), an nfs share (nfs://192.168.1.1:/path/to/scripts), a samba share (smb://192.168.1.1/path/to/scripts), or an http directory (http://192.168.1.1/path/to/scripts). * autoruns=[0-9]: comma separated list of the autorun script that have to be run. For instance if you use autoruns=0,2,7 then the following autorun scripts will be executed: autorun0, autorun2, autorun7. Use autoruns=no to disable all the autorun scripts with a number. * ar_ignorefail: continue to execute the scripts chain even if a script failed (returned a non-zero status) * ar_nodel: do not delete the temporary copy of the autorun scripts located in /var/autorun/tmp after execution * ar_disable: completely disable autorun, the simple autorun script will not be executed * ar_nowait: do not wait for a keypress after the autorun script have been executed. Clonezilla Live boot parameters ------------------------------------------------------------------------------ The following info applies to Clonezilla Live v. 1.2.2-31 In case you need to get info for a more recent version of Clonezilla Live please see the page "The boot parameters for Clonezilla live" A typical Clonezilla Live isolinux entry is: kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=791 nolocales The kernel used is vmlinuz, and anything after the word append is a boot parameter. The following info comes from the page titled The boot parameters for Clonezilla live. Clonezilla live is based on Debian live with clonezilla installed. Therefore there are 2 kinds of boot parameters: * Boot parameters from live-initramfs. You can refer to this manual of live-initramfs. * Boot parameters specially for Clonezilla. All of them are named as "ocs_*", e.g. ocs_live_run, ocs_live_extra_param, ocs_live_batch, ocs_lang. * ocs_live_run is the main program to run in Clonezilla live to save or restore. or other command. Available program: ocs-live-general, ocs-live-restore or any command you write. Use the Absolute path in Clonezilla live. e.g. ocs_live_run="ocs-live-general" * ocs_live_extra_param will be used only when ocs_live_run=ocs-live-restore (not for ocs-live-general or any other), then it will be passed to ocs-sr. Therefore these parameters are actually those of ocs-sr. e.g. ocs_live_extra_param="-b -c restoredisk sarge-r5 hda" * ocs_live_keymap is for keymap used in Clonezilla live. Man install-keymap for more details. e.g. ocs_live_keymap="NONE" (won't change the default layout) ocs_live_keymap="/usr/share/keymaps/i386/azerty/fr-latin9.kmap.gz" (French keyboard) * batch mode or not (yes/no), if no, will run interactively. e.g. ocs_live_batch="no" * ocs_lang is the language used in Clonezilla live. Available value: en_US.UTF-8, zh_TW.UTF-8... (see $DRBL_SCRIPT_PATH/lang/bash/) e.g. ocs_lang="en_US.UTF-8" * ocs_debug (or ocs-debug) is for you to enter command line prompt before any clonezilla-related action is run. This is easier for you to debug. * ocs_daemonon, ocs_daemonoff, ocs_numlk, ocs_capslk. Ex. for the first 2 parameters, ocs_daemonon="ssh", then ssh service will be turned on when booting. For the last 2 parameters, use "on" or "off", e.g. ocs_numlk=on to turn on numberlock when booting. * ocs_prerun, ocs_prerun1, ocs_prerun2... is for you to run a shell script before Clonezilla is started. E.g. ocs_prerun="/live/image/myscript.sh". If you have more commands to run, you can assign them in the order: ocs_prerun=..., ocs_prerun1=..., ocs_prerun2=.... If more than 10 parameters, remember to use ocs_prerun01, ocs_prerun02..., ocs_prerun11 to make it in order. * Besides, "live-netdev" (yes, not ocs_live_netdev) can be used when using PXE booting, you can force to assign the network device to get filesystem.squashfs. This is useful when there are two or more NICs are linked. E.g. live-netdev="eth1" allows you to force the live-initramfs to use eth1 to fetch the root file system filesystem.squashfs. With the above options, we have the following examples: * A PXE config example for you to boot Clonezilla live via PXE, and ssh service is on, the password of account "user" is assigned: ---------------------------------------- label Clonezilla Live MENU LABEL Clonezilla Live MENU DEFAULT kernel vmlinuz1 append initrd=initrd1.img boot=live union=aufs noswap noprompt vga=788 fetch=tftp://192.168.120.254/filesystem.squashfs usercrypted=bkuQxLqLRuDW6 ocs_numlk="on" ocs_daemonon="ssh" ---------------------------------------- The usercrypted password is created by: echo YOUR_PASSWORD | mkpasswd -s ("mkpasswd" is from package "whois" in Debian or Ubuntu. Check your GNU/Linux to see which package provides this command if you are not using Debian or Ubuntu. Replace YOUR_PASSWORD with your plain text password, and remember do not put any " in the boot parameters of live-initramfs (while it's ok for those ocs_* boot parameters), i.e. do NOT use something like usercrypted="bkuQxLqLRuDW6"). //NOTE// If you do not assign salt to mkpasswd, the encrypted password will not be the same every time you create it. For more about usercrypted discussion, please check the here. * How to put your own binary driver in Clonezilla live without modifying /live/filesystem.squashfs: * Boot clonezilla live * Become root by running "sudo su -" * Copy the dir lsi, which contains a precompiled kernel module matching the running kernel in Clonezilla live and a script to run it, to a working dir, e.g.: cp -r /live/image/lsi /home/partimag * cd /home/partimag * /opt/drbl/sbin/ocs-live-dev -c -s -i lsi -u lsi -x "ocs_prerun=/live/image/lsi/prep-lsi.sh" * /opt/drbl/sbin/ocs-iso -s -i lsi -u lsi -x "ocs_prerun=/live/image/lsi/prep-lsi.sh" * ///NOTE/// In this example, the 2 files in dir lsi are: megasr.ko (the binary driver) and prep-lsi.sh. The contents of prep-lsi.sh: ------------------------ #!/bin/bash cp -f /live/image/lsi/megasr.ko /lib/modules/`uname -r`/kernel/drivers/block/ chown root.root /lib/modules/`uname -r`/kernel/drivers/block/megasr.ko depmod -a modprobe megasr sleep 1 ------------------------ * To put your customized script with a PXE version of Clonezilla live (You have to use Clonezilla live version 1.2.2-2 or later): In this example, we assume (1) The IP address of your PXE server is 192.168.120.254, (2) the customized script (custom-ocs-2) is put on your PXE server's tftpd root dir (E.g. On DRBL server, the path is /tftpboot/nbi_img/. It might be different in your case if you are not use DRBL server as a PXE server). Therefor your pxelinux.cfg/default file is like: ------------------------ label Clonezilla Live MENU DEFAULT # MENU HIDE MENU LABEL Clonezilla Live # MENU PASSWD kernel vmlinuz1 append initrd=initrd1.img boot=live union=aufs noswap noprompt vga=788 ip=frommedia fetch=tftp://192.168.120.254/filesystem.squashfs ocs_prerun="busybox tftp -g -b 10240 -r custom-ocs-2 -l /tmp/custom-ocs-2 192.168.120.254" ocs_live_run="bash /tmp/custom-ocs-2" ocs_live_keymap="NONE" ocs_live_batch="no" ocs_lang="en_US.UTF-8" nolocales TEXT HELP Boot Clonezilla live via network ENDTEXT ------------------------ The content of custom-ocs-2 can be like: ------------------------ #!/bin/bash . /opt/drbl/sbin/drbl-conf-functions . /opt/drbl/sbin/ocs-functions . /etc/ocs/ocs-live.conf # Load language file ask_and_load_lang_set en_US.UTF-8 # 1. Mount the clonezilla image home. # Types: local_dev, ssh_server, samba_server, nfs_server prep-ocsroot -t nfs_server # 2. Restore the image if mountpoint /home/partimag/ &>/dev/null; then ocs-sr -l en_US.UTF-8 -c -p choose restoredisk ask_user ask_user else [ "$BOOTUP" = "color" ] & $SETCOLOR_FAILURE echo "Fail to find the Clonezilla image home /home/partimag!" echo "Program terminated!" [ "$BOOTUP" = "color" ] & $SETCOLOR_NORMAL fi ------------------------ live-initramfs manual --------------------- This is the manual of live-initramfs live-initramfs(7) ================= Name ---- live-initramfs - Debian Live initramfs hook Synopsis -------- BOOT=live as kernel parameter at boot prompt. Description ----------- live-initramfs is a hook for the initramfs-tools, used to generate a initramfs capable to boot live systems, such as those created by *live-helper*(7). This includes the Debian Live isos, netboot tarballs, and usb stick images. At boot time it will look for a (read-only) media containing a "/live" directory where a root filesystems (often a compressed filesystem image like squashfs) is stored. If found, it will create a writable environment, using aufs, for Debian like systems to boot from. You probably do not want to install this package onto a non-live system, although it will do no harm. live-initramfs is a fork of link:http://packages.ubuntu.com/casper/[casper]. casper was originally written by Tollef Fog Heen and Matt Zimmerman . Boot options ------------ Here is the complete list of recognized boot parameters by live-initramfs. access=*ACCESS*:: Set the accessibility level for physically or visually impared users. ACCESS must be one of v1, v2, v3, m1, or m2. v1=lesser visual impairment, v2=moderate visual impairment, v3=blindness, m1=minor motor difficulties, m2=moderate motor difficulties. console=*TTY,SPEED*:: Set the default console to be used with the "live-getty" option. Example: "console=ttyS0,115200" debug:: Makes initramfs boot process more verbose. fetch=*URL*:: Another form of netboot by downloading a squashfs image from a given url, copying to ram and booting it. hostname=*HOSTNAME*, username=*USER*, userfullname=*USERFULLNAME*:: Those parameters lets you override values read from the config file. ignore_uuid Do not check that any UUID embedded in the initramfs matches the discovered medium. live-initramfs may be told to generate a UUID by setting LIVE_GENERATE_UUID=1 when building the initramfs. integrity-check:: If specified, an MD5 sum is calculated on the live media during boot and compared to the value found in md5sum.txt found in the root directory of the live media. ip=**[CLIENT_IP]:[SERVER_IP]:[GATEWAY_IP]:[NETMASK]:[HOSTNAME]:[DEVICE]:[AUTOCONF] [,[CLIENT_IP]:[SERVER_IP]:[GATEWAY_IP]:[NETMASK]:[HOSTNAME]:[DEVICE]:[AUTOCONF]]***:: Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify this if you want to use dhcp (default). It will be changed in a future release to mimick official kernel boot param specification (e.g. ip=10.0.0.1::10.0.0.254:255.255.255.0::eth0,:::::eth1:dhcp). ip[=**frommedia**]:: If this variable is set, dhcp and static configuration are just skipped and the system will use the (must be) media-preconfigured /etc/network/interfaces instead. {keyb|kbd-chooser/method}=**KEYBOARD**, {klayout|console-setup/layoutcode}=**LAYOUT**, {kvariant|console-setup/variantcode}=**VARIANT**, {kmodel|console-setup/modelcode}=**CODE**, koptions=**OPTIONS**:: Configure the running keyboard as specified, if this one misses live-initramfs behaves as if "keyb=us" was specified. It will be interfered from "locale=" if locale is only 2 lowecase letters as a special case. You could also specify console layout, variant, code, and options (no defaults). live-getty:: This changes the auto-login on virtual terminals to use the (experimental) live-getty code. With this option set the standard kernel argument "console=" is parsed and if a serial console is specified then live-getty is used to autologin on the serial console. {live-media|bootfrom}=**DEVICE**:: If you specify one of this two equivalent forms, live-initramfs will first try to find this device for the "/live" directory where the read-only root filesystem should reside. If it did not find something usable, the normal scan for block devices is performed. {live-media-encryption|encryption}=**TYPE**:: live-initramfs will mount the encrypted rootfs TYPE, asking the passphrase, useful to build paranoid live systems :-). TYPE supported so far are "aes" for loop-aes encryption type. live-media-offset=**BYTES**:: This way you could tell live-initramfs that your image starts at offset BYTES in the above specified or autodiscovered device, this could be useful to hide the Debian Live iso or image inside another iso or image, to create "clean" images. live-media-path=**PATH**:: Sets the path to the live filesystem on the medium. By default, it is set to '/live' and you should not change that unless you have customized your media accordingly. live-media-timeout=**SECONDS**:: Set the timeout in seconds for the device specified by "live-media=" to become ready before giving up. {locale|debian-installer/locale}=**LOCALE**:: Configure the running locale as specified, if not present the live-media rootfs configured locale will be used and if also this one misses live-initramfs behave as "locale=en_US.UTF-8" was specified. If only 2 lowercase letter are specified (like "it"), the "maybe wanted" locale is generated (like en:EN.UTF-8), in this case if also "keyb=" is unspecified is set with those 2 lowercase letters (keyb=us). Beside that facility, only UTF8 locales are supported by live-initramfs. module=**NAME**:: Instead of using the default optional file "filesystem.module" (see below) another file could be specified without the extension ".module"; it should be placed on "/live" directory of the live medium. netboot[=**nfs**|**cifs**]:: This tells live-initramfs to perform a network mount. The parameter "nfsroot=" (with optional "nfsopts="), should specify where is the location of the root filesystem. With no args, will try cifs first, and if it fails nfs. nfsopts=:: This lets you specify custom nfs options. noautologin:: This parameter disables the automatic terminal login only, not touching gdk/kdm. noxautologin:: This parameter disables the automatic login of gdm/kdm only, not touching terminals. nofastboot:: This parameter disables the default disabling of filesystem checks in /etc/fstab. If you have static filesystems on your harddisk and you want them to be checked at boot time, use this parameter, otherwise they are skipped. nopersistent:: disables the "persistent" feature, useful if the bootloader (like syslinux) has been installed with persistent enabled. noprompt Do not prompt to eject the CD on reboot. nosudo:: This parameter disables the automatic configuration of sudo. swapon:: This parameter enables usage of local swap partitions. nouser:: This parameter disables the creation of the default user completely. noxautoconfig:: This parameter disables Xorg auto-reconfiguration at boot time. This is valuable if you either do the detection on your own, or, if you want to ship a custom, premade xorg.conf in your live system. persistent[=nofiles]:: live-initramfs will look for persistent and snapshot partitions or files labeled "live-rw", "home-rw", and files called "live-sn*", "home-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latter in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at live-snapshot(1) for more informations. If "nofiles" is specified, only filesystems with matching labels will be searched; no filesystems will be traversed looking for archives or image files. This results in shorter boot times. {preseed/file|file}=**FILE**:: A path to a file present on the rootfs could be used to preseed debconf database. package/question=**VALUE**:: All debian installed packages could be preseeded from command-line that way, beware of blanks spaces, they will interfere with parsing, use a preseed file in this case. quickreboot:: This option causes live-initramfs to reboot without attempting to eject the media and without asking the user to remove the boot media. showmounts:: This parameter will make live-initramfs to show on "/" the ro filesystems (mostly compressed) on "/live". This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation. textonly Start up to text-mode shell prompts, disabling the graphical user interface. timezone=**TIMEZONE**:: By default, timezone is set to UTC. Using the timezone parameter, you can set it to your local zone, e.g. Europe/Zurich. todisk=**DEVICE**:: Adding this parameter, live-initramfs will try to copy the entire read-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live-media=DEVICE" boot parameter with the same DEVICE used this time. toram:: Adding this parameter, live-initramfs will try to copy the whole read-only media to the computer's RAM before mounting the root filesystem. This could need a lot of ram, according to the space used by the read-only media. union=**aufs**|**unionfs**:: By default, live-initramfs uses aufs. With this parameter, you can switch to unionfs. utc=**yes**|**no**:: By default, Debian systems do assume that the hardware clock is set to UTC. You can change or explicitly set it with this parameter. xdebconf:: Uses xdebconfigurator, if present on the rootfs, to configure X instead of the standard procedure (experimental). xvideomode=**RESOLUTION**:: Doesn't do xorg autodetection, but enforces a given resolution. Files ----- /etc/live.conf Some variables can be configured via this config file (inside the live system). /live/filesystem.module This optional file (inside the live media) contains a list of white-space or carriage-return-separated file names corresponding to disk images in the "/live" directory. If this file exists, only images listed here will be merged into the root aufs, and they will be loaded in the order listed here. The first entry in this file will be the "lowest" point in the aufs, and the last file in this list will be on the "top" of the aufs, directly below /cow. Without this file, any images in the "/live" directory are loaded in alphanumeric order. /etc/live-persistence.binds This optional file (which resides in the rootfs system, not in the live media) is used as a list of directories which not need be persistent: ie. their content does not need to survive reboots when using the persistence features. This saves expensive writes and speeds up operations on volatile data such as web caches and temporary files (like e.g. /tmp and .mozilla) which are regenerated each time. This is achieved by bind mounting each listed directory with a tmpfs on the original path. See also -------- live-snapshot(1), initramfs-tools(8), live-helper(7), live-initscripts(7), live-webhelper(7) Bugs ---- Report bugs against live-initramfs link:http://packages.qa.debian.org/live-initramfs[http://packages.qa.debian.org/live-initramfs]. Homepage -------- More information about the Debian Live project can be found at link:http://debian-live.alioth.debian.org/[http://debian-live.alioth.debian.org/] and link:http://wiki.debian.org/DebianLive/[http://wiki.debian.org/DebianLive/]. Authors ------- live-initramfs is maintained by Daniel Baumann for the Debian project. live-initramfs is a fork of link:http://packages.ubuntu.com/casper/[casper]. casper was originally written by Tollef Fog Heen and Matt Zimmerman . Clonezilla-SysRescCD - About Clonezilla Live - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ The DRBL-based PXEBoot Clonezilla is used to clone many computers simultaneously. It is an extremely useful tool, however, it does have several limitations. In order to use it, you must first prepare a DRBL server AND the machine to be cloned must boot from a network (e.g. PXE/Etherboot). To address these limitations, the Free Software Lab at the NCHC has combined Debian Live with Clonezilla to produce "Clonezilla Live", a new software that can be used to easily clone individual machines. Clonezilla Live provides two modes of operation: * device-image In this mode of operation, a disk/partition can be saved to an image file. This image file can be used to restore the original disk/partition. With Clonezilla-SysRescCD, it can also be used to create an automated restore CD/DVD. This is the mode of operation we will discuss here. * device-device (cloning) This mode of operation creates an exact copy of the original disk/partition on the fly. When working in device-image mode, you will always have to specify three things: * The location of the image file * The working parameters for the operation * The disk/partition that will be saved/restored Clonezilla Live provides a user friendly interface in order to insert this data. When Clonezilla Live is booted up, either normally or copied to RAM, the contents of the whole CD/DVD can be found in folder /live/image. This is where you will find any extra files, such as the restorecd and the doc folders. Starting and stopping Clonezilla Live ------------------------------------------------------------------------------ When you boot into Clonezilla Live, the program (actually a script) starts automatically. There are many places where you can stop it, by selecting Cancel or answering N(o) to a question. When you do that you will probably get the following: Now you can choose to: (0) Poweroff (1) Reboot (2) Enter command line prompt (3) Start over [2] Select Poweroff or Reboot, only if you haven't already mounted a disk partition. I found out by experience, it is not always safe to let any live CD automatically unmount my partitions. So if you have already specified the image partition and/or the partition to save/restore, you should enter command line prompt and type: sudo su - mount | grep /dev/[sh]d and then unmount the partitions shown by the last command. So if the results of this command is for example: /dev/hda1 on /home/partimag type vfat (rw) just type the command: umount /dev/hda1 and it's now safe to Poweroff of Reboot. If, on the other hand, you just want to restart the program, type: ocs-live About the Image file ------------------------------------------------------------------------------ One thing should be made clear about the image file: it is not a file, it is a folder, containing the actual image file and some data about the disk/partition it is associated with. So when you insert the image file name, you actually insert the folder name where the image will be saved/restored. Before you are able to insert the image file name, a list of partitions will be presented to you, so that you can choose where it should be saved/found. When you select one of them, it will be mounted under /home/partimag. This folder is very important for Clonezilla Live; the image file must be located under this directory, which means that the image file must be on the root directory of the mounted partition. So you can not, for example, create a folder called all_my_images and move all your image files in there; Clonezilla Live will not be able to find them!!! Another thing that should be pointed out is that only unmounted partitions will be included in the above list. This means that if you have stopped the program at some point after specifying the partition where the image file resides, and it has been mounted, it will not be present in the list the next time it is presented to you, and you will not be able to use it. There are two things you can do in this case; either unmount the partition, as stated above, or select skip Use existing /home/partimag instead of any other option, when you restart the program. The later of course means that you still want to use the previously specified partition as the image file location. Fianlly I should say that Clonezilla Live is able to use a remote disk/partition as the location of the image file, mounted through ssh, samba or nfs. Using any of these options is a more advanced topic, way beyond the scope of this presentation. Scripts' options ------------------------------------------------------------------------------ This section presents the options which are available at the "Clonezilla advanced extra parameters" screens, if the "Expert" mode is selected. For other options, see Getting backups and Restoring data. Backup options --------------------- > Imaging program priority -q2 Priority: partclone > partimage > dd -q1 Priority: Only dd (supports all filesystem, but inefficient) -q Priority: ntfsclone > partimage > dd Priority: partimage > dd (no ntfsclone) This option chooses which imaging programs are preferred. By default, Clonezilla Live uses partclone for nearly all filesystems, including ext2/3/4, NTFS and FAT32. If a filesystem isn't supported by partclone, but is supported by partimage (spesifically: if the filesystem is HFS, HPFS or JFS), it is cloned by partimage. If it isn't supported by either (for example Linux swap, though it doesn't make any sense to clone swap partitions), it is cloned by dd. Unlike partclone or partimage, dd copies all blocks of the partition instead of only used, resulting in slower imaging process and bigger images. Normally the default option -q2 should be preferred. Try another option if you have problems and believe they are caused by the imaging program used. > Various parameters These options are available at the second "Clonezilla advanced extra parameters" screen. -c Client waits for confirmation before cloning This option causes Clonezilla Live to ask if you really want to clone the disk/partition just before it starts cloning. It is enabled by default. -j2 Clone the hidden data between MBR and 1st partition If this option is set, the 15 hidden sectors between Master Boot Record and the first partition are copied. This area usually contains some data necessary for booting. The option is enabled by default and should be kept enabled if you are cloning a bootable disk. -nogui Use text output only, no TUI/GUI output Causes Clonezilla Live to force the used programs to use only command-line interface even if text-based or graphical user interface is available. -a Do NOT force to turn on HD DMA Prevents Clonezilla Live from using DMA for communicating with hard drives. Slows cloning down but in some conditions cloning without this option can be impossible. -rm-win-swap-hib Remove page and hibernation files in Win if exists This option prevents Clonezilla Live from cloning your page file if you are cloning a partition containing Windows. Often the page file is big and unneeded, and skipping it may speed cloning up without causing any harm. Mind you, this option is disabled by default because sometimes the page file may be necessary. -ntfs-ok Skip checking NTFS integrity, even bad sectors (ntfsclone only) This option works only if you selected the -q option and you're cloning a NTFS partition. It prevents the integrity check of NTFS partitions and speeds the cloning process up a little. However, if the check is disabled, there is a risk that the filesystem is damaged and the image created from it is useless. -gm Generate image MD5 checksums Causes Clonezilla Live to calculate MD5 checksum(s) of image(s) created. If the image cets corrupted afterwards, the checksum allows to notice the corruption before the image is restored. Mind you, calculating the checksum takes some time and slows the process down a little. -gs Generate image SHA1 checksums This option is identical to the above, but creates SHA1 checksum(s) instead of MD5. SHA1 is considered to be more accurate checksum algorithm than MD5, but MD5 is more popular. > Compression method -z1 gzip compression (fast with a smaller image) -z2 bzip2 compression (slowest but smallest image) -z3 lzo compression (faster with image size approx. to that of gzip)(NOTE!!) -z4 lzma compression (slowest but also small image, faster decompression than bzip2) -z0 No compression (fastest but largest image size) This option chooses the method which is used to compress the image while creating it. If no compression is used at all, there won't be any negative speed impact caused by compression. However, the image file size is the size of all the data backed up - for example, if you clone a 160 GB hard drive containing 60 gigabytes of data, the resulting disk image will be 60 gigabytes in size. Gzip and lzop are fast compression methods. Lzop is many times faster than gzip, but creates slightly larger images. Clonezilla Live warns that lzop requires good-quality RAM, but I (the contributor who wrote this chapter) think other compression methods require good RAM too. Bzip2 and lzma are powerful compression methods. Lzma creates a little smaller images than bzip2, and decompressing lzma-compressed images is faster than decompressing bzip2 images. But there is no free lunch: lzma compression method is very slow compared even to bzip2, which isn't fast method either. > Splitting This option (command line: -i [number]) decides if the created image files are splitted into smaller pieces, and if yes, how large the pieces are. This setting doesn't usually matter, but some filesystems (most importantly FAT32) don't allow files larger than four gigabytes. If you're saving the disk image to a FAT32 partition, enter 4000 or less. (Value 0 disables splitting, so don't use it in that case.) If the filesystem allows files big enough, enter any value which isn't too small (you don't want to split the image into too many pieces, do you?) > Postaction -p true Do nothing when the clone finishes -p reboot Reboot client when the clone finishes -p poweroff Shutdown client when the clone finishes In this screen you can decide what Clonezilla Live does when the disk/partition is cloned. Spiros told above that he has found out that it's not always safe to allow Live CDs automatically unmount partitions, and I have lost data when trying auto-unmount with a script. So, avoid -p reboot and -p poweroff options if possible. You have been warned. Restore options (script ocs-sr) --------------------- > Various parameters These options are available at the first "Clonezilla advanced extra parameters" screen. -g auto Reinstall grub in client disk MBR (only if grub config exists) Causes Clonezilla Live to reinstall GRUB into the Master Boot Record of the disk if at least one partition contains GRUB config file (/boot/grub/menu.lst). The option is enabled by default and shouldn't cause any harm. However, it should be disabled if you for example have another bootloader in MBR and chainload GRUB with it. -e1 auto Automatically adjust filesystem geometry for a NTFS boot partition if exists The NTLDR bootloader used by Windows isn't able to determine automatically where the files it needs are stored. It only knows their physical locations, which sometimes change when the disk or partition is copied. If the locations are changed and this option is selected, the location information of the files is changed accordingly. This option is enabled by default and if it's disabled, the cloned Windows will fail to boot. -e2 sfdisk uses CHS of hard drive from EDD(for non-grub boot loader) This option requires that the -e1 auto option is selected. It causes Clonezilla Live to use disk read interface named EDD for determining the physical locations of the files when updating the location information used by NTLDR. The option is enabled by default because it reduces the risk that Windows doesn't boot. -hn0 PC Change MS Win hostname (based on IP address) after clone If this option is selected and a partition containing Microsoft Windows is cloned, its IP address -based hostname is changed after cloning. Computers which are on any network simultaneously need to have different hostnames, so this option is needed if a Windows system is cloned to another computer and the original computer is still used in addition to the one where the image was restored to. -hn1 PC Change MS Win hostname (based on MAC address) after clone This option causes the MAC address -based hostname of Windows to change. This option needs also be enabled in the above condition. -v Prints verbose messages (especially for udpcast) Causes Clonezilla Live to tell more information of what it does. -nogui Use text output only, no TUI/GUI output Causes Clonezilla Live to force the used programs to use only command-line interface even if text-based or graphical user interface is available. -b Run clone in batch mode (DANGEROUS!) Causes Clonezilla Live to run in batch mode. According to Clonezilla Live reference card, this option is dangerous, though I (the contributor) don't know why. -c Client waits for confirmation before cloning This option causes Clonezilla Live to ask if you really want to clone the disk/partition just before it starts cloning. It is enabled by default. -t Client does not restore the MBR (Mater Boot Record) 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. -t1 Client restores the prebuilt MBR from syslinux (For Windows only) If this option is set, the MBR is overwritten by prebuilt one which chainloads Windows. Use this option if you have to restore Windows and make it bootable, but don't have the original MBR or backup of it. -r Try to resize the filesystem to fit partition size This option is useful if you are cloning a small disk to larger one. It tries to resize the restored filesystem to the size of the partition where it was restored to. It allows you to use the whole size of your new disk without resizing the partition afterwards. The option requires that the disk where the image is copied already contains a partition where the image is restored or that the option -k1 is enabled. -e sfdisk uses the CHS value of hard drive from the saved image Force to use the saved CHS (cylinders, heads, sectors) when using sfdisk. Of cource, there is no use of it when using any of -j0, -k or -k2 options. -j1 Write MBR (512 B) again after image is restored. Not OK for partition table diffe When a disk image is restored, the partition table must be updated to reflect the actual partitions in the disk. If you don't want it to happen, enable this option. Then the Master Boot Record (including the partition table) is restored again after restoring the image. Note that using this option can destroy all the data in the target drive. -j2 Clone the hidden data between MBR and 1st partition If this option is set, the 15 hidden sectors between Master Boot Record and the first partition are restored. This area usually contains some data necessary for booting. The option is enabled by default and should be kept enabled if you are cloning a bootable disk. -cm Check image by MD5 checksums If the image folder contains MD5 checksum(s), this option causes Clonezilla Live to check if the image has corrupted by calculating its checksum and comparing it to the precalculated one. Mind you, calculating the checksum takes some time and slows the process down a little. -cs Check image by SHA1 checksums This option is identical to the above, but checks SHA1 checksum(s) instead of MD5. -a Do NOT force to turn on HD DMA Prevents Clonezilla Live from using DMA for communicating with hard drives. Slows cloning down but in some conditions cloning without this option can be impossible. -o0 Run script in $OCS_PRERUN_DIR before clone starts Run the scripts in the directory $OCS_PRERUN_DIR before clone is started. The location of the directory can be determined by editing the file drbl-ocs.conf. By default it is /opt/drbl/share/ocs/prerun. -o1 Run script in $OCS_POSTRUN_DIR as clone finishes Run the scripts in the directory $OCS_POSTRUN_DIR when clone is finished. The location of the directory can be determined by editing the file drbl-ocs.conf. By default it is /opt/drbl/share/ocs/postrun. The command will be run before that assigned in -p. The scripts will be executed by the program "run-parts". run-parts only accepts that the name of the scripts must consist entirely of upper and lower case letters, digits and underscores. So if your file name has an illegal character ".", run-parts won't run it. You can test which files will be executed by entering the command: run-parts --test /opt/drbl/share/ocs/postrun > Partition table This option decides what is done to the partition table of the target drive. Use the partition table from the image This option causes Clonezilla Live to copy the partition table from the image. Use this option if you are cloning a whole disk or somehow know that the partition tables are identical (for example, if you are restoring a partition to the same disk where it was copied from and haven't repartitioned the drive after creating the backup). This is the default option. -k Do NOT create a partition table on the target disk 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. -k1 Create partition table proportionally (OK for MRB format, not GPT) Causes Clonezilla Live to create the partition table automatically using sfdisk after restoring the images. This option works nearly always, but sometimes cloned Windows don't boot. Note that this option doesn't work if you have GUID Partition Table on your disk. (Most likely you don't have one.) -k2 Enter command line prompt to create partition manually later Like the -k option, this option doesn't create the partition table automatically. However, after restoring the image you are led to command line prompt where you can create the partition table manually. Don't use this option if you don't know how the partition table can be created. -j0 Use dd to create partition (NOT OK if logical drives exist) Use dd to dump the partition table from saved image instead of sfdisk. We read in DRBL FAQ/Q&A: When I use clonezilla to clone M$ windows, there is no any problem when saving an image from template machine. However, after the image is restored to another machine, it fails to boot, the error message is "Missing Operating System". What's going on ? Usually this is because GNU/Linux and M$ windows interpret the CHS (cylinder, head, sector) value of harddrive differently. Some possible solutions: 1. Maybe you can change the IDE harddrive setting in BIOS, try to use LBA instead of auto mode. 2. Try to choose [ ] -j0 Use dd to create partition table instead of sfdisk and [ ] -t1 Client restores the prebuilt MBR from syslinux (For Windows only) when you restore the image. 3. You can try to boot the machine with MS Windows 9x bootable floppy, and in the DOS command prompt, run: "fdisk /mbr". 4. You can try to boot the machine with MS Windows XP installation CD, enter recovery mode (by pressing F10 key in MS XP, for example), then in the console, run "fixmbr" to fix it. Maybe another command "fixboot" will help, too. For more info, refer to this doc 5. Use ntfsreloc to adjust FS geometry on NTFS partitions. For more info, refer to http://www.linux-ntfs.org/doku.php?id=contrib:ntfsreloc It has been confirmed that activating the -j0 option, fixes the problem. This option doesn't work if you use LVM (Logical Volume Manager). exit Exit This option ends the restore process and enters command line prompt. > Postaction -p true Do nothing when the clone finishes -p reboot Reboot client when the clone finishes -p poweroff Shutdown client when the clone finishes When image restoration finishes, do one of the following: choose action (default), poweroff or reboot. Saving image files in NTFS partitions ------------------------------------------------------------------------------ Although not recomended, you may find yourself having to save your image file in a NTFS (Windows XP) partition. You may never have a problem doing this, but you may get a message like the following one, when the partition gets mounted: Volume is scheduled for check Please boot into Windows TWICE, or use 'force' mount option" and the backup procedure fails. There are two things you can do here: * Exit the program, reboot and use Windows XP Recovery Console to fix the NTFS file system. From Recovery Console prompt, execute the command: chkdsk /f X: where X: is the drive letter of the disk. When done, boot back into Clonezilla Live and repeat the backup procedure. If the Windows version you use is not XP, boot into SystemRescueCD (graphical mode is not needed) and run the following command: ntfsfix /dev/hda1 where /dev/hda1 is the partition name in GNU/Linux. When done, boot back into Clonezilla Live and repeat the backup procedure. If the disk/partition you are trying to backup is not the Windows System disk (usually C:\), you can boot Windows, and execute the command in a DOS window. To open a DOS window click Start / Run... and at the prompt Open: type cmd. * If Windows XP Recovery Console is not available, you don't have the time to execute the procedure described above, or even if you have executed it but you still get the same message, and you are absolutely sure that you get this message because the NTFS partition is really scheduled for check, and it's not because Windows crushed or have become corrupt, you can mount the patririon by hand and tell Clonezilla Live to use it. Assuming the partition is /dev/hda1, exit the program and execute the commands: sudo su - ntfs-3g -o force /dev/hda1 /home/partimag ocs-live and when you get to the screen "Mount clonezilla image directory", select skip Use existing /home/partimag Clonezilla-SysRescCD - Getting backups - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ In this page I will demonstrate the creation of an image file by getting a backup of a virtual partition (/dev/hdb1). The image file will be saved in another virtual partition (/dev/hda1). The first thing you do when you want to get a backup of a disk/partition, is make sure both the souce (to be backed up) and target (to hold the image file) partitions are in excellent condition (error free). This is the logical thing to do, cause I wouldn't want to backup a corrupt partition, or end up with a corrupt image file. There is one more step I would want to take: I should check that my BIOS boot settings are correct, in order to boot from my CD/DVD drive. Having done all of the above, I am ready to boot from Clonezilla-SysRescCD. The following pressentation has been made usingClonezilla Live v 1.2.2-31 Getting the backup ------------------------------------------------------------------------------ Clonezilla-SysRescCD starting screen --------------------- If you're fine with US keymap and English language (available languages are English, Spanish, French, Italian, Japanese and Chinese [both simplified and traditional]) or don't mind editing the boot parameters, just select Clonezilla Live at the starting screen and press ENTER. When the system comes up, it will load the program that will preform the backup. After that continue from this step. If you need to change these settings, select one of the available Clonezilla Live menu entries, and press TAB. The current boot parameters will be displayed. The default parameters for booting Clonezilla Live on a 1024x768 screen, are the following: append initrd=/live/initrd1.img boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_prerun="/live/image/restorecd/prerun.normal" ocs_live_batch="no" ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" vga=791 nolocales By deleting the words in red, you instruct Clonezilla Live to ask you the values of these parameters. When the appropriate changes have been done (as shown bellow), just press ENTER to boot. append initrd=/live/initrd1.img boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_prerun="/live/image/restorecd/prerun.normal" ocs_live_batch="no" ocs_lang="" ocs_live_keymap="" vga=791 nolocales Screen "Choose Language" --------------------- This is where the language can be selected. I select "en_US.UTF-8 English" and press ENTER. Screen "Configuring console-data" --------------------- I select "Select keymap from full list" and press ENTER. If you're using US keymap, the default option "Don't touch keymap" is a better choice. Screen "Configuring console-data" --------------------- As I (the contributor who wrote a great deal of this page) use Finnish keyboard, I select "pc / qwerty / Finnish / Standard / Standard". Because you most likely use a different keyboard, choose the one you use. Screen "Start Clonezilla" --------------------- I select "Start Clonezilla" and press ENTER. Screen "Clonezilla" --------------------- I select "device-image" and press ENTER. Screen "Mount clonezilla image directory" --------------------- In this screen I can select the way the image file directory will be saved. Available options are local directory, remote directory through ssh, samba or nfs and skip, to use the previously used directory. More info about the image file can be found at section "About the Image file". I select "local_dev" and press ENTER. Next screen --------------------- This is where I choose the location of the image file. It will be saved at the root directory of the selected partition. I select partition hda1 and press ENTER. and then ENTER again. This screen displays the mounting result. As we can see, /dev/hda1 has been successfully mounted under /tmp/local-dev. Next Screen --------------------- I select Beginer mode to accept the default backup options. If you select Expert mode, you can choose the options yourself. More details can be found here. Screen "Select mode" --------------------- Here I can select the desired operation. I select "savedisk" and press ENTER. Next Screen --------------------- In this screen I select the image name. I type "Backup_52-2009_hdb", which in my opinion is more informative name than the default. Next Screen --------------------- Finally I am asked to select the partition to save. I just press ENTER again. Starting the backup --------------------- Then the program will display the command that will be executed and will ask me to press ENTER. Then I will be asked to confirm the operation by pressing y and ENTER. After that, the backup begins and when it's successfully completed, I will be able to reboot the system by pressing 1 and ENTER. Clonezilla-SysRescCD - Getting backups on Samba - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ What if you don't have a spare local disk or partition or a USB disk? How will you be able to get a backup of your system? Well, if your PC is on the same LAN with another PC running Windows (or linux), you can use Samba to save your image file on that remote PC (which we will call Samba server from now on). Using Samba you will be able to mount a Windows share resource (or Samba share resource), from within Clonezilla Live, and save the image file there. Then you can boot that PC using SystemRescueCD and create a restore DVD. In this page I will demonstrate the creation of an image file by getting a backup of my Windows partition (/dev/hda1). The image file will be save in my Samba server which is my laptop (ip: 10.0.0.2, Windows share resource name: data). What is Samba? --------------------- We read at http://us1.samba.org/samba/: Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients. Samba is software that can be run on a platform other than Microsoft Windows, for example, UNIX, Linux, IBM System 390, OpenVMS, and other operating systems. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server. Gathering info ------------------------------------------------------------------------------ Before you can use this approach to get a backup, you have to get some info about the Samba server. The Samba server I have used for this example was my laptop, so I already knew most of the info required. If this is not the case for you, just ask the owner, user or system admin. The info required is: * The IP address of the Samba server * The domain on the Samba server This may exist if your PC is connected to a larger LAN (a corporation network, for example). In my case this is empty. * The user name and password you can use * The directory on the Samba server you can use to save your backup This is the name of the Windows share resource (Samba share resource) as it is known in the network, which is not necessarily the same as the local directory name. The user whose account will be used to login to the Samba server, must have write permission to this directory. Getting the backup ------------------------------------------------------------------------------ If you're fine with US keymap and English language (available languages are English, Spanish, French, Italian, Japanese and Chinese [both simplified and traditional]) or don't mind editing the boot parameters, just select Clonezilla Live at the starting screen and press ENTER. When the system comes up, it will load the program that will preform the backup. If you need to change these settings, go to the Getting backups page for instructions . Screen "Start Clonezilla" --------------------- I select "Start Clonezilla" and press ENTER. Screen "Clonezilla" --------------------- I select "device-image" and press ENTER. Screen "Mount clonezilla image directory" --------------------- In this screen I can select the way the image file directory will be saved. Available options are local directory, remote directory through ssh, samba or nfs and skip, to use the previously used directory. More info about the image file can be found at section "About the Image file". I select "samba server" and press ENTER. Screen "Mount Samba Server" --------------------- This is where I have to enter the IP address of my Samba server. I type "10.0.0.2" and press ENTER. Screen "Mount Samba Server" (second time) --------------------- This is where I have to enter the account (user) name on my Samba server. I type "spiros" and press ENTER. Screen "Mount Samba Server" (third time) --------------------- This is where I have to enter the domain name on my Samba server. I select "Cancel" and press ENTER, as there is no domain in my LAN. If there is a domain in your network, you have to type its name (something like my_company.com) and press ENTER. Screen "Mount Samba Server" (fourth time) --------------------- This is where I have to enter the directory name on my Samba server, in which the image file will be saved. I type "/data" and press ENTER. At this point I will be asked for the password for user spiros. I will be able to continue only after entering it correctly. Screen "Clonezilla - Opensource Clone System (OCS)" --------------------- I select Beginner mode to accept the default backup options. If you select Expert mode, you can choose the options yourself. More details can be found here. Screen "Clonezilla: Select mode" --------------------- Here I can select the desired operation. Available options are: savedisk Save entire disk to image restoredisk Restore entire disk from image saveparts Save partition to image restoreparts Restore partition from image recovery-iso-zip Create an automated restore CD/DVD/USB drive I select "saveparts" and press ENTER. Screen "Clonezilla - Opensource Clone System (OCS) | Mode: saveparts" --------------------- This is the name of the image file. You can insert anything you like, as long as it makes sence to you, so that you can distinguish the image file afterwards. I insert "win_img" and press ENTER. Next screen --------------------- Here I can select the partition that will be backed up. I select "( ) hda1 ntfs" by pressing SPACE and press ENTER, and ENTER again. Then a message is displayed asking for confirmation in order to continue. I just press y, and the backup procedure begins. Rebooting the system ------------------------------------------------------------------------------ When the backup is done, I get the following: (0) Poweroff (1) Reboot (2) Enter command line prompt (3) Start over [2] Then I press ENTER and get to the shell. I execute the commands: sudo su - cd umount -a reboot Clonezilla-SysRescCD - Creating a Restore DVD - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ Assuming you have used Clonezilla Live to make a backup of your Windows XP system (partition /dev/hda1), which you have saved as win_img, you will probably be wondering what to do with it now. Well, one option would be to keep it to the disk you used to save it in, store the disk, and use it whenever you need it. Another option would be to create a DVD you can use to restore this image. This procedure will be explained here. You will use Clonezilla-SysRescCD to create a restore Clonezilla Live System, and burn it to DVD along with your win_img image. Depending on the size of the image and the free disk space, you have three alternatives: * You can create a restore DVD, containing a restore Clonezilla Live System and one or more image files. It can be either a 4.4GB or a 8GB DVD, and it is ideal for packing a number of small image files together. It can be used to restore any of these image files when needed, but the restoration procedure will then be done manually. * You can create an automated restore DVD with a maximum size of 4.4GB This DVD will hold only one image file, which will be automatically restored to its source disk/partition when the corresponding boot menu entry is selected. The drawback is that the working partition (the partition used to create the ISO file) must have an amount of free space equal to the size of the image file plus the Clonezilla Live System size. * You can create an automated restore DVD with a maximum size of 8GB This DVD will hold only one image file, which will be automatically restored to its source disk/partition when the corresponding boot menu entry is selected. You only need to have about 90MB of free space to create it, but there are more commands to be executed to finalise DVD. Creating a restore DVD ------------------------------------------------------------------------------ Assuming you have saved your image file win_img in partition hdb4, you have to boot Clonezilla Live to RAM, using Clonezilla-SysRescCD, and when the system is fully up select Enter_shell and type 2 to get to the shell. Then you mount the partition in /home/partimag sudo su - rm /home/partimag mkdir /home/partimag mount /dev/hdb4 /home/partimag cd /home/partimag Note: It /dev/hdb4 is a NTFS (Windows XP) partition, you will have to use ntfs-3g to mount it, since you need write access to it. In this case you type the commands: sudo su - ntfs-3g /dev/hdb4 /home/partimag cd /home/partimag If you have problems mounting the partition, refer to section "Saving image files in NTFS partitions". Create the ISO file by executing the command: /opt/drbl/sbin/ocs-iso -a restore -V "Win XP Restore" \ -P "Spiros Georgaras " -s All tha's left to do is burn the DVD. Remove the CD from the DVD writer, insert a writable DVD disk and burn the ISO file: growisofs -Z /dev/hdc=restore.iso eject /dev/hdc If the computer has only one DVD writer, you can use the following command, which will auto detect it growisofs -Z $(what-cd -dwb)=restore.iso eject $(what-cd -dwb) Finally, add the image file to the DVD, by typing: growisofs -M /dev/hdc -R -J \ -V "Win XP Restore" --publisher "Spiros Georgaras " \ -graft-points /win_img/=/home/partimag/win_img If the computer has only one DVD writer, you can use the following command, which will auto detect it growisofs -M $(what-cd -dwb) -R -J \ -V "Win XP Restore" --publisher "Spiros Georgaras " \ -graft-points /win_img/=/home/partimag/win_img Note: In the last commands I have assumed your writer is /dev/hdc. You will have to replace this with the device name of your writer. Automated restore ------------------------------------------------------------------------------ Working parameters can be passed to the Clonezilla Live restore script at DVD mastering time. This is very useful if we want to create an "automated" restore DVD. The restore script (osc-sr) can accept the following parameters: * -b -c --nogui -e restoredisk Example: -b -c --nogui -e restoredisk win_img hda This tells the restore script to run in batch mode (-b), to ask for confirmation (-c) and preform a disk restore of image win_img to the first hard disk (hda) * -b -c --nogui -e restoreparts Example: -b -c --nogui -e restoreparts win_img hda1 This tells the restore script to run in batch mode (-b), to ask for confirmation (-c) and preform a partition restore of image win_img to the first partition of the first hard disk (hda1) We will use these commands when mastering our restore DVD. According to Clonezilla's documentation, since we will use mkisofs (actually genisoimage) coming with Clonezilla Live, the ISO file must not be over 4.4GB. Note: The restore DVD will use a 800x600 screen by dafault; if you have to use 640x480, you have to edit the isolinux/isolinux.cfg file manually. You can get more info about the available restore script options by executing /opt/drbl/sbin/ocs-sr -h 2>&1 | less Caution: It is not possible to concatenate the options, as it usually happens in linux. That is, if you write -bc... instead of -b -c --nogui..., the result will be that the automatic restore will not work. This is because of the way the original restore script was written. Creating a 4.4GB automated restore DVD ------------------------------------------------------------------------------ Assuming you have saved your image file win_img in partition hdb4, you have to boot Clonezilla Live to RAM, using Clonezilla-SysRescCD, and when the system is fully up select Enter_shell and type 2 to get to the shell. Then you mount the partition in /home/partimag sudo su - rm /home/partimag mkdir /home/partimag mount /dev/hdb4 /home/partimag cd /home/partimag Note: It /dev/hdb4 is a NTFS (Windows XP) partition, you will have to use ntfs-3g to mount it, since you need write access to it. In this case you type the commands: sudo su - ntfs-3g /dev/hdb4 /home/partimag cd /home/partimag If you have problems mounting the partition, refer to section "Saving image files in NTFS partitions". Assuming the image file is the backup of partition hda1, create the ISO file by executing the command: /opt/drbl/sbin/ocs-iso -a clonezilla-44-restore-dvd \ -I "Restore Windows XP (Home PC) - hda1" \ -V "Win XP Restore" -P "Spiros Georgaras " \ -W "-j0 -b -c --nogui restoreparts win_img hda1" win_img All tha's left to do is burn the DVD. Remove the CD from the DVD writer, insert a writable DVD disk and burn the ISO file: growisofs -Z /dev/hdc=clonezilla-44-restore-dvd eject /dev/hdc Note: In the last commands I have assumed your writer is /dev/hdc. You will have to replace this with the device name of your writer. If the computer has only one DVD writer, you can use the following command, which will auto detect it growisofs -Z $(what-cd -dwb)=clonezilla-44-restore-dvd.iso eject $(what-cd -dwb) Creating a 8GB automated restore DVD ------------------------------------------------------------------------------ Assuming you have saved your image file win_img in partition hdb4, you have to boot Clonezilla Live normally (no copy to RAM), using Clonezilla-SysRescCD, and when the system is fully up select Enter_shell and type 2 to get to the shell. Then you mount the partition in /home/partimag sudo su - mount /dev/hdb4 /home/partimag cd /home/partimag Note: It /dev/hdb4 is a NTFS (Windows XP) partition, you will have to use ntfs-3g to mount it, since you need write access to it. In this case you type the commands: sudo su - ntfs-3g /dev/hdb4 /home/partimag cd /home/partimag If you have problems mounting the partition, refer to section "Saving image files in NTFS partitions". Assuming the image file is the backup of partition hda1, create the ISO file by executing the command: /opt/drbl/sbin/ocs-iso -a clonezilla-8-rescue-dvd \ -I "Restore Windows XP (Home PC) - hda1" \ -V "Win XP Restore" -P "Spiros Georgaras " \ -A "-j0 -b -c --nogui restoreparts win_img hda1" At this point you have to reboot the system, and boot Clonezilla Live to RAM, in order to burn the DVD. When the system is fully up, select Enter_shell and type 2 to get to the shell and execute the commands: sudo su - mount /dev/hdb4 /home/partimag cd /home/partimag Note: At this point you don't need write access to /dev/hdb4, so it makes no difference whether it is a NTFS (Windows XP) partition or not. Remove the CD from the DVD writer, insert a writable DVD disk and burn the ISO file: growisofs -Z /dev/hdc=clonezilla-8-rescue-dvd.iso eject /dev/hdc If the computer has only one DVD writer, you can use the following command, which will auto detect it growisofs -Z $(what-cd -dwb)=clonezilla-8-rescue-dvd.iso eject $(what-cd -dwb) Finally, add the image file to the DVD, by typing: growisofs -M /dev/hdc -R -J \ -V "Win XP Restore" --publisher "Spiros Georgaras " \ -graft-points /win_img/=/home/partimag/win_img If the computer has only one DVD writer, you can use the following command, which will auto detect it growisofs -M $(what-cd -dwb) -R -J \ -V "Win XP Restore" --publisher "Spiros Georgaras " \ -graft-points /win_img/=/home/partimag/win_img Note: In this section I have assumed your writer is /dev/hdc. You will have to replace this with the device name of your writer. Working with a USB keyboard ------------------------------------------------------------------------------ Systems equipped witη a USB keyboard, have a problem starting Clonezilla Live, SystemRescueCD or any of the tools in the CD, since the keyboard does not work while in boot menu, and the default boot menu action is to boot from the first hard disc. One solution would be to connect to the system a PS2 keyboard before booting Clonezilla-SysRescCD. The problem that still remains has to do with systems not equipped with a PS2 connector at all. In order to use Clonezilla-SysRescCD in such a system, the CD should be remastered changing the default boot menu entries as desired. In order to use Clonezilla Live on such a system, one could use the network to get a backup, or perform a restore. Creating a restore DVD for such a system, would obviously have to be an auto restore DVD. The problem of booting an auto restore DVD and performing the restore is still there, since the default boot menu action is again to boot from the first hard disc. To address this problem, some new parameters have been added to the ISO mastering script (ocs-iso): * --noKeyboard Using this parameter, the default boot menu action is assigned to the first menu entry, which will start the restore operation. * --defaultItem [item number] Using this parameter, you can specify the menu entry which will be assigned to the default boot menu action. The value of [item number] can be 1 - 1024x768 screen 2 - 800x600 screen 3 - 640x480 screen 4 - Safe graphic settings 5 - Failsafe mode As you can see, using --defaultItem 1 is equivelant to --noKeyboard * --bootDelay [number of seconds] Using this parameter, the value of the boot timeout (default is 30 secs) can be changed so that the restore operation starts sooner. In order to use these parameters to master the auto restore DVD, the user has to modify the ISO mastering commands. The command for a 4.4GB DVD would be: /opt/drbl/sbin/ocs-iso -a clonezilla-44-restore-dvd \ -I "Restore Windows XP (Home PC) - hda1" \ -V "Win XP Restore" -P "Spiros Georgaras " \ --noKeyboard --bootDelay 10 \ -W "-j0 -b -c --nogui restoreparts win_img hda1" win_img The command for a 8GB DVD would be: /opt/drbl/sbin/ocs-iso -a clonezilla-8-rescue-dvd \ -I "Restore Windows XP (Home PC) - hda1" \ -V "Win XP Restore" -P "Spiros Georgaras " \ --noKeyboard --bootDelay 10 \ -A "-j0 -b -c --nogui restoreparts win_img hda1" Using an auto restore DVD mastered using these parameters, is very simple; at system start-up the boot menu is displayed and after [number of seconds], the restore operation will start automatically. Menu modification parameters ------------------------------------------------------------------------------ When using any of the -W and -A parameters, you can use two more paremeters to modify the text displayed at the CD/DVD title and the menu items. These parameters are: * -T or --isolinux-title [title text] This parameter will change the CD/DVD title from Clonezilla-SysRescCD v 3.1.0 to [title text] * -I or ---isolinux-menu-item [items' text] This parameter will change the menu items text from Clonezilla Live - XXXXxYYYY to [items' text] - XXXXxYYYY. For example, Clonezilla Live - 1024x768 will be changed to [items' text] - 1024x768. Clonezilla-SysRescCD - Restoring data - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ Image files are always created for one purpose: restoring the data they contain. Images can be, for example, a backup solution: as long as hardware works, the computer can be restored to the state it was when creating the image. Another usage scenario is changing the hard drive: files can be copy-pasted from the old drive to the new, but that method doesn't make the new drive bootable. Disk images do. This page contains a demonstration of the latter case. On the Getting backups page, a 500 MB virtual disk containing 300 megabytes of data was copied to a 2 GB virtual disk which was empty. Now the 500 MB disk is changed to an empty 2 GB disk (still virtual) and I'll restore the data to that disk. When creating a disk image, one needs to check that both the source and target partitions are error free. That's not required when the image is restored, because restoration process can't damage the disk image. Note, however, that restoring an image erases all the data in the target disk/partition. You also need to check the BIOS settings to be able to boot from Clonezilla-SysRescCD. Some BIOSes contain a boot menu, others require editing settings pernamently. Details can be found on the manual of the motherboard or laptop. Now let's boot. Restore process erases all the data on the target disk/partition.Before restoring make sure you have backup of all the data on the target disk/partition, even if the filesystem is corrupted. The following pressentation has been made usingClonezilla Live v 1.2.2-31 Restoring data ------------------------------------------------------------------------------ Clonezilla-SysRescCD starting screen --------------------- If you're fine with US keymap and English language (available languages are English, Spanish, French, Italian, Japanese and Chinese [both simplified and traditional]) or don't mind editing the boot parameters, just select Clonezilla Live at the starting screen and press ENTER. When the system comes up, it will load the program that will preform the backup. After that continue from this step. If you need to change these settings, select one of the available Clonezilla Live menu entries, and press TAB. The current boot parameters will be displayed. The default parameters for booting Clonezilla Live on a 1024x768 screen, are the following: append initrd=/live/initrd1.img boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_prerun="/live/image/restorecd/prerun.normal" ocs_live_batch="no" ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" vga=791 nolocales By deleting the words in red, you instruct Clonezilla Live to ask you the values of these parameters. When the appropriate changes have been done (as shown bellow), just press ENTER to boot. append initrd=/live/initrd1.img boot=live union=aufs ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_prerun="/live/image/restorecd/prerun.normal" ocs_live_batch="no" ocs_lang="" ocs_live_keymap="" vga=791 nolocales Screen "Choose Language" --------------------- This is where the language can be selected. I select "en_US.UTF-8 English" and press ENTER. Screen "Configuring console-data" --------------------- I select "Select keymap from full list" and press ENTER. If you're using US keymap, the default option "Don't touch keymap" is a better choice. Screen "Configuring console-data" --------------------- Because I haven't changed my keyboard, I select "pc / qwerty / Finnish / Standard / Standard". Because you most likely use a different keyboard, choose the one you use. Screen "Start Clonezilla" --------------------- I select "Start Clonezilla" and press ENTER. Screen "Clonezilla" --------------------- I select "device-image" and press ENTER. Screen "Mount clonezilla image directory" --------------------- In this screen I can select the way the image file directory has been saved. Available options are local directory, remote directory through ssh, samba or nfs and skip, to use the previously used directory. More info about the image file can be found at section "About the Image file". I select "local_dev" and press ENTER. Next screen --------------------- This is where I choose the location of the image file. I select partition hda1 and press ENTER. and then ENTER again. This screen displays the mounting result. As we can see, /dev/hda1 has been successfully mounted under /tmp/local-dev. Next Screen --------------------- I select Beginer mode to accept the default restore options. If you select Expert mode, you can choose the options yourself. More details can be found here. Screen "Select mode" --------------------- Here I can select the desired operation. I select "restoredisk" and press ENTER. Next Screen --------------------- In this screen I select the image folder. This partition contains only one image. Next Screen --------------------- Finally I am asked to select which partition the image will be restored to. After double-checking the disk doesn't contain anything important, I press ENTER. Starting the restoration --------------------- Then the program will display the command that will be executed and will ask me to press ENTER. Then I will be asked to confirm the operation by pressing y and ENTER. This is the last confirmation Clonezilla Live asks.After this step there is no coming back. Then my confirmation is asked one last time. After checking one more time the disk doesn't contain any important data, I press y and ENTER. After that, the restore process begins and when it's successfully completed, I will be able to reboot the system by pressing 1 and ENTER. Clonezilla-SysRescCD - Restoring to a different location - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ In the past restoring to a different location was not supported by Clonezilla Live at all. Because of that, a script called reloc-img was added to Clonezilla-SysRescCD, which would help the user perform this task. Recent versions of Clonezilla Live partly support restoring to a different location, so the reloc-img script is obsolete. Clonezilla Live now supports: * Relocation of a disk image (restoring a whole disk) * Relocation of a partition image (restoring a partition) Clonezilla Live does not support: * Relocation of a single partition contained into a disk image. Imagine you have a disk backup image named hda-2009-02-02. The image contains three partitions, hda1 (operating system), hda2 (user data) and hda3 (other data). You want to restore your other data partition (hda3), to a different system (partition sdb2) but there is no way to restore (extract) a single partition from a disk image - you can only restore the whole disk. In order to address this situation, two new scripts have been written for Clonezilla-SysRescCD: imginfo and imgconvert Script imginfo ------------------------------------------------------------------------------ The script will be used to print info about existing image files. Its help screen is: # imginfo -h Clonezilla Live Image Information imginfo v. 0.1 - (C) 2009 S. Georgaras Usage: imginfo Available options: s Search in sub-directories too i [name] Pring info for image [name] v Print version info and exit h Print this screen and exit Script imgconvert ------------------------------------------------------------------------------ The script will be used to convert an existing disk image file to a new partition image file. imgconvert can create two type of images: * Temporary image This type of image is created by linking the data files of the existing disk image to the new partition image. This means that the original image must be present for the new image to be used. This is the default image type created by imgconvert. * Permanent image This type of image is created by copying the data files from the existing disk image to the new partition image. This means that the original image is not needed in order to use the new one. Permenant image files are created using the command line parameter -p. Its help screen is: # imgconvert -h Clonezilla Live Image Conversion imgconvert v. 0.1 - (C) 2009 S. Georgaras Usage: imgconvert [image] [partition] Parameters are: [image] Disk image to be converted to partition image [partition] Partition name to convert. It must be a valid device name Available options: o [image] Save new imag as [image] p Save new partition instead of making a link to the old one v Print version info and exit h Print this screen and exit Using the scripts ------------------------------------------------------------------------------ Restoring to a partition --------------------- After booting into Clonezilla Live, I select Enter_shell Enter command line prompt when the menu is displayed and then I press 2 to exit to the shell. At this point I will mount my images partition (in this example /dev/sdc4), and use script imginfo to get info about my image files. $ sudo su - # mount /dev/sdc4 /home/partimag # cd /home/partimag # imginfo Image files found in: /home/partimag Image: usb250-img, disk: sda, size: 259MB, parts: 1 part: sda4, size: 247.00MB, type: FAT16 Image: sys-bck, disk: hda, size: 320.0GB, parts: 3 part: hda1, size: 22.36GB, type: Linux part: hda2, size: 39.06GB, type: Linux part: hda3, size: 233.87GB, type: Linux As you can see there are two disk images under /home/partimag: usb250-img and sys-bck. sys-bck is a backup of my old system, which had three partitions. What I need to do now is "copy" the hda3 partition to my current system, by transfering its data to partition sdb2. The way to proceed is: * Create a new partition image (containing hda3's data) based on the existing disk image file, by executing the command: # imgconvert sys-bck hda3 sdb2 Clonezilla Live Image Conversion imgconvert v. 0.1 - (C) 2009 S. Georgaras Determining input image Input image: "/home/partimag/sys-bck" Validating image... ok Determining input partition Input partition: "hda3" Validating input partition... ok Determining output image Output image: "/home/partimag/sys-bck-cnv" Validating output image... ok Checking permissions... ok Determining output partition Output partition: "sda2" Validating output partition... ok Creating output image: /home/partimag/sys-bck-cnv Linking files... done Fixing info files... done This command will create a temporary partition image file (automatically named sys-bck-cnv), which contains sdb2 only, as you can see by executing: # imginfo -i sys-bck-cnv Image: sys-bck-cnv, part: sdb2, size: 233.87GB, type: Linux * Restart Clonezilla Live by pressing Control-D twice. * Restore the new image file into sdb2, by selecting Screen 1: Start_Clonezilla Start Clonezilla Screen 2: device-image disk/partition to/from image Screen 3: skip use existing /home/partimag Screen 4: Beginer / Expert Screen 5: restoreparts Restore_an_image_to_local_partition and continue as usual to restore the partition. Converting image files --------------------- # imgconvert -p -o other_data sys-bck hda3 sdb2 Clonezilla Live Image Conversion imgconvert v. 0.1 - (C) 2009 S. Georgaras Determining input image Input image: "/home/partimag/sys-bck" Validating image... ok Determining input partition Input partition: "hda3" Validating input partition... ok Determining output image Output image: "/home/partimag/other_data" Validating output image... ok Checking permissions... ok Determining output partition Output partition: "sda2" Validating output partition... ok Creating output image: /home/partimag/other_data Copying files... done Fixing info files... done # imginfo -i other_data Image: other_data, part: sdb2, size: 233.87GB, type: Linux # ls -la sys-bck total 1111972 drwxr-xr-x 2 root root 4096 2007-11-22 03:21 . drwxr-xr-x. 34 root root 4096 2009-04-06 21:28 .. -rw-r--r-- 1 root root 4 2007-11-20 20:33 disk -rw-r--r-- 1 root root 1081716736 2007-11-20 20:32 hda1.aa -rw-r--r-- 1 root root 45453312 2007-11-20 20:33 hda2.aa -rw-r--r-- 1 root root 10317824 2007-11-20 20:33 hda3.aa -rw-r--r-- 1 root root 37 2007-11-21 18:56 hda-chs.sf -rw-r--r-- 1 root root 37 2007-11-21 18:50 hda-chs.sf.orig -rw-r--r-- 1 root root 512 2007-11-20 20:31 hda-mbr -rw-r--r-- 1 root root 259 2007-11-21 18:59 hda-pt.sf -rw-r--r-- 1 root root 259 2007-11-21 18:50 hda-pt.sf.orig -rw-r--r-- 1 root root 15 2007-11-20 20:33 parts -rw-r--r-- 1 root root 17 2007-11-20 20:33 swappt-hda4.info # # # ls -la other_data total 24 drwxr-xr-x 2 root root 4096 2009-04-06 21:27 . drwxr-xr-x. 35 root root 4096 2009-04-06 21:27 .. -rw-r--r-- 1 root root 5 2009-04-06 21:27 parts -rw-r--r-- 1 root root 10317824 2009-04-06 21:27 sdb2.aa -rw-r--r-- 1 root root 37 2009-04-06 21:27 sdb-chs.sf -rw-r--r-- 1 root root 106 2009-04-06 21:27 sdb-pt.sf Booting a restored Linux system ------------------------------------------------------------------------------ A Linux system that has been restored to a new disk/partition, using reloc-img is usually not ready to be booted right after the restoration procedure is finished. There are two more steps that you may have to take: * Fix /etc/fstab * Reinstall GRUB. I will assume GRUB is your boot manager, as it is the usual case nowadays. For this example I will assume that you have restored a Linux system (that used to be in sdb), to a new disk (hda), and that it contains three partitions, / (the root partition), /home (user's partition) and a swap partition. You must be really careful here, as the name of the new disk depends on the system to be booted. If it uses one of the newest Linux kernels (using the libata disk driver), ALL your disks will be recognised as SCSI. More info: "Identifying devices in Linux" section "SCSI disks when there are none!!!". This is what we have: root partition home partition swap partition Old system /dev/sdb1 /dev/sdb2 /dev/sdb3 New system /dev/hda1 /dev/hda2 /dev/hda3 Fixing /etc/fstab --------------------- Since we are still in Clonezilla Live, right after reloc-img has finished, we will use it to mount our restored root partition, and edit its /etc/fstab. We issue the commands: mkdir /new-root mount /dev/hda1 /new-root vi /new-root/etc/fstab The contents of /etc/fstab could be something like /dev/sdb1 / reiserfs acl,user_xattr 1 1 /dev/sdb2 /home reiserfs defaults 1 2 /dev/sdb3 swap swap defaults 0 0 and we have to change ti to /dev/hda1 / reiserfs acl,user_xattr 1 1 /dev/hda2 /home reiserfs defaults 1 2 /dev/hda3 swap swap defaults 0 0 Finally, we unmount the partition, and we are ready to reboot umount /new-root reboot Reinstalling GRUB --------------------- When Clonezilla-SysRescCD menu appears, we select Tools > Super Grub Disk Then we select Super Grub Disk > Super Grub Disk (WITH HELP) > English Super Grub Disk > Gnu/Linux > Fix Boot of Gnu/Linux (GRUB). From this entry we will be able to reinstall GRUB to our hard disk. You may also want to have a look at Super Grub Disk "documentation". Clonezilla-SysRescCD - Data Recovery - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ Deleted or "lost" files can be recovered from failed or formatted drives and partitions, cdroms and memory cards using the software available in SystemRescueCD. Unless you can rule out hardware failure, you must not write to the failed device. The following software will passively try to recover your data from failed or failing hardware. If your data is not replaceable, do not attempt to write to the failed device if the following applications do not work but seek professional advice instead. If your device is damaged, it is advisable to image the device and work on the image file for data recovery. If hardware failure is not the problem, you can recover data directly from the device. To recover data from a failed device, you will need another device of equal or greater storage capacity onto which to save your data. If you need to make an image of the failed device, you will need yet another quantity of space. I should state here, that I haven't used any of these tools recently (other than plain and simple dd, a long time ago, which I found to be very slow), so I couldn't recommend any of them. Any comments on a tool's usability found in this page, is just what I found on the Net. Partition recovery ------------------------------------------------------------------------------ If you made a mistake while partitioning and the partition no longer appears in the partition table, so long as you have not written data in that space, all your data is still there and can be restored. When changing the partition table on your hard drive, you must ensure that no partition on the disk is mounted. This includes swap space. In order to restore your partition, execute: swapoff -a parted /dev/old_disk Then, use the rescue option: rescue START END where START is the area of the disk where you believe the partition began and END is it's end. If parted finds a potential partition, it will ask you if you want to add it to the partition table. Note: TestDisk can also be used to recover a "lost" partition. Disk / files recovery ------------------------------------------------------------------------------ Using dd --------------------- In order to duplicate a disk to another disk, execute dd if=/dev/old_disk of=/dev/new_disk conv=noerror,sync or to create an image file dd if=/dev/old_disk of=image_file conv=noerror Be careful, if you are copying a disk, the destination must also be a disk, not a partition. If you are copying a partition, the destination partition must be large enough. Copying the whole disk is recommended. To speed up the copy process, you can append bs=8k, it will read/write the disk by 16 sectors at a time. Using dd_rescue --------------------- Like dd, dd_rescue does copy data from one file or block device to another. You can specify file positions (called seek and skip in dd). There are several differences: * dd_rescue does not provide character conversions. * The command syntax is different. Call dd_rescue -h. * dd_rescue does not abort on errors on the input file, unless you specify a maximum error number. Then dd_rescue will abort when this number is reached. * dd_rescue does not truncate the output file, unless asked to. * You can tell dd_rescue to start from the end of a file and move backwards. * It uses two block sizes, a large (soft) block size and a small (hard) block size. In case of errors, the size falls back to the small one and is promoted again after a while without errors. * It does not (yet) support non-seekable in- or output. In order to duplicate a disk to another disk, execute dd_rescue -A -v /dev/old_disk /dev/new_disk or to create an image file dd_rescue -A -v /dev/old_disk image_file The copying should go very quickly until it hits a bad sector and then it will slow down to take smaller chunks of data. People have reported very good results with this technique. Using GNU ddrescue --------------------- The GNU site describes GNU ddrescue as a data recovery tool, and lists these features: * It copies data from one file or block device (hard disc, CD-ROM, etc) to another, trying hard to rescue data in case of read errors. * It does not truncate the output file if not asked to, so every time you run it on the same output file, it tries to fill in the gaps. * It is designed to be fully automatic. * If you use the log file feature of GNU ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point. * The log file is periodically saved to disc. So in case of a crash you can resume the rescue with little recopying. * If you have two or more damaged copies of a file, CD-ROM, etc, and run GNU ddrescue on all of them, one at a time, with the same output file, you will probably obtain a complete and error-free file. The probability of having damaged areas at the same places on different input files is very low. Using the log file, only the needed blocks are read from the second and successive copies. * The same log file can be used for multiple commands that copy different areas of the file, and for multiple recovery attempts over different subsets. The algorithm of GNU ddrescue is as follows: * Optionally read a log file describing the status of a multi-part or previously interrupted rescue. * Read the non-damaged parts of the input file, skipping the damaged areas, until the requested size is reached, or until interrupted by the user. * Try to read the damaged areas, splitting them into smaller pieces and reading the non-damaged pieces, until the hardware block size is reached, or until interrupted by the user. * Try to read the damaged hardware blocks until the specified number of retries is reached, or until interrupted by the user. * Optionally write a log file for later use. Note: GNU ddrescue is considered to be the best recovery tool available. In order to duplicate a disk to another disk, execute ddrescue -vr3 /dev/old_disk /dev/new_disk logfile or to create an image file ddrescue -vr3 /dev/old_disk image_file logfile If the disk is failing fast and you want to get the most data out of it on the first try, you should probably use "-n" on the first run. This will avoid splitting error areas. Subsequent runs can use "-r1" or "-r3", without "-n", to retry those error areas. To summarise, we execute: ddrescue -vn /dev/old_disk image_file logfile ddrescue -v -r3 -C /dev/old_disk image_file logfile Note: When working with CD-ROMs you should probably specific "-b 2048" Using Foremost --------------------- Foremost is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive. The headers and footers can be specified by a configuration file or you can use command line switches to specify built-in file types. These built-in types look at the data structures of a given file format allowing for a more reliable and faster recovery. It can be run on an image file created with any of the above tools, to extract files: foremost -i image -o /recovery/foremost Foremost can be instructed to recover only specific file types, using the -t command line parameter. In the following example Foremost will extract only jpg files: foremost -t jpg -i image -o /recovery/foremost Available types are: jpg, gif, png, bmp, avi, exe (Windows binaries and DLLs), wav, riff, wmv (will extract wma also), mov, pdf, ole (will extract any file using the OLE file structure; this includes PowerPoint, Word, Excel, Access, and StarWriter), doc, zip (will extract .jar files and Open Office docs as well; this includes SXW, SXC, SXI, and SX? for undetermined OpenOffice files), rar, html and cpp. Using TestDisk --------------------- TestDisk was primarily designed to help recover "lost" partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy. TestDisk can * Fix partition table, recover deleted partition * Recover FAT32 boot sector from its backup * Rebuild FAT12/FAT16/FAT32 boot sector * Fix FAT tables * Rebuild NTFS boot sector * Recover NTFS boot sector from its backup * Fix MFT using MFT mirror * Locate ext2/ext3 Backup SuperBlock Some great tutorials are available at TestDisk's site: "TestDisk Step By Step", "Running TestDisk", "Data Recovery Examples" etc. Using PhotoRec --------------------- PhotoRec is file data recovery software designed to recover "lost" files including video, documents and archives from Hard Disks and CDRom and "lost" pictures (thus, its 'Photo Recovery' name) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your media's filesystem has been severely damaged or re-formatted. For more safety, PhotoRec uses read-only access to handle the drive or memory support you are about to recover "lost" data from. Important: As soon as a pic or file is accidentally deleted, or you discover any missing, do NOT save any more pics or files to that memory device or hard disk drive; otherwise you may overwrite your "lost" data. This means that even using PhotoRec, you must not choose to write the recovered files to the same partition they were stored on. A great tutorial titled "PhotoRec Step By Step" can be found at PhotoRec's site. Links & resources ------------------------------------------------------------------------------ This page is a compilation of the following pages: DataRecovery https://help.ubuntu.com/community/DataRecovery Hard Drive Recovery, Ubuntu-Style http://blogs.sun.com/superpat/tags/ddrescue Recover Data and (deleted) Partition with Linux from Hard Drives, CD-ROMs or DVDs http://sysblogd.wordpress.com/2008/01/05/data-recovery-with-linux-from-hard-drives-cd-roms-or-dvds/ dd_rescue http://www.garloff.de/kurt/linux/ddrescue/ gddrescue: a tool for recovering data from damaged media http://debaday.debian.net/2007/12/12/gddrescue-a-tool-for-recovering-data-from-damaged-media/ Foremost http://foremost.sourceforge.net/ TestDisk http://www.cgsecurity.org/wiki/TestDisk PhotoRec http://www.cgsecurity.org/wiki/PhotoRec Clonezilla-SysRescCD - Clonezilla-SysRescCD own scripts - 08/02/2009 - v 3.1.0 In this page I will present the scripts I have written for Clonezilla-SysRescCD startx-ttf-ati ------------------------------------------------------------------------------ Included in: SystemRescueCD This script will help you start the X server (graphical environment), if you have a ATI video card and a TTF monitor. The normal startx command will not work in this case; you will end up with a blank screen. what-cd ------------------------------------------------------------------------------ Included in: SystemRescueCD This script determines the device names for your CDs/DVDs, and whether they can read/write CD/DVD-ROMs Its help screen is the following: # what-cd -h what-cd - v 1.0.0 - S. Georgaras what-cd will try to identify your CD/DVDs You can use it to identify the device name of your CD-Reader (default), CD-Writer, DVD-Reader, and DVD-Writer. Usage: what-cd [options] Availabe options are: d Print info about DVDs w Print info about writers b Batch mode. Only print one device name. If more than one device is found, print nothing. For use with scripts e deviceID Eject device deviceID Accecpable values: -1...num of devices Use -1 when in batch mode v Print version info and exit h Print this screen and exit Its typical usage would be to identify the DVD writer: # what-cd -dw Device /dev/hdd (id=0) can not write DVDs Device /dev/hdc (id=1) can write DVDs When used in batch mode, it will only print a device name. This is especially useful in scripts, but also in the command line, as shown in section "Burning the DVD". # what-cd -dwb /dev/hdc continue-multi-cd ------------------------------------------------------------------------------ Included in: SystemRescueCD continue-multi-cd will help you continue a multi session CD; that is will help you prepare ans burn any consecutive sessions to it. It may lack some of the functionality you would have had if you used the command line tools by themselves (mksiofs and cdrecord), but because of it, it keeps you away from writing a lot of parameters. You could use it for example, to burn some extra documentation to Clonezilla-SysRescCD CD, but you cannot use it to change the configuration files of isolinux, as it just reads the first session when booting. Its help screen is the following: # continue-multi-cd -h continue-multi-cd - v 2.0.0 - S. Georgaras Usage: continue-multi-cd [options] Available options are: d Specify write device (in case auto detection does not work) c Close the CD. No more burning will be possible Default is to leave it open l Don't burn the CD after image creation o Save the image file as r Remove the image file after burning f On the fly burning of the CD. No image file will be created v Print version info and exit h Print this screen and exit You have to note one thing though: the folder will not be present on the CD; only its contents will. Let's suppose that you want to add to the CD the folder extra-doc, which contains q-a.html and faq.html, and that its full path is /home/user/extra-doc. If you issue the command continue-multi-cd -mwr /home/user/extra-doc you will not have a extra-doc folder on the root of your CD, but the files q-a.html and faq.html will be present there. In order to have extra-doc on the CD, you have to copy it to a temporary location and pass that path to continue-multi-cd. Let's see how it's done: mkdir -p /tmp/for-the-cd cp -r /home/user/extra-doc /tmp/for-the-cd continue-multi-cd -r /tmp/for-the-cd rm -rf /tmp/for-the-cd Clonezilla-SysRescCD - Help - 08/02/2009 - v 3.1.0 On the CD ------------------------------------------------------------------------------ Clonezilla-SysRescCD contains a copy of its web site and a text file containing some of these pages. To acces them: * In Clonezilla Live Type less /live/image/README.txt * In SystemRescueCD Type less /mnt/livecd/README.txt or links /mnt/livecd/README.html to view the html pages in links web browser. Searching for text --------------------- While in less you can use the command "/" to search for text. For example, if you want to search for the word "Getting", you just type: /Getting If you want to search for a phrase containing spaces, use "\ " instead of " ". For example, if you want to search for "Getting backups", you have to type: /Getting\ backups Pressing "n" you will get to the next matching, and pressing "N" will get you to the previous one. You can move around with the keyboard arrows and PgUp-PgDn. Press q to exit. On the Net ------------------------------------------------------------------------------ Clonezilla - http://www.clonezilla.org/ Clonezilla Live - http://www.clonezilla.org/clonezilla-live/ Related articles - http://www.clonezilla.org/related_article/ DRBL - http://drbl.sourceforge.net/ DRBL FAQ/Q&A - http://drbl.sourceforge.net/faq/ DRBL Forum - http://sourceforge.net/forum/?group_id=73280 Wiki for DRBL - http://drbl.sourceforge.net/wiki/ Mailing lists - http://drbl.sourceforge.net/mailing-lists/ LIVE-INITRAMFS - http://live.debian.net/other/manpages/live-initramfs.7.html SystemRescueCD - http://www.sysresccd.org/Main_Page Detailed packages list- http://www.sysresccd.org/Detailed-packages-list Manual - http://www.sysresccd.org/Online-Manual-EN FAQ - http://www.sysresccd.org/FAQ Howto - http://www.sysresccd.org/Howto Forum - http://www.sysresccd.org/forums/ ntfs-3g - http://www.ntfs-3g.org/ Linux-NTFS - http://www.linux-ntfs.org/ Partimage - http://www.partimage.org/Main_Page Super Grub Disk Documentation - http://www.supergrubdisk.org/wiki/SuperGrubDiskDocumentation GNU GRUB (0.97) Simplified for Newbies - http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU GRUB simplified.html Smart BootManager - http://btmgr.sourceforge.net/ Clonezilla-SysRescCD - Identifying devices in Linux - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ This page is intended to help new Linux users and Windows users identify their hard disks / CD ROMs in a Linux box. Linux disks and partition names may be different from other operating systems. You need to know the names that Linux uses when you format, mount or select partitions or disks. Linux uses the so called device name to access disks and partitions. You can think of it as a link to the actual driver of the disk. All available devices have a corresponding file in /dev (e.g. /dev/hda1). In general, each disk / CD-ROM has a three letter name, for example hda. Each partition in such a disk has a number associated with it, starting from 1. So the first partition of disk hda would be hda1, the second hda2 and so on. Depending on the device type, Linux gives the following names to devices: * IDE (ATA) floppies The first floppy drive is named /dev/fd0. The second floppy drive is named /dev/fd1. * IDE (ATA) disks /CD-ROMs The master disk on IDE primary controller is named /dev/hda. The slave disk on IDE primary controller is named /dev/hdb. The master and slave disks of the secondary controller can be called /dev/hdc and /dev/hdd, respectively. Linux represents the primary partitions as the drive name, plus the numbers 1 through 4. For example, the first primary partition on the first IDE drive is /dev/hda1. The logical partitions are numbered starting at 5, so the first logical partition on that same drive is /dev/hda5. Remember that the extended partition, that is, the primary partition holding the logical partitions, is not usable by itself. This applies to SCSI disks as well as IDE disks. * SCSI disks The first SCSI disk (SCSI ID address-wise) is named /dev/sda. The second SCSI disk (address-wise) is named /dev/sdb, and so on. * SCSI CD-ROMs The first SCSI CD-ROM is named /dev/scd0, also known as /dev/sr0. The second SCSI CD-ROM is named /dev/scd1, also known as /dev/sr1, and so on. * USB disks They are named just like SCSI disks. The only difference is that the partition number has to do with the file system on the disk. If it's /dev/sdx4, then it's a VFAT file system and if it's /dev/sdx1 it's probably a linux (ext2, ext3) file system. Examples ------------------------------------------------------------------------------ In order to identify the disks of a system you have to work with, a basic knowledge of its configuration (how many disks it has, whether it's a dual-boot system etc.) is welcomed but not required. A more experienced user will not have to worry about it, though. Linux systems based on a 2.6.x kernel (like Clonezilla Live and SystemRescueCD) provide all the necessary support to identify a system's disk configuration, with just a couple of commands. Example 1 --------------------- The first system I have to work with is a dual-boot system (Windows - Linux), with two disks and two DVD-ROMs. The first command will tell me what disks and partitions exist in the system. So here it is: # cat /proc/partitions major minor #blocks name 3 0 312571224 hda 3 1 23446836 hda1 3 2 40957717 hda2 3 3 245240257 hda3 3 4 2923830 hda4 3 64 244198584 hdb 3 65 41945683 hdb1 3 66 2104515 hdb2 3 67 1 hdb3 3 68 125909437 hdb4 3 69 74236333 hdb5 The output of this command tells me that the system has two disks (hda and hdb) which are the primary master and slave devices. The first disk contains four primary partitions (hda1-hda4) and the second one four primary partitions (hdb1-hdb4) and a logical one (hdb5). Wait a minute!!! this can't be right... In order to have a logical partition, I must have a primary that contains it, which means that in this case I can't have four primary partitions. So what is really happening here is that I have two primary and two logical, plus an extended primary which contains them. What remains to be found is what type of partitions they are. I will find that out by executing the following commands: # fdisk -l /dev/hda Disk /dev/hda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 2919 23446836 7 HPFS/NTFS /dev/hda2 2920 8018 40957717+ 7 HPFS/NTFS /dev/hda3 8019 38549 245240257+ 7 HPFS/NTFS /dev/hda4 38550 38913 2923830 82 Linux swap / Solaris # fdisk -l /dev/hdb Disk /dev/hdb: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hdb1 * 1 5222 41945683+ 83 Linux /dev/hdb2 5223 5484 2104515 82 Linux swap / Solaris /dev/hdb3 5485 14726 74236365 f W95 Ext'd (LBA) /dev/hdb4 14727 30401 125909437+ 83 Linux /dev/hdb5 5485 14726 74236333+ 83 Linux Ok, this clears things up. The first disk contains three Windows XP partitions (NTFS) and a Linux Swap partition. In fact, /dev/hda1 is the system "disk" for Windows, since Windows will always be installed in the first partition of the primary master disk. The second disk, on the other hand, contains a Linux partition (/dev/hdb1), a Linux Swap partition /dev/hdb2, and an extended partition /dev/hdb3 which contains two more Linux partitions (/dev/hdb4 and /dev/hdb5). The final thing we need to know about this system is what CD/DVD-ROMs it has. So I execute the command: # cat /proc/sys/dev/cdrom/info CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: hdd hdc drive speed: 0 126 drive # of slots: 1 1 Can close tray: 1 1 Can open tray: 1 1 Can lock tray: 1 1 Can change speed: 1 1 Can select disk: 0 0 Can read multisession: 1 1 Can read MCN: 1 1 Reports media changed: 1 1 Can play audio: 1 1 Can write CD-R: 0 1 Can write CD-RW: 0 1 Can read DVD: 1 1 Can write DVD-R: 0 1 Can write DVD-RAM: 0 1 Can read MRW: 1 0 Can write MRW: 1 0 Can write RAM: 0 1 The system has two DVD-ROMs, hdc which is the secondary master and is a DVD writer, and hdd which is the secondary slave and is a DVD reader. At this point I will connect my USB stick, wait for a while and execute the command: # cat /proc/partitions major minor #blocks name 3 0 312571224 hda 3 1 23446836 hda1 3 2 40957717 hda2 3 3 245240257 hda3 3 4 2923830 hda4 3 64 244198584 hdb 3 65 41945683 hdb1 3 66 2104515 hdb2 3 67 1 hdb3 3 68 125909437 hdb4 3 69 74236333 hdb5 8 0 1007615 sda 8 4 1006576 sda4 As you can see, we have two more lines here, that reflect the changes to our system (the connection of the USB device). So my USB stick is recognized by the system as sda, and the disk itself contains a VFAT file system. Example 2 --------------------- The second system is a Linux box with one SCSI disk and a CD-ROM. Again I issue the command: # cat /proc/partitions major minor #blocks name 8 0 156290904 sda 8 1 64228 sda1 8 2 15735667 sda2 8 3 15735667 sda3 8 4 124744725 sda4 From its output I see I only have one disk sda, which contains four partitions. Then I execute fdisk, which shows me that the disk contains one DOS and three Linux partitions. # fdisk -l /dev/hdb Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 8 64228+ 6 FAT16 /dev/sda2 9 1967 15735667+ 83 Linux /dev/sda3 1968 3926 15735667+ 83 Linux /dev/sda4 3927 19456 124744725 83 Linux Finally I query its CD-ROMs, by executing the command: # cat /proc/sys/dev/cdrom/info CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: hda drive speed: 0 drive # of slots: 1 Can close tray: 1 Can open tray: 1 Can lock tray: 1 Can change speed: 1 Can select disk: 0 Can read multisession: 1 Can read MCN: 1 Reports media changed: 1 Can play audio: 1 Can write CD-R: 1 Can write CD-RW: 1 Can read DVD: 1 Can write DVD-R: 0 Can write DVD-RAM: 0 Can read MRW: 1 Can write MRW: 1 Can write RAM: 0 Which tells me that I only have an IDE CD-ROM, (hda), which is actually a CD writer. Then I connect my USB stick, and I get: # cat /proc/partitions major minor #blocks name 8 0 156290904 sda 8 1 64228 sda1 8 2 15735667 sda2 8 3 15735667 sda3 8 4 124744725 sda4 8 16 1007615 sdb 8 20 1006576 sdb4 Although it's the same stick I used with the previous system, which was recognized as sda there, now its name is sdb. So, its name depends on the system it is connected to, and will not always be the same. SCSI disks when there are none!!! ------------------------------------------------------------------------------ I am confused!!! I am on a disk with two ATA (PATA) disks, but when I query the partition list, this is what I get: # cat /proc/partitions major minor #blocks name 3 0 312571224 sda 3 1 23446836 sda1 3 2 40957717 sda2 3 3 245240257 sda3 3 4 2923830 sda4 3 64 244198584 sdb 3 65 41945683 sdb1 3 66 2104515 sdb2 3 67 1 sdb3 3 68 125909437 sdb4 3 69 74236333 sdb5 According to what's discussed up to now, the system seems to have two SCSI disks, but I know it actually has two ATA (PATA) disks. What's going on?. What is really happening here is that you have one of the newest Linux kernels (using the libata disk driver), which shows ALL disks as SCSI. That does not mean that the system thinks it has SCSI disks, it just names them as such. To make is clear, execute the commands: # hdparm -i /dev/sda /dev/sda: Model=WDC WD3200AAJB-00TYA0 , FwRev=00.02C01, SerialNo= WD-WCAPZ0648927 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq } RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=?16? CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 AdvancedPM=no WriteCache=enabled Drive conforms to: Unspecified: ATA/ATAPI-1,2,3,4,5,6,7 * signifies the current active mode # hdparm -i /dev/sdb /dev/sdb: Model=WDC WD2500JB-00GVC0 , FwRev=08.02D08, SerialNo= WD-WCAL76141931 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq } RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=74 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=?16? CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 AdvancedPM=no WriteCache=enabled Drive conforms to: Unspecified: ATA/ATAPI-1,2,3,4,5,6 * signifies the current active mode This is also valid for the CDs/DVDs of the system: # cat /proc/sys/dev/cdrom/info CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: sr1 sr0 drive speed: 0 126 drive # of slots: 1 1 Can close tray: 1 1 Can open tray: 1 1 Can lock tray: 1 1 Can change speed: 1 1 Can select disk: 0 0 Can read multisession: 1 1 Can read MCN: 1 1 Reports media changed: 1 1 Can play audio: 1 1 Can write CD-R: 0 1 Can write CD-RW: 0 1 Can read DVD: 1 1 Can write DVD-R: 0 1 Can write DVD-RAM: 0 1 Can read MRW: 1 0 Can write MRW: 1 0 Can write RAM: 0 1 While the hdparm shows they are ATA devices: # hdparm -i /dev/sr0 /dev/sr0: Model=HL-DT-ST DVDRAM GSA-H42L , FwRev=SL01 , SerialNo=K286CQF2231 Config={ Fixed Removeable DTR10Mbs nonMagnetic } RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0 BuffType=unknown, BuffSize=0kB, MaxMultSect=0 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 *udma2 udma3 udma4 AdvancedPM=no Drive conforms to: unknown: ATA/ATAPI-4,5,6,7 * signifies the current active mode Clonezilla-SysRescCD - Some theory on disks - 08/02/2009 - v 3.1.0 Intro ------------------------------------------------------------------------------ When working with with disks/partitions and system backup, restoration and rescue, it is vital to have a very good understanding of the basic concepts of booting, partitioning etc. This page is by no means a guide to these concepts. It just pin-points some of them, so the user can look them up in more thorough sources. What is a file system? ------------------------------------------------------------------------------ A file system is the way in which files are named and where they are placed logically for storage and retrieval. The DOS, Windows, OS/2, Macintosh, and UNIX-based operating systems all have file systems in which files are placed somewhere in a hierarchical (tree) structure. A file is placed in a directory (folder in Windows) or subdirectory at the desired place in the tree structure. File systems specify conventions for naming files. These conventions include the maximum number of characters in a name, which characters can be used, and, in some systems, how long the file name suffix can be. A file system also includes a format for specifying the path to a file through the structure of directories. Each operating system provides special tools to initialize/format the file system types it supports. Examples of such tools are format in DOS/Windows, mkdosfs and mkfs in Linux, etc. What is a partition? ------------------------------------------------------------------------------ A partition is a logical division of a hard disk created so that you can have different operating systems on the same hard disk or to create the appearance of having separate hard drives for file management, multiple users, or other purposes. In Windows, a one-partition hard disk is labelled the "C:" drive ("A:" and "B:" are typically reserved for diskette drives). A two-partition hard drive would typically contain "C:" and "D:" drives. (CD-ROM drives typically are assigned the last letter in whatever sequence of letters have been used as a result of hard disk formatting, or typically with a two-partition, the "E:" drive.). In UNIX-based systems, a partition is used to host the / (root) file system, and optionally the /opt, /usr and /home file systems. There may also be a swap partition, which doesn't host any file system. Each operatin system provides some kind of tool to create and manage partitions. Examples of such tools are fdisk in DOS/Windows, fdisk, sfdisk and parted in Linux, etc. What is the MBR? ------------------------------------------------------------------------------ When you boot an operating system into your computer, a critical part of the process is to give control to the first sector on your hard disk, which is called the Master Boot Record (MBR). The Master Boot Record is also sometimes called the "partition sector" or the "master partition table" because it includes a partition table that defines how many partitions the hard disk has, the size of each, and the address where each partition begins. What is the Boot Loader? ------------------------------------------------------------------------------ A boot loader, also called a boot manager, is a small program which usually resides in the MBR of the first disk (i.e. primary master ATA disk) of the system, that places the operating system (OS) of a computer into memory. Microsoft Windows or the Mac OS provide their own Boot Loaders, beeing able to load only the operating system in question. Linux, on the other hand, provides two alternatives: LILO and GRUB, which have Multiboot capabilities. Managing partitions ------------------------------------------------------------------------------ All the programs presented previously are able to create and delete partitions on any disk, with qparted at the top of the list, as it is a graphic tool. Changing the ID (type) of a partition is easy using qparted, but it is as easy with sfdisk. In order to change a FAT32 partition to HPFS/NTFS (NTFS), the following command is enough: sfdisk --change-id /dev/hda1 c 7 where c: existing partition ID 7: new partition ID Of course the partition will be usable only after it is formated with NTFS format, or after restoring a NTFS partition to it, using Clonezilla Live. Finally, enlarging a partition is a two step process: * Resizing the partition itself * Resizing the file system contained within Fortunatelly, Clonezilla Live takes care of both these steps for us, when instructed to do so (using the parameter -r). Partition list --------------------- The following table presents known partition types along with their IDs: 0 Empty 80 Old Minix 1 FAT12 81 Minix / old Linux 2 XENIX root 82 Linux swap / Solaris 3 XENIX usr 83 Linux 4 FAT16 <32M 84 OS/2 hidden C: drive 5 Extended 85 Linux extended 6 FAT16 86 NTFS volume set 7 HPFS/NTFS 87 NTFS volume set 8 AIX 88 Linux plaintext 9 AIX bootable 8e Linux LVM a OS/2 Boot Manager 93 Amoeba b W95 FAT32 94 Amoeba BBT c W95 FAT32 (LBA) 9f BSD/OS e W95 FAT16 (LBA) a0 IBM Thinkpad hibernation f W95 Ext'd (LBA) a5 FreeBSD 10 OPUS a6 OpenBSD 11 Hidden FAT12 a7 NeXTSTEP 12 Compaq diagnostics a8 Darwin UFS 14 Hidden FAT16 <32M a9 NetBSD 16 Hidden FAT16 ab Darwin boot 17 Hidden HPFS/NTFS b7 BSDI fs 18 AST SmartSleep b8 BSDI swap 1b Hidden W95 FAT32 bb Boot Wizard hidden 1c Hidden W95 FAT32 (LBA) be Solaris boot 1e Hidden W95 FAT16 (LBA) bf Solaris 24 NEC DOS c1 DRDOS/sec (FAT-12) 39 Plan 9 c4 DRDOS/sec (FAT-16 3c PartitionMagic recovery c6 DRDOS/sec (FAT-16) 40 Venix 80286 c7 Syrinx 41 PPC PReP Boot da Non-FS data 42 SFS db CP/M / CTOS / ... 4d QNX4.x de Dell Utility 4e QNX4.x 2nd part df BootIt 4f QNX4.x 3rd part e1 DOS access 50 OnTrack DM e3 DOS R/O 51 OnTrack DM6 Aux1 e4 SpeedStor 52 CP/M eb BeOS fs 53 OnTrack DM6 Aux3 ee EFI GPT 54 OnTrackDM6 ef EFI (FAT-12/16/32) 55 EZ-Drive f0 Linux/PA-RISC boot 56 Golden Bow f1 SpeedStor 5c Priam Edisk f4 SpeedStor 61 SpeedStor f2 DOS secondary 63 GNU HURD or SysV fd Linux raid autodetect 64 Novell Netware 286 fe LANstep 65 Novell Netware 386 ff BBT 70 DiskSecure Multi-Boot 75 PC/IX The partitions you are most likely to see in use, are: * FAT16 (ID = 6) This is the old DOS partition type You may still find it in pure DOS installations, like vendor diagnostics tool partitions, and small USB sticks (128 - 250 MB) * HPFS/NTFS (ID = 7) This is the Windows XP partition, also known as NTFS * W95 FAT32 (LBA) (ID = c) This is the Windows 95 - 98 partition It is used in any kind of disk and large USB devices (1 GB and more) * W95 Ext'd (LBA) (ID = f) Extended partition. It acts as a container for other partitions There is one more extended partition type (ID = 5), but it does not seem to be in use as much * Linux swap / Solaris (ID = 82) Swap partition, acting as Virtual Memory Modern computers with 1 - 2 GB of memory may not use it at all * Linux (ID = 83) Linux partitions, like ext2, ext3 and reiserfs