Cloning hard drives using Clonezilla. Backup and restore your system using Clonezilla Live Clonezilla installation

CloneZilla is one of the best tools for system backup with open source code for Linux. Absence GUI doesn't make it any worse. On the contrary, there is an intuitive, easy and fast wizard command line, with which you can do everything you need. This is the perfect tool for everyone system administrator.

With CloneZilla you can completely copy a partition hard drive another HDD and then it is very easy to restore it. Additionally, you can backup clonezilla over the network, using ssh, samba or NFS and store such images in local storage.

In case of any problems, you can very easily restore all data from backup disk. For example, if the system breaks down, if there was a copy, you can deploy the previously created image and return the system to working order in a matter of minutes.

In this article we will look at how CloneZilla disk cloning is performed, and we will be interested in any block devices. It doesn't matter if you're cloning a partition or an entire hard drive, any block devices will do. The distribution is also unimportant, since everything will be run using the CloneZilla LiveCD image.

First, we need the CloneZilla LiveCD image, which can be downloaded from the official website. The image must be written to a flash drive or disk. I won't go into detail on how to do this.

Secondly, to perform a hard drive backup in Linux, we will need another physical hard drive connected to the same system. Moreover, it must be the same volume or larger than the disk that we want to copy. To clone a CloneZilla partition, a free partition with the same size will be enough. This is needed to record the image.

Disk cloning CloneZilla

Once everything is ready, you can start creating the clonezilla image. We will divide all actions into steps to make it easier for you to navigate what needs to be done.

After the LiveCD image is downloaded and burned to a USB flash drive, connect this media to your computer and reboot. During the BIOS splash screen, press the F11, F12, Del, F2 or Shift+F2 button to enter the Bios menu and configure it to boot from your media there.

Step 2: Bootloader Screen

After this, the bootloader will appear on the screen. In it, select the first item to launch Clonezilla Live with standard settings and a screen resolution of 800x600. Press Enter to select.

Step 3: Select a language

When the system boots into RAM, a wizard will appear in which you have to select the system language. To move through items, use the up/down arrows, and to select Enter:

Step 4. Setting up the layout

On this screen you can customize your keyboard layout. Just choose Don't touch keymap and press Enter:

Step 5: Launch CloneZilla

From this screen you can launch the interactive CloneZilla wizard or go to the console. Select Start Clonezilla:

Step 6. Choosing a method of operation

You can clone a Linux hard drive directly from disk to disk or from disk to image. Choose the option that is more convenient for you, in this article we will select from disk to disk:

Make sure both drives are connected to the computer if you are going to clone a hard drive in Linux.

Step 7. Number of settings

On the next screen, you can choose how much detail you want to customize the process. To get started, select the beginner mode, with default settings. Beginner Mode.

Then on the next tab choose what you need to do. In our case, the first point is to save the disk. Savedisk.

Step 8: Select a copy mode

There are four disk cloning modes available:

  • disk_to_local_disk- local disk to another local disk;
  • disk_to_remote_disk- local disk to remote disk;
  • part_to_local_part- partition to local partition;
  • part_to_remote_part- partition to remote partition.

If we had selected the disk for the image in the sixth step, then we would have had other options. We will copy our local drive to another hard drive connected to this computer. The program will perform a full cloning of the Clonezilla disk, all partitions will be copied, as well as the MBR or GPT area.

Step 9. Source selection

At this step of the wizard, we need to select the source disk that will be used for cloning. Here, in addition to the disk number in the system (sda, sdb), its name and serial number, so you can choose required disk easily.

After selecting the drive, press Enter.

10. Selecting a disc to burn

Next, select the second disk to record to. Be very careful because the program will erase all data on this disk. And if you make a mistake, the result will be completely the opposite of what was planned.

11. File system check

If you are sure that file system is not damaged, you can choose to skip the check Skip checking:

After this you will need to press Enter again.

Step 12. Confirmation

Before starting the backup, the utility will display some information about the selected drives and its operation. You will need to press twice Y:

Step 13: Copy

While the disk is being copied, Clonezilla will display a progress bar so you can estimate how much data and time is left.

Step 14: Finishing

Once the copying is completed, you will be provided with information about the entire process and result. Press Enter and in the menu that appears you can choose what to do next. To turn off, select poweroff.

