This application claims priority to Taiwan Application Serial Number 98108802, filed Mar. 18, 2009, which is herein incorporated by reference.
1. Field of Invention
The present invention relates to a data backup method. More particularly, the present invention relates to a method for backing up data of a server machine under a Linux operating system.
2. Description of Related Art
With the advent of network technologies, many newly developed products called Internet appliances or information appliances are presented to the market, such as a network-attached storage (NAS) server consisting of a redundant array of independent disks (RAID). Such storage server mostly can be used to directly connect to a network system, so that a remote computer can back up a large quantity of data to the storage server. However, referring to
In the operating system 20 of the aforementioned storage server 10, an application layer 30 and a kernel layer 40 are defined. As a result of a protection scheme, the operating system 20 defines a memory space for each of the application layer 30 and the kernel layer 40, and the tools located at the application layer 30 has to use a data-duplicating method to access the data stored in the memory space of the kernel layer 40, which cannot randomly select and access the data stored in the memory space of the kernel layer 40. Thus, when the storage server 10 is desired to back up a large quantity of data to the storage server 70 at the remote site, every time when one of the blocks of data in a disk device 42 is backed up to the storage server 70 at the remote site, a backup tool 31 at the application layer 30 has to use a system call to invoke the hard disk driver 43 to read the block of data and duplicate the block of data to a first buffer 47 (for example, an about 64K buffer) in the memory space of the kernel layer 40, and then to allow the operating system 20 to duplicate the data in the first buffer 47 to a second buffer 32 (for example, an about 64K buffer) in the memory space of the application layer 30. Thereafter, the backup tool 31 again uses another system call to invoke the operating system 20 to duplicate the data in the second buffer 32 to a third buffer 49 (for example, an about 64K buffer) at the kernel layer 40, wherein the third buffer 49 is provided by a connection interface driver 45 associated with a connection interface 44, so that the connection interface driver 45 may back up the data in the third buffer 49 to another storage server 70. Consequently, after many system calls and repeated steps of duplicating the data from the first buffer 47 to the third buffer 49 via the second buffer 32 for all of the blocks of data in the disk device 42, the storage server 10 may complete the procedures of backing up a large quantity of data in the disk device 42.
However, since the motivation for backing up data is generally to duplicate all of the data stored in a specific number of hard disks or file folders of the entire storage server to another remote storage server, thereby preventing data damage or loss. Hence, for quite an immense amount of data in a storage server, there is no doubt that extra system call context switches and steps of duplicating data back and forth between the kernel layer and the application layer will be doubly wasted.
In view of the aforementioned shortcomings, the present invention provides a method for backing up data of a server machine by simplifying the procedure for duplicating data back and forth between the kernel layer and the application layer, wherein a buffer provided for the disk driver to put blocks of data is directly used as the buffer required by the driver associated with the connection interface, so as to get rid of the buffer of the application layer for storing the data in the buffer of the kernel layer again, thereby reducing the time for duplicating data back and forth between the kernel layer and the application layer, further improving the efficacy for backing up data in a server machine to another server machine.
According to the above objects, a method for backing up data of a server machine is provided. The server machine owns an operating system having a kernel layer and an application layer. When the application layer requests a backup agent at the kernel layer to back up data in the server machine to another server machine, the backup agent requests the kernel layer to duplicate data in a disk device and put the data in a kernel buffer at the kernel layer; and then the backup agent requests the kernel layer to directly read the data from the kernel buffer and transmit the data to the another server machine.
It is to be understood that both the foregoing general description and the following detailed description are examples, and are intended to provide further explanation of the invention as claimed.
These and other features, aspects, and advantages of the present invention will become better understood with regard to the following description, appended claims, and accompanying drawings where:
Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
The present invention provides a method for backing up data of a server machine. Such as shown in
In step 301, the backup tool 212 provides a backup data source (i.e. a location path of the disk device 400; hereinafter, the backup data source is referred to as the disk device 400) and a backup data destination (i.e. a network address of the server machine 170), and then requests the backup agent 222 to transmit the data in the disk device 400 to the server machine 170.
Then, in step 302, the backup agent 222 requests the disk driver 410 associated with the disk device 400 to sequentially read the first to nth blocks of data in the disk device 400, and to sequentially put each of the blocks of data in one (for example, the kernel buffer 300) of the buffers at the kernel layer 220, wherein each block of data is not limited to being put in the same kernel buffer 300.
In step 303, when completing reading and putting one of the blocks of data in the kernel buffer 300, the disk driver 410 reports a “completion” message and a message regarding “a memory address of the kernel buffer is 300” to the backup agent 222 at the kernel layer 220
In step 304, after receiving the report from the disk driver 410, the backup agent 222 of the kernel layer 220 merely reports the “completion” message and the message regarding “a memory address of the kernel buffer 300” to the backup tool 212 of the application layer 210, and does not need to duplicate the data in the kernel buffer 300 to a buffer (not shown) of the application layer 210 for use by the backup tool 212.
In step 305, the backup tool 212 designates the memory address of the kernel buffer 300, and requests the backup agent 222 to transmit the data in the kernel buffer 300 to the server machine 170 via the connection interface 500 (such a network interface using a fibre protocol, an iSCSI protocol or a SAS protocol).
In step 306, the backup agent 222 provides the memory address of the kernel buffer 300 and the network address of the server machine 170, and requests the connection interface driver 510 of the connection interface 500 to read and transmit out the data in the kernel buffer 300.
In step 307, the connection interface driver 510 reads the data in the kernel buffer 300 in accordance with the memory address of the kernel buffer 300, and transmits the data in the kernel buffer 300 to the server machine 170 in accordance with the network address of the server machine 170.
In step 308, steps 302 to 307 are repeated until all the blocks of data in the disk device 400 pass through one kernel buffer 300 and are transmitted to the server machine 170 via the connection interface 500 by using the connection interface driver 510.
Consequently, the aforementioned embodiment may simplify the procedure for duplicating data back and forth between the kernel layer and the application layer, so that the kernel buffer 300 provided for the disk driver 410 to put blocks of data can be directly used as the buffer required by the connection interface driver 510, thereby saving the time for duplicating blocks of data to the buffer of the application layer 210 and then back to the buffer of the kernel layer 220 by merely reporting the “completion” message and the message regarding the memory address of the kernel buffer 300. For quite an immense amount of data in a storage server (server machine), there is no doubt that the embodiment can doubly improve the efficacy for backing up data in the server machine 100 to another server machine 170.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
98108802 | Mar 2009 | TW | national |