Use CloneZilla to create an emergency recovery Partition

Source: Internet
Author: User

There are a lot of discussions on one-click recovery and there are also a lot of finished products on the Internet, but most of them are implemented based on Ghost, while Ghost is a commercial software. It may be hard to accept people who like to use open source. In addition, although this one-click recovery is easy to use, it is also less customizable. Therefore, I want to use CloneZilla to create an emergency recovery partition to back up/restore the system.

Why is CloneZilla used? The reasons are as follows:

It is an open-source software.
The backup mode is flexible. You can select a backup partition or an entire hard disk, or back up data to a local hard disk or a network.
The built-in Linux system can be used for system maintenance.
The usage of CloneZilla is not much to mention. The built-in Chinese documents provide extremely detailed instructions. In addition, creating an emergency recovery partition is not enough for CloneZilla, and grub4dos is required.

My operating system is Windows XP, and the hard disk partition is NTFS by default. Let's get started.

Prepare partitions
My c disk capacity is 40 GB, and the resident files are about 10 ~ About 20 GB, which may increase to 30 GB after a long period of use. Considering that the backup image can be compressed to about 50%, it takes about 5 ~ 10 Gb hard disk. So I set aside 30 GB space for backup.

First, sort disk fragments, and use Partition Magic and other tools to divide a 30 GB space at the end of the hard disk. It is best to use the primary partition (the reason is that Linux and grub are simpler than the Logical Disk in the numbering method of the primary partition), and then format it to FAT32, and assign a drive letter (assuming J :). This is the urgent recovery partition in the future.

Install CloneZilla
Create the following directories under disk J:

Clonezilla: main directory of CloneZilla
Grub4dos: grub4dos main directory
Iso: directory for maintaining Disk Images for other systems
Images: directory of C disk image backup
Copy the content in the Live directory of the CloneZilla live disc to J: clonezilla.

Install grub4dos
Grub4dos supports NTLDR startup, so you only need two files: grldr and menu. lst. For the convenience of future jobs, I still put the entire grub4dos file under J: grub4dos.

Then set NTLDR to start: copy the grldr and menu. lst files under J: grub4dos to the C: root directory. Edit C: oot. ini and add the following content:

C: GRLDR = "Start GRUB" restart the computer, press F8 to display the Windows XP Startup menu, and then select "Start GRUB". If GRUB's Startup menu appears, it will be OK.

Set grub4dos to start CloneZilla
Go back to Windows and edit menu. lst. The default menu. lst contains many useless menu items. I only keep the two items that initially load NTLDR and CMLDR. Then add the menu item to start CloneZilla:

Title Clonezilla live on harddrive
Root (hd0, 2)
Kernel/clonezilla/vmlinuz1 boot = live union = aufs vga = 788 ip = frommedia live-media-path =/clonezilla bootfrom =/dev/hda3 toram = filesystem. squashfs
Initrd/clonezilla/initrd1.img
Boot my recovery partition (J :) is the third primary partition of the system, so the drive letter of the second line is (hd0, 2), and the bootfrom of the third line is/dev/hda3. The two parameters can be adjusted as needed. In addition, the/clonezilla path used in the kernel and initrd commands is the J: clonezilla path we have created.

After setting, restart and choose "Clonezilla live on harddrive" from Grub to check whether clonezilla can be started successfully.

Install Win98 boot floppy disk
The purpose of this step is to enable the computer to start in pure DOS mode to execute some maintenance commands. For example, the bootlace.com program to be mentioned later must be executed in pure DOS mode.

First, find an image of the Windows 98 boot floppy disk and put it in the iso directory. Assume the path is/iso/win98.img. Then add the following menu items to menu. lst:

Title Win98 Floppy
Find -- set-root -- ignore-floppies/iso/win98.img
Map -- mem/iso/win98.img (fd0)
Map -- hook
Chainloader (fd0) + 1
Rootnoverify (fd0) the key here is the map -- mem command, which fully loads the image file into the memory and maps it to the device (fd0, this is equivalent to a virtual soft drive.

Then restart the computer and select "Win98 Floppy" in Grub to enter the pure DOS mode.

Install the Boot Sector of grub4dos
Now grub4dos is guided by NTLDR. In case of NTLDR failure, this emergency recovery partition will become invalid. To prevent this, you need to install grub4dos into MBR.

Grub4dos provides a program named bootlace.com that can write MBR. The principle is to first back up the original MBR (located in the 0 sector) to the 1 sector, and then write its own startup program in the 0 sector. According to the specification definition of the hard disk boot zone, in the 0 track of the hard disk, except that the 0 sector is MBR, other sectors are retained, so backing up to the 1 sector will not have any impact.

Because bootlace.com must be used in pure DOS, And the DOS provided by Win98 boot disk does not have the command line history function, bootlace.com has many options, so it is not a good way to manually knock the command. Create a file named INSTALL. BAT and write the command line of bootlace.com.

The following is an example of INSTALL. BAT. Note that do not use line breaks during actual writing. They are all written on the same line. Note that the length of a command line must not exceed 127 characters, which is a DOS restriction on the length of a command line.

Bootlace -- boot-prevmbr-first -- time-out = 1
-- Hot-key = 0x4300 -- force-backup-mbr
-- Preferred-drive = 0 -- preferred-partition = 2 0x80 for details about the options, see README_GRUB4DOS.TXT.

-- Boot-prevmbr-first indicates that the original MBR (for Windows) should be started first. Only when the hot key is pressed will the start of the specified partition be started.
-- Time-out specifies the wait time at startup.
-- Hot-key: Specifies the hotkey used to start a specified partition. 0x4300 is F9.
-- Force-backup-mbr enables bootlace.com to back up the old MBR to the first sector.
-- Preferred-drive and -- preferred-partition specify to start from Sector 0th (2nd sectors) of disk 3rd when the hot key is pressed. This is the same as (hd0, 2) in the grub menu.
The last 0x80 indicates that bootlace.com should be mounted to the first hard disk.
Restart the computer, enter the DOS environment, and then run bootlace.com. A small line of text will appear when you start again. Wait 1 second to enter the original Windows, and press the F9 key to start the grub boot program at (hd0, 2 ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.