Clonezilla select the home partition to copy. Cloning a customized operating system using Clonezilla. Installing CloneZilla SE


Any administrator sooner or later thinks about backup(backup) of important files and directories, but it is equally important to create backup copies of operating system partitions, since installing from scratch operating system and its re-customization to the needs of the enterprise is a long and complex procedure.

As one of the backup options, you can create archived images of operating systems using CloneZilla class programs. CloneZilla will help you create an archived version of the image and restore it in case of failure.

Let's consider the following steps:

Creating an image of the server partition and recording it via SSH to the backup server

In this paragraph, we will consider the steps that will help us boot from the CloneZilla LiveCD and obtain a server image, which will be saved on a backup server using the secure SSH protocol.
First you need to get the current stable version of CloneZilla, go to clonezilla.org and download iso image.
Burn it as an image onto a blank disc and get your own bootable CloneZilla LiveCD.

Boot from the CloneZilla LiveCD. Simply wait for the timeout to expire or press Enter to accept the default selection. Specify your language as Russian and layout type.

We need to select a mode for working with disks or partitions using images (device-image).

CloneZilla can work by saving images to local HDD, upload the image via a secure SSH channel, use Windows shares using Samba, work with the native Linux network file system NFS. CloneZilla will mount the path we specify to its /home/partimag/ directory and work with it.
In this case, we will use SSH to send the image to the backup server.

Need to set settings network card to later upload the system image to a backup server over the network using SSH. Settings can be obtained automatically using DHCP or specified manually. The example shows manual (static) settings; your network card settings should allow you to contact the backup server.

Specify address and port SSH servers, usually this is port 22. Specify the username that can connect via ssh to the backup server.
Enter the correct path on the backup server where you have permission to write the image.

If everything is specified correctly, then a connection to your backup server should occur. When you first connect to your SSH backup server, you should see the standard ssh warning.

Specify the startup mode of the Beginner wizard and the savedisk mode to save the image.

Enter the name of the image to be saved and what exactly you are going to save

Now all that remains is to wait for the work to complete and get the saved disk image.

You can check that while CloneZilla is running, a saved system image appears on your backup server.
In my case, you can see that the server image was saved to the /mnt/disk1/clones/test/ directory I specified under the name test_2011-02-16-9-img on a backup server with IP 192.168.0.11. The files belong to the user adminbius, since using this account we logged in via ssh to 192.168.0.11. You can see that in addition to the image of the partitions, CloneZilla saved the main boot entry MBR and system information in Info* files. The image is compressed and therefore takes up less space than the original.

Restoring an image of a server partition via SSH from a backup server

When restoring an image, you need to go through the same steps as when saving an image. Since you need to specify the network card settings and ssh access parameters. The differences begin with restoredisk.

Now you need to select the image from which the disk will be restored.

Specify the disk to which the image will be restored.

Monitor your recovery progress with Partclone.

Very often, especially among inexperienced Linux users, as a result of installing new kernels, drivers and other experiments, the system becomes inoperative, and it can be extremely difficult to revive it without the proper skills. Don’t be discouraged, in this case, system recovery from backup copy. The problem is that everyone has heard about backup, but not everyone understands how it works.

In this article, I will look at a simple way to create a system backup and then restore it using the tool Clonezilla Live.

First, download the image iso from the official one.

For example, stable image .

We create bootable USB flash drive in any usual way. You can use or more advanced . If you installed the system from a flash drive, this process should be familiar to you; we will not dwell on it.

By creating a bootable USB flash drive Clonezilla Live, boot from it, setting it to Bios priority our flash drive. As a result, the following screen should open in front of us:


Click Enter, select Russian language:


Choose "Don't touch the layout":

Choose "Launch Clonezilla":


Then select device-image, for working with disks and partitions:


Then select local-dev, because we will save to a local device, and not to a remote server:


Next comes the crucial stage - you need to select a hard drive or other storage device, on which (and exactly on which) we will keep a backup copy, in my case it will be a flash drive(different!), because I used to take screenshots virtual machine. In your case, it could be anything - either a flash drive (for the first time, preferably), or separate hard drive partition, usually used as "file dumpsters", or a separate physical hard drive if available, or even an NTFS partition containing your Windows if it is installed as a second system. If you want to use a flash drive, insert it in response to this prompt (in yellow), if not, just press enter:


