1. Field of Invention
The present invention relates to a data backup method for computer storage equipment, and more particularly to a data backup method applied to a logical volume manager.
2. Related Art
In order to safely and effectively save data information in a computer, many data information storage technologies are proposed in the past, such as redundant array of independent disks (RAID), and logical volume manager LVM). For the LVM, a plurality of physical disks is integrated to serve as a same volume group, and then the volume group is divided into several logical volumes (LV)
A snapshot method is further provided in the LVM. The so-called snapshot is to provide a corresponding snapshot volume SV, and the snapshot volume SV is used to perform real-time backup on data information of a certain specific time in the logical volume LV. The snapshot volume SV performs the backup on rewritten data in the logical volume LV instead of performing total backup on all the data in the logical volume LV.
a shows a flow chart of the data backup of the logical volume and the snapshot volume. A logical volume is provided (step S110), and the logical volume respectively has a plurality of data. Adding a snapshot volume (step S120). New data is written into a cache memory (step S130). The data before alternation in the logical volume is read (step S140). The data before alternation is written into the snapshot volume (step S150). The new data is written from the cache memory into the logical volume (step S160).
In order to clearly illustrate operation manner of the logical volume and the snapshot volume, please refer to
Next, a first snapshot volume SV1120 is created. At this time, the logical volume LV110 does not have data transaction, so the first snapshot volume SV1120 does not store the transaction data of the logical volume LV110, as shown in
A second snapshot volume SV2130 is newly added, please refer to
In other words, the snapshot recording method of the LVM is that when the logical volume LV110 has the data transaction, the original data before the transaction of the logical volume LV110 is stored to the current latest snapshot volume SV. However, the backup process needs the following steps. The old data of the logical volume is read, the old data is written into the snapshot volume SV, and the new data is written into the logical volume. The method needs disk actions of reading once and writing twice. When a great quantity of data needs to be accessed, executing performance of the LVM is encumbered by frequent operation of the disk actions.
The action of resuming the data of the logical volume to the data when the snapshot is created is called rollback. When the logical volume LV110 intends to perform the rollback, it is necessary to read each data one by one in the snapshot volume SV, and to write the old data back to the corresponding positions in the logical volume LV110.
Referring to
Referring to
According to step S210, firstly, the newly generated snapshot volume is selected in the current snapshot volume, and the latest snapshot volume SV in
In view of the above problem, the present invention is mainly directly to provide a data backup method for a logical volume manager (LVM), which is capable of newly adding data to a logical volume in the LVM, and performing backup on original data of the added data in the logical volume.
The data backup method for LVM includes the following step. A. A snapshot volume is generated. B. The current logical volume is renamed to the snapshot volume. C. The snapshot volume generated in step A is renamed to the logical volume. D. The data is written to the logical volume renamed in step C.
In the backup method for LVM provided in the present invention, the reading and writing times of the physical disk are reduced, so as to increase the accessing performance of the LVM.
Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.
The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus are not limitative of the present invention, and wherein:
a is a schematic flow chart of the conventional data backup;
b is a schematic view of the generation of the first snapshot volume in the conventional art;
c is a schematic view of the data backup of the conventional first snapshot volume;
d is a schematic view of the generation of the second snapshot volume in the conventional art;
e is a schematic view of the data backup of the conventional second snapshot volume;
a is a flow chart of the rollback action of the conventional LVM;
b is a schematic view of the rollback action performed by the conventional LVM;
c is a schematic view of the rollback action performed by the conventional LVM;
d is a schematic view of the rollback action performed by the conventional LVM;
e is a schematic view of the rollback action performed by the conventional LVM;
f is a schematic view of the rollback action performed by the conventional LVM;
a is a flow chart of the data backup of the LVM of the present invention;
b is a schematic view of the generation of the first snapshot volume of the present invention;
c is a schematic view of the rename of the first snapshot volume and the logical volume of the present invention;
d is a schematic view of the backup data of the present invention;
e is a schematic view of the generation of the second snapshot volume of the present invention;
f is a schematic view of the rename of the second snapshot volume and the logical volume of the present invention;
g is a schematic view of the backup data of the present invention;
a is a schematic view of the flow of the data rollback of the present invention;
b is a schematic view of the data rollback of the LVM of the present invention;
c is a schematic view of the data rollback of the LVM of the present invention;
d is a schematic view of the data rollback of the LVM of the present invention; and
e is a schematic view of the data rollback of the LVM of the present invention.
As shown in
In order to explain the operation process of the present invention more clearly, please refer to
Next, the current logical volume is renamed to the register snapshot volume. The first snapshot volume SV1320 generated in step S310 is renamed to the logical volume 310. Finally, the register snapshot volume 390 is renamed to the first snapshot volume SV1 (corresponding to steps S320 to S340). It should be particularly noted that the data saved in the original logical volume LV310 is not moved to other volumes because of renaming. Similarly, if the data is saved in the snapshot volume SV, the data is not moved to other volumes.
In order to clearly illustrate dependent positions, please refer to the arrow indication directions of each data in
Next, it is determined whether the quantity of the snapshot volumes SV reaches an upper limit of the set quantity in the LVM. The quantity of the snapshot volume SV is determined by the capacity of the physical disk. If it reaches the upper limit of the quantity of the snapshot volumes SV, the generation of the snapshot volume is stopped. If it does not reach the upper limit of the quantity of the snapshot volumes SV, the steps S310 to S350 are repeated. In this embodiment, two snapshot volumes are used as an example, so the LVM repeats the step S310 again to generate a second snapshot volume SV2330, as shown in
If it intends to modify the data named Data213121 and Data423142 in the first snapshot volume SV1320, the modified data Data223122 and Data433143 are written into each data dependent position in the logical volume LV 310. After the backup action, the data named Data113111, Data213121, Data313131, and Data41 are saved in the first snapshot volume SV1320. The data named Data123112 and Data423141 are saved in the snapshot volume SV2330. The data named Data223122 and Data433143 are saved in the logical volume LV 310. Referring to
In addition, based on the backup data method of the present invention, the present invention further provides a data rollback method. For the detailed operation flow of the data rollback method, please refer to
According to the data rollback method, here for the schematic views of the detailed operation corresponding to each step, please refer to
As compared with the conventional data rollback, the data rollback of the present invention does not have the disk data moving action, and the rollback snapshot of the conventional art needs to perform several times of reading and writing actions, which depends on the data amount of the snapshot backup. In the present invention, it is only necessary to delete each snapshot volume SV, and finally the original data Data11, Data21, Data31, and Data41 can be obtained.
In the backup method for LVM of the present invention, the data backup/the data rollback is performed to reduce the times of the reading and writing of the physical disk, so as to improve the accessing performance on the LVM execution.
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.