That's all. In case of failure, you can use this disk instead of the damaged one, or if the experiment is unsuccessful, you can recover all the data from it. In the same way, partition cloning and cloning to a Clonezilla image are performed. Next, we'll look at restoring the Clonezilla image.

Clonezilla Disk Recovery

The initial boot and all steps to prepare the system for operation are performed in the same way as for cloning a clonezilla hard drive in Linux. Everything up to step 7. You just need to select not disk_to_disk, but disk_to_image in order to work with disk images.

Step 1. Select an action.

Step 2: Location

We select where we will take the image from, local_dev, local device:

Step 2. Selecting an image

At this step you have to select the image or disk from which we will restore:

Step 3. Disc to burn

Clonezilla, I don’t know how many people have heard about this mini OS designed to work with hard drives, I personally became acquainted with it recently. I have a small fleet of computers, and basically they are all the same, 3x11 (33 computers in total), I had to rearrange everyone’s “favorite” Windows XP. The question arose of how to clone it to other PCs, the first thing that came to mind was, of course, Acronis True Image, I created a disk image without any problems, copied it to the computers on which it will be deployed, created bootable USB flash drive with Acronis True Image (using this site http://flashboot.ru/ the necessary files from it Acronis utility and image. But to my regret, it did not load on all computers, not because of crooked hands, if anything. I started googling , came across http://clonezilla.org/
Naturally interested, I downloaded it. Small manipulations in unetbootin? which I suppose is not worth describing here, anyone can figure it out.
1. From the list of distributions you need to select Clonezilla
2. Next, indicate where your image is located.
3. Select your flash drive
4. Click ok
5. The program will ask a couple of idiotic questions during the installation process.
The entire flash drive is ready and the information will most likely be saved on it; in my case, it remained untouched.

Well, now the main surprises that I learned without reading the manuals about this miracle distribution.
You can:
1. Create image of a tough disk or partition.
2. Format the file system of the partition to ntfs.
3. Deploy the image to the partition.
4. Clone a partition in real time to a remote computer.

I don’t know what else she can do, but that’s enough for me for now.
I will describe option 4, what to do and how to do it.

1.Insert the flash drive into the computer (the source from which we will clone the partition)
2. Reboot it or turn it on, launching the boot selection menu (F12, F8, F2, Esc) is different for each manufacturer.
3. Select 1 item Clonezilla live.
4. Select a language en_US.UTF-8(there is no alternative like ru_RU)
5. Don't touch the keyboard layout Don't Touch keymap
6. The system is loaded, you can start cloning.
7. write sudo -i(this is how we get root rights) (if we booted from an image recorded on a CD-ROM, then we will be prompted to immediately launch clonezilla and this and point 8 can be skipped)
8. write clonezilla and we start a pseudo graphical interface.
9. Choose Device-Device

11. Well, now the most interesting thing, we choose how and where we will clone.
There are options:
1. C local disk to local disk.
2. From local disk to remote disk.
3. From local Partition to local partition.
4. From local partition to remote partition


We choose 4th item: part_to_remote_part

12. After this, we will be asked to set up a network; how can we clone a partition without a network? I had DHCP and had no problems, I don’t know about you.

Let's see what happens if we configure static:

In the future, everything is perfectly configured with IP, Mask, Gateway and DNS.

12. After the network is configured, we need to select the partition from which we will clone. clonezilla will detect local computers all sections that are available and will provide you with a choice.
13. After you select it, a couple of questions will be asked, answer Yes.
14. And finally you will be shown a message:
clonezilla is ready for cloning, run on remote computer clonezilla from CD-ROM or flash drive and enter the following commands
sudo su -
ocs-live-netcfg
ocs-onthefly -s IP_SOURCE -t HDD_PART

The first command will give you root rights,
The second command will configure the network on the remote computer.
The third command will start cloning from a remote computer, -s IP address of the computer on which clonezilla is running, ready to give information about the local partition, -t source where the received information will be cloned.

The cloning speed mainly depends on the network, I cloned at a speed of 1GB per minute)
After cloning is completed, you can safely reboot and work)

P,S,
Backup files.

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

Backup is the system administrator's insurance. 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 a free and open source software designed for cloning disks and individual hard drive partitions, as well as creating system backups and disaster recovery.

