Linux ghost backup solution

Source: Internet
Author: User
Windows System Backup can be completed using the ghost tool. Linux systems cannot rely entirely on the ghost tool. First, ghost itself is copyrighted, second, ghost only supports Linux partitions of ext2 and ext3 file systems. It does not support reiserfs, XFS, and other advanced file systems. Ghost itself does not back up MBR, therefore, grub Errors often occur after recovery. Linux itself comes with excellent backup tools, such as tar, cpio, and DD, and new ones include Bzip2 and afio. Here we will introduce two Linux backup tools, similar to Ghost: Ghost for Linux and partition.
Image for Linux.
Both g4l and partition image software have the disc image version.

1. G4l

Http://sourceforge.net/project/showfiles.php? Group_id = 119810

Download the ISO file and burn it to a CD or load it in the VM to start.
Put it into the g4l disc and start the screen:
F1 select core version F2 prepare image F3 start F4 Terms and Conditions
G4l requires an idle hard disk or partition to save the image file. The principle of g4l is to use the DD command to back up the hard disk partition information and the sectors where data is stored. Idle sectors are not saved. G4l provides the graphic front-end of the fg4l console, which is written in the ncures GUI library. You can use fg4l to familiarize yourself with the operation for the first time.
Select a core to start and enter the g4l system. When the sh # prompt is displayed, enter the fg4l command to enter the operation interface, or execute the g4l command in the following format:
G4l FTP Server IP image file full name Username: Password DHCP directory
Back up the image file from the Linux system to the specified directory on the specified FTP server with the specified account.
For example: g4l 192.168.0.1 test. lzo User: Pass DHCP/img

 

 

 

 

2. Partition Image
The software is easier to use than g4l and has a full graphic interface with a wizard. Using it to back up an installed Linux system and restore the image to another computer with the same hardware configuration, you can quickly clone a set of identical Linux systems. This software is faster than g4l. We recommend that you use this software for Linux system backup. This may be due to the reason for surfing the internet at night. The official website of partition image has been unable to go online and has not been downloaded. We will not continue the discussion here. On the screen, this software is better than g4l. 3. Both of the above software require an FTP server to store backup image files.
**************************************** *********************************** G4l backup centos5 system process ().
Environment:
WINXP + VM + centos5

Target: Backup centos from disk to disk.
1. Download g4l ISO. Burn it to a CD or load it with a VM.
1.2. centos4. 3. Add a virtual hard disk (target disk) with the same size as the system disk (master disk ).
1.3. Start centos4. 3. Divide the target disk into one partition and create an ext3 file system. Not mounted. Restart.
1.4. Start the system with g4l ISO. Start with the default core system.
1.5. # Sh g4l: Start the g4l System
Select RAW mode"
Select "Click n clone" to clone the entire disk.
Select Source
Select target
Select "Click n clone"
Confirm.
1.6. After completion, exit g4l, shut down, delete the master disk, mount the target disk to the master disk, and start from the hard disk.
Smooth start and check. Everything is the same as before.

Restoration test: Add a new virtual disk and use g4l to restore the centos system from the sub-disk to the sub-disk.
The process is omitted, just like above.

Note:
If the target disk capacity is the master disk, the default capacity of the target disk is the same as that of the master disk.
Solution:
-------------------------------
5.1 check the partition status of the master disk and record it:
# DF-H
/Dev/sda2 3.4g/
/Dev/sda1 99 m/boot
/Dev/sda5 3.6g/var
/Dev/sda6 494 M/tmp
5.2 check and record the Partition Table of the master disk
# Fdisk/dev/SDA
Command (M for help): p
Disk/dev/SDA: 9105 M, 9105018880 bytes
255 heads, 63 sectors/track, 1106 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 459 3582495 83 Linux
/Dev/sda3 460 524 522112 + 82 Linux swap
/Dev/sda4 525 1106 4674915 5 extended
/Dev/sda5 525 1041 4152771 83 Linux
/Dev/sda6 1042 1106 522081 83 Linux
5.3 shut down, drop the master disk, and set the sub-disk to start:
5.4 successfully started and entered the system. It seems that g4l can solve the startup problem. Pai_^
5.5 check the sub-disk partition and record:
# DF-H
/Dev/sda2 3.4g/
/Dev/sda1 99 m/boot
/Dev/sda5 3.6g/var
/Dev/sda6 494 M/tmp
Here we can see that g4l is cloned Based on the partition of the master disk, but where is the excess capacity?
5.5 view the sub-system partition table:
# Fdisk/dev/SDA
Command (M for help): p
Disk/dev/SDA: 73.4 GB, 73402398720 bytes
255 heads, 63 sectors/track, 8924 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