So, based on the considerations above, we select a device for storing backups (or, as it is loudly called in Clonezilla, Image repository). In my case, as was said, this is a flash drive:


Note: The words "repository" and "images" should not mislead you. Repository, in this case, it’s just a “storage”, and image- this is just a folder where a copy of your system will be compressed by the archiver.

Choose directory on the device, in which we will save the image, I prefer the root one, so as not to get confused:

Then there will be a short media check, when finished just press Enter:


Next, the selection of settings wizard mode will open, select Beginner(for newbies):


Next, select
or savedisk, to save the entire disk,
or saveparts if we want save partitions
I chose saveparts, since in reality we are most often interested in copying the Linux partition/partitions. Note: Copying the entire disk is usually not necessary unless you want to "storage" a partition on the same disk is selected, it will not be possible at all:


Enter name of the copy being created eg based on date:


Then select our ext4 partition (or partitions), which we will make a copy of (marks in the list preceded by a space, I got the only item on my virtual machine):


Then we indicate whether we will check disk before creating a backup:


And will we check the image after creation:


This is almost all over. Questions will be asked, we will answer ALL of them. y and click Enter:


And now the backup will go:


When checking the image, if it was selected, a similar window pops up again:

All you have to do is wait for the work to complete and restart the computer following the instructions Clonezilla.

Backup files in file manager look something like this:

Restoring from a backup using Clonezilla

Restoration follows the same general principle - first we specify the “repository”, Where lies the image, then select the image itself, and finally we indicate target partition on the disk on which we will “deploy” this image.

So, let's download Clonezilla, do everything as in the previous paragraph and get to the disk selection screen where the backup is located:

If you are not familiar with the problem when, due to an incorrect Ubuntu update or the pranks of another virus in Windows, the system needs to be raised from its knees, then the rest will be boring.

Backup is insurance system administrator. Usually they backup data that can be irretrievably lost - 1C databases, files and folders, Oracle database, DHCP configs, etc. What happens to the PC on which an ordinary clerk works if the HDD suddenly dies? The whirlwind begins - we install the OS, roll out the software, accounts, printers, etc.
But what about top directors, chief accountants and other important personalities who, firstly, need it as it was, and secondly, a working and configured computer in 30-60 minutes?

Use Clonezilla Server (CE)!

CE is a logical continuation of Clonezilla, its online brother.
For reference, Clonezilla is free software with open source code, designed for cloning disks and individual partitions hard drive, as well as creating backup copies and disaster recovery systems.

Clonezilla itself is a find. Download LiveCD, boot, and in a few clicks ENTER, backup of partitions or the entire HDD to another HDD, which can be external, begins USB disk. Of course, the copy is not a dd with a bitwise copy, it will be equal to the amount of occupied disk space and in compressed form.

Clonezilla is compatible with such file systems as: FAT, NTFS, ext2, ext3, ext4, reiserfs, reiser4, XFS, JFS, JFS, VMFS and HFS+.

Those. for one-time Clonezilla backup operations - more than.
Important note: CE does not differentiate between software RAID and splits it into separate devices!

CE helps us out when

  1. There are a dozen PCs of the same type, without an OS. We install the OS and the necessary software on the first PC, make a “snapshot”, and deploy it over the network simultaneously on the remaining ones.
  2. Backup of one or more PCs, over the network, preferably at night.
I don’t see the point in writing about installing CE, since it has already been written more than once.

How to wake up your PC at night? Wake On Lan! We check Motherboard WOL support and read the instructions for enabling it. By the way, my p5b-deluxe was never able to wake up, but the cheap P5KPL-CM had no problems.

By putting CE, you are convinced that the thing is inflexible. It installs its own DHCP, which is then used to load stations, and checks that the IP address of the CE server and the IP address of the cloned system match up to 3(!) digits. If there is a mismatch, set the IP address of the NFS server to whatever you like.

Hence the following useful changes