Clonezilla itself is a find. Download LiveCD, boot, and in a few clicks ENTER, backup of partitions or the entire HDD to another HDD begins, which can be external 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
How many times have you regretted that you didn’t have an image of a disabled system at hand? After all, then, with the appropriate equipment, it could be restored in a matter of minutes. However, cloning software hard drives usually too expensive or too difficult to use. How great it would be if there was something simple and, moreover, free application to create system images!

Imagine - it exists! is a perfect free tool for system recovery after fatal failures, developed in a Taiwanese laboratory National Center high-performance computing (National Center for High-Performance Computing, NCHC). Clonezilla allows you to clone a hard drive or even one of your hard drive partitions, and then completely restore the system from the resulting copy. Cloned data can be stored as an image or as backup files on internal or external storage, CD/DVD or network drive(using Samba, SSH or NFS). The program can be launched from its own boot environment from a CD/DVD disk or flash drive.

Unlike competing solutions, Clonezilla does not have a fancy GUI. The application is based on the Curses library and has mainly text interface. However, it is very easy to use, despite the complexity of the task. In this article, I will show you how to easily clone a hard drive using Clonezilla.

Step one

First you need to download . Use only the stable version of the program! The downloaded version must be burned to disk or created a bootable flash drive using special utility, For example, . After this, you can get down to business.

Step two

Connect an external hard drive to your computer or insert a recordable CD/DVD into the drive if you plan to save the cloned copy to it. Insert the Clonezilla disc into another drive or connect a bootable USB flash drive with the program.

Step three

Boot the system from the media containing Clonezilla. The loading screen shown in Fig. 1 will appear. A. To create an image of your hard drive, select the “Clonzezilla Live (Default settings)” option and click . Entries will appear on the screen bootstrap Debian.

Figure A. The menu allows you to select the most suitable screen resolution.

Step four

Select the program interface language. Here, I think, everything is clear.

Step five

Select your keyboard layout. Several options are available:

“Select Keyboard from arch list”;
“Don’t touch my keymap”;
“Keep kernel keymap”;
"Select a layout from full list"(Select keymap from full list).

In most cases, you should use the “Do not change layout” option. It works for me without any problems on both desktop PCs and laptops.

Step six

You can now launch Clonezilla. There is an option to work in console mode, but unless you happen to be an experienced Clonezilla user, it's best not to do this.

Step seven

Choose how to create a cloned copy - an image or directly copying files from one drive to another. It's best to create an image, especially if you're cloning a drive for the first time and want a convenient backup of your data. So select the first option (Figure B) and move to the “OK” button using the key.


Figure B. Both methods provide cloning and hard restoration disk, but only the first one allows you to create an image.

Step eight

Now you need to select on what media the created image will be saved. There are six options available:

Local device;
SHH server;
Samba server;
NFS server;
switch to command line mode;
will skip this step.

To save the image to an external hard drive or USB drive, select the "local_dev" option (Figure C). This is the easiest because you don't have to worry about setting up SSH, Samba or NFS. Just keep in mind that the images can be very heavy, so the volume external drive must be greater than or at least equal to the volume being cloned.


Figure C: Choose where to clone the drive. In most cases, the "local_dev" option will do.

Step nine

Select a repository for the image. Particular care must be taken here. If you're running Linux, you're almost guaranteed not to select a drive labeled "hda". Look for “hdb” or “hdd” (optionally “sdb”, “sdd”, etc.). If you select the "hda" partition, you risk erasing the data on your current scratch disk.

Step ten

Give the image a name, preferably with a date, so you can easily find the most up-to-date copy.

Step eleven

And now all you have to do is sit and watch the process. For an image-creating program, Clonezilla is quite fast, but depending on the size of the partition being cloned, the process can take anywhere from 30 minutes to three hours. For example, cloning a 160 GB hard drive took me a little less than two hours.

Once recording is complete, you can restart your computer. Now you will always have a backup copy at hand in case of a serious failure.

Finally

Although Clonezilla is not as beautiful or functional as, for example, Acronis products, it is an excellent solution for those who do not have extra money, as well as for hobbyists software With open source. The program is perfect for both home users and small and medium-sized businesses.

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 a bootable USB flash drive using any usual method. You can use Unetbootin or the more advanced MultiSystem LiveUSB. 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 the priority of our flash drive in Bios. 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 freshly formatted), 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 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

Recovery happens the same way general principle- first specify “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, we do everything as in previous paragraph and we get to the disk selection screen where the backup is located:

Internet