#### 73402398720 bytes = 8924*16065*512 #######

Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 459 3582495 83 Linux
/Dev/sda3 460 524 522112 + 82 Linux swap
/Dev/sda4 525 1106 4674915 5 extended
/Dev/sda5 525 1041 4152771 83 Linux
/Dev/sda6 1042 1106 522081 83 Linux

The partition table is consistent with the parent disk.

Try to add a new partition at the end:
Command (M for help): n
No free sectors available
No extra space ???
Command (M for help): V
It shows that there is still about 60 GB of space not used. How can there be no extra space? A little strange ~~

Try to delete the last partition and add a new partition, so that the lost capacity may be retrieved.
Command (M for help): d
Partition Number (1-6): 6
Command (M for help): n
First cylinder (1042-1106, default 1042 ):
I am a little worried here. How can the remaining space be: 20172-1106? This space is the space of the partition just deleted,
It seems that something is wrong.
Continue to view the partition table and find:
/Dev/sda4 525 1106 4674915 5 extended it turns out that extended has set the final end cylinder to 1106. You only need to change it to 8924 to retrieve the lost capacity.
. The cause is found. Do it right away.
Command (M for help): D (delete partition)
Partition Number (1-5): 4 (here 4 is sda4, extended)
Command (M for help): p
Disk/dev/SDA: 73.4 GB, 73402398720 bytes
255 heads, 63 sectors/track, 8924 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 459 3582495 83 Linux
/Dev/sda3 460 524 522112 + 82 Linux swap

Command (M for help): n (create extended partition)
Command action
E extended
P primary partion (1-4)
E (input e to create an extended partition)
Select partion 4
First cylinder (525-8924, default 525): Press enter (8924 at last, ^ _ ^)
Last cylinder or + size or + sizem or + sizex (525-8924, default 8924): Press ENTER
Command (M for help): p
Disk/dev/SDA: 73.4 GB, 73402398720 bytes
255 heads, 63 sectors/track, 8924 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 459 3582495 83 Linux
/Dev/sda3 460 524 522112 + 82 Linux swap
/Dev/sda4 525 8924 67473000 5 extended

Command (M for help): n (create the original sda5 partition, note that it must be consistent with the original start and end cylindrical)
First cylinder (525-8924, default 525): Press ENTER
Last cylinder or + size or + sizem or + sizex (525-8924, default 8924): 1041
Command (M for help): n (create the original sda6 partition, also note that it must be consistent with the original start and end cylindrical)
First cylinder (1042-8924, default 1042): Press ENTER
Last cylinder or + size or + sizem or + sizex (1042-8924, default 8924): 1106
Command (M for help): n (create partitions in excess space)
First cylinder (1107-8924, default 1107): Press ENTER
Last cylinder or + size or + sizem or + sizex (1107-8924, default 8924): Press enter (all as new partitions)
, You can continue to subscribe to it and see what you need)
#### View all partitions ####
Command (M for help): p
Disk/dev/SDA: 73.4 GB, 73402398720 bytes
255 heads, 63 sectors/track, 8924 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device boot start end blocks ID system
/Dev/sda1*1 13 104391 83 Linux
/Dev/sda2 14 459 3582495 83 Linux
/Dev/sda3 460 524 522112 + 82 Linux swap
/Dev/sda4 525 8924 67473000 5 extended
/Dev/sda5 525 1041 4152771 83 Linux
/Dev/sda6 1042 1106 522081 83 Linux
/Dev/sda7 1107 8924 62798053 + 83 Linux

Check whether the size of the corresponding blocks is the same as that of the master disk !!
Command (M for help): w (save and Exit)

5.6 create a new partition File System:
Mkfs-T ext3/dev/sda7)
5.7 create a new partition volume:
Tune2fs-L/store/dev/sda7 (set the volume label as needed)
5.8 load new partitions
Mkdir/Store
Mount-T ext3/dev/sda7/Store

Related Article

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.