On an already installed DHCP server on the network, configure:
  1. Parameter 066 - IP address of the CE server
  2. Parameter 067 - pxelinux.0
Next, remove the name check DHCP servers:
/opt/drbl/sbin/mknic-nbi -c n
  1. edit the file /tftpboot/node_root/sbin/init
  2. change IP_prefix="$(echo $IP | cut -d"." -f1-3)" to IP_prefix="$(echo $IP | cut -d"." -f1-2)"
We change the final directory for backup from local /home/partimag to the SMB share of the backup server, to do this we add the SMB share parameters in the file /tftpboot/nodes/$IP/etc/fstab, then create a template:
/opt/drbl/sbin/drbl-gen-ssi-files $IP

Well, to top it off, I whipped up a script to wake up the computer via IP and then backup the HDD clonerHDD.

Still to come:

  1. Rotate backups so that there are no more than two backups from one machine
  2. Send backup status, size and machine name to Nagios
  3. Add to the script by adding restore from backup by command

Some machine, e.g. Asus Eee PC or Acer Aspire One, comes without CD/DVD drive. In this case, an USB flash drive or USB hard drive is the best way to boot Clonezilla live. You can follow the following to make a bootable Clonezilla live USB flash drive or hard drive using either or .

Requirement:

  1. Microsoft Windows 2000/XP/Vista/7, or GNU/Linux.
  2. Internet access for downloading a distribution to install, or a pre-downloaded ISO file.
  3. An USB drive with a FAT or NTFS partition. If you are making this bootable USB flash drive on GNU/Linux, more file systems, including ext,btrfs,xfs,ufs,ffs can be used for the USB flash drive.

USB setup with MS Windows

Choose one of the following methods to setup Clonezilla Live on your USB flash drive using MS Windows:

MS Windows Method A: Tuxboot

  1. Download Tuxboot on your MS Windows computer.
  2. From MS Windows, run the Tuxboot program and follow the instructions in the GUI to install Clonezilla Live on your USB flash drive.

MS Windows Method B: Manual

WARNING! DO NOT RUN makeboot.bat from your local hard drive!
Doing so could cause your MS windows not to boot!!!

  1. Download the Clonezilla Live zip file.
  2. If you already have a partition of at least 200 MB in size on your USB flash drive formatted with a FAT or NTFS file system then skip to the next step (3).
    Otherwise create at least a 200 MB partition on your USB flash drive and format it with a FAT16/FAT32 or NTFS file system.
  3. Extract all the contents of the zip file to the FAT16/FAT32 or NTFS partition on your USB flash drive. Keep the directory architecture, for example, file "GPL" should be in the USB flash drive"s top directory (e.g. G:\GPL).
  4. Browse to your USB flash drive and as an administrator , (On the USB flash key, create a shortcut to the makeboot.bat file. Then right-clic on the shortcut, Properties, Advanced and check "Run as administrator".), click the makeboot.bat in the dir utils\win32\ (for 32-bit Windows) or makeboot64.bat in the dir utils\win64\ (for 64-bit Windows). WARNING! Makeboot.bat must be run from your USB flash drive.
    If you are an experienced user, open a command prompt as Administrator, navigate to the root of the USB flash key and enter \utils\win32\makeboot or \utils\win64\makeboot, depending on the flavor of Windows you are running.
  5. Follow the on-screen instructions.
    (PS: The above description is modified from: http://www.pendrivelinux.com/2007/01/02/all-in-one-usb-dsl. Thanks to PDLA from http://pendrivelinux.com)

MS Windows Method C: Unetbootin (Not Recommended)

  1. If you already have Unetbootin installed on your computer then skip to the next step (2).
    on your MS Windows computer.
  2. Download the Clonezilla Live iso file.
  3. From MS Windows, run the Unetbootin program and follow the instructions in the GUI to install Clonezilla Live on your USB flash drive.
    NOTE:

Windows Method D: LinuxLive USB Creator

  1. If you already have LinuxLive USB Creator installed on your computer then skip to the next step (2).
    Otherwise download and install LinuxLive USB Creator on your MS Windows computer.
  2. Download the Clonezilla Live iso file.
  3. From Windows, install then run the LinuxLive USB Creator program and follow the instructions in the GUI to install Clonezilla Live on your USB flash drive.

MS Windows Method E: Rufus USB Creator

  1. If you already have Rufus installed on your computer then skip to the next step (2).
    Otherwise download and install Rufus on your MS Windows computer.
  2. Download the Clonezilla Live iso file.
  3. From MS Windows, run the Rufus program and follow the instructions in the GUI to install Clonezilla Live on your USB flash drive.

USB setup with GNU/Linux

Choose one of the following methods to setup Clonezilla Live on your USB flash drive using GNU/Linux:

GNU/Linux Method A: Tuxboot

  1. Download Tuxboot on your GNU/Linux computer.
  2. From GNU/Linux, follow the instructions and the GUI to run Tuxboot to install Clonezilla Live on your USB flash drive.

GNU/Linux Method B: Manual

WARNING! Confirm you have the correct path name before executing commands!
Failure to do so could cause loss of data or your GNU/Linux not to boot!!!
/dev/sdd is a device path name
/dev/sdd1 is a partition path name

  1. Download the Clonezilla Live zip file.
  2. If you already have a FAT or NTFS partition on your USB flash drive then skip to the next step (3).
    Otherwise prepare at least a 200 MB partition formatted with either a FAT16/FAT32 or NTFS file system.
    If the USB flash drive or USB hard drive does not have any partition, you can use a partitioning tool (e.g. gparted, parted, fdisk, cfdisk or sfdisk) to create a partition with a size of 200 MB or more.
    Here we assume your USB flash drive or USB hard drive is /dev/sdd ( You have to confirm your device name, since it"s _NOT_ always /dev/sdd) on your GNU/Linux, so the partition table is like: # fdisk -l /dev/sdd Disk /dev/sdd: 12.8 GB, 12884901888 bytes 15 heads, 63 sectors/track, 26630 cylinders Units = cylinders of 945 * 512 = 483840 bytes Disk identifier: 0x000c2aa7 Device Boot Start End Blocks Id System /dev/sdd1 * 1 26630 12582643+ b W95 FAT32 Then format the partition as FAT with a command such as "mkfs.vfat -F 32 /dev/sdd1"
    WARNING! Executing the mkfs.vfat command on the wrong partition or device could cause your GNU/Linux not to boot. Be sure to confirm the command before you run it.# mkfs.vfat -F 32 /dev/sdd1 mkfs.vfat 2.11 (12 Mar 2005)
  3. Insert your USB flash drive or USB hard drive into the USB port on your Linux machine and wait a few seconds. Next, run the command "dmesg" to query the device name of the USB flash drive or USB hard drive. Let"s say, for example, that you find it is /dev/sdd1. In this example, we assume /dev/sdd1 has FAT filesystem, and it is automatically mounted in dir /media/usb/. If it"s not automatically mounted, manually mount it with commands such as "mkdir -p /media/usb; mount /dev/sdd1 /media/usb/".
  4. Unzip all the files and copy them into your USB flash drive or USB hard drive. You can do this with a command such as: "unzip clonezilla-live-2.4.2-32-i686-pae.zip -d /media/usb/"). Keep the directory architecture, for example, file "GPL" should be in the USB flash drive or USB hard drive"s top directory (e.g. /media/usb/GPL).
  5. To make your USB flash drive bootable, first change the working dir, e.g. "cd /media/usb/utils/linux", then run "bash makeboot.sh /dev/sdd1" ( replace /dev/sdd1 with your USB flash drive device name), and follow the prompts.
    WARNING! Executing makeboot.sh with the wrong device name could cause your GNU/Linux not to boot. Be sure to confirm the command before you run it.

    NOTE: There is a known problem if you run makeboot.sh on Debian Etch, since the program utils/linux/syslinux does not work properly. Make sure you run it on newer GNU/Linux, such as Debian Lenny, Ubuntu 8.04, or Fedora 9.

T.I.P.: If your USB flash drive or USB hard drive is not able to boot, check the following:

  • Ensure that your USB flash drive contains at least one FAT or NTFS partition.
  • Ensure that the partition is marked as "bootable" in the partition table.
  • Ensure that the partition starts on a cylinder boundary.
    For the first partition this is usually sector 63.

GNU/Linux Method C: Unetbootin (Not Recommended)

  1. If you already have Unetbootin installed on your computer then skip to step 2.
    Otherwise install on your GNU/Linux computer.
  2. Download the Clonezilla Live iso file.
  3. From GNU/Linux, run the Unetbootin program and follow the instructions in the GUI to install Clonezilla Live on your USB flash drive.
    NOTE: The boot menu created by Unetbootin is not exactly the same as the boot menu created in method A. Therefore it is recommended to use method A.

Many professional backup programs, in addition to the function of backing up individual files, also provide the ability to create exact copies of partitions or even entire disks. IN the latter case redundancy is also often called cloning. It is used mainly in a corporate environment for deploying a customized operating system on several computers, but with the same success it can be used to transfer the OS and user files to new computer, which is what we are actually going to demonstrate.

To create a disk clone we will use the free professional program Clonezilla. It is intended for backing up, cloning and restoring partitions and disks from images, while the created backup or disk clone can be stored on a second hard drive, removable media and remote server(SSN, Samba, NFS, WebDav, S3 and Swift servers are supported). Clonezilla is distributed as a bootable ISO image based on Linux; all backup (cloning) operations are performed exclusively from LiveCD.

So, to create a copy of the disk, we need the program itself and a second hard drive connected to the PC, which has an equal or larger capacity than the one being copied. There is also a new computer with an unpartitioned disk onto which we will deploy the cloned disk. Let's go to the developer's website clonezilla.org/downloads.php and download the ISO image with the program, not forgetting to select the processor architecture.

If you have AMD, in the “Select CPU architecture” item we leave amd64, if Intel, select accordingly i386.

Before you start cloning, it is advisable to prepare the system using the built-in console utility Sysprep. Go to the address in Explorer C:/Windows/System32 and run the executable sysprep.exe. The system preparation program window will open.

For cleaning action, select “Go to the system welcome window (OOBE)”, check the “Preparing for use” checkbox, select the shutdown option, select “Shut down” and click “OK”. After the utility has completed its work, the computer will turn off.

Note: Using the Sysprep system data reset utility is optional. It is used mainly when deploying Windows on corporate computers; in the case of a home transfer of the system to a new PC, it can be neglected, this will save you from the need to re-set user parameters.

After that, boot from the Clonezilla disk, select “Other modes of Clonezilla live” from the menu, select the appropriate screen resolution and wait for the wizard window to load.

To select settings, use the arrow keys, and to apply them, use the Enter key. Next, select the interface language.

We leave the layout as default.

In the next window, click “Launch Clonezilla”.

Then you will need to select the cloning mode. The choice of mode is not particularly important; we chose “directly from disk to disk or from partition to partition.”

Leave the settings level at default.

Type of cloning: select “clone” local disk to local disk."

Then we specify the target disk on which the backup copy will be written. In Clonezilla it is labeled sdb.

Before starting the main operation, the program will prompt you to check the integrity file system. Whether we check or skip, it’s up to you to decide.

In the next window, indicate the action upon completion of cloning (reboot or shutdown the PC).

Press Enter and confirm all requests by entering Y (yes).

The cloning procedure will begin.

Approximately the same scenario is used to deploy a clone to a new computer. By connecting a disk with backup copy, boot from Clonezilla and repeat all the steps until you select the source and destination disk. Here we do everything the other way around. The source will be the disk with the copy, the destination will be new disk on another computer. We confirm the actions by entering Y as described above. Once cloning is complete, turn on the computer.

The system will boot, but before that it will prepare the devices, and since the system data was previously reset by the Sysprep utility, you will also need to perform some basic custom settings: select language, accept license agreement, create a new local account.

If the hard disk on which the image was restored is larger than the disk from which the copy was made, we recommend going to the disk manager and determining the resulting unallocated space, for example, creating a new volume in its place or attaching it to an existing partition. Naturally, we physically disconnect the second disk with the clone from the computer.

That's all. We hope that the instructions provided will be useful to you.