Abstract:
The present disclosure relates to a method for detecting a RAID device. The RAID device includes a disk set for storing a special data and the disk set is composed of a plurality of member disks. The method comprises the following steps. The first step is to read data stored in the RAID device to determine whether or not a data read from the disk set is equal to the special data. the second step is to set one of said member disks as a failure disk to determine whether or not the failure disk affects the disk set operation. The third step is to replace the failure disk with a non-member disk and rebuilding data of the failure disk in the non-member disk to determine whether or not the rebuilt data is equal to data of the failure disk.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to detection method, and more particularly to a method for detecting a RAID device. 
       BACKGROUND OF THE INVENTION 
       [0002]    RAID (Redundant Array of Independent Disks) is to combine multiple small, inexpensive disk drives into an array which yields performance exceeding that of one large and expensive drive. RAID controller aggregates the disks and presents a single disk image to host operating systems so that applications never have to know where or how the data are being placed on the storage media. 
         [0003]    The standard RAID levels are a basic set of RAID configurations and employ striping, mirroring, or parity. A RAID level 5 uses block-level striping with parity data distributed across all member disks. Every time a block is written to a disk in a RAID level 5, a parity block is generated within the same stripe. The parity blocks are read when a read of a data sector results in a cyclic redundancy check (CRC) error. In this case, the sector in the same relative position within each of the remaining data blocks in the stripe and within the parity block in the stripe are used to reconstruct the errant sector. 
         [0004]    However, there is no any method to detect the stripping reliability in RAID level 5. 
       SUMMARY OF THE INVENTION 
       [0005]    Therefore, it is the main object of the present invention to provide a method for detecting a RAID device. 
         [0006]    The present invention provides a method for detecting a RAID device. The RAID device includes a disk set for storing a special data and the disk set is composed of a plurality of member disks. The method comprises the following steps. The first step is to read data stored in the RAID device to determine whether or not a data read from the disk set is equal to the special data. The second step is to set one of said member disks as a failure disk to determine whether or not the failure disk affects the disk set operation. The third step is to replace the failure disk with a non-member disk and rebuilding data of the failure disk in the non-member disk to determine whether or not the rebuilt data is equal to data of the failure disk. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    The foregoing aspects and many of the attendant advantages of this invention will become more readily appreciated and better understood by referencing the following detailed description, when taken in conjunction with the accompanying drawings, wherein: 
           [0008]      FIG. 1  illustrates an apparatus for detecting the stripping reliability in RAID level 5 according to one preferred embodiment of the present invention. 
           [0009]      FIG. 2  illustrates a schematic diagram of the reliability detection program according to one preferred embodiment of the present invention. 
           [0010]      FIG. 3A  to  FIG. 3C  is a schematic diagram of a disk set according to one preferred embodiment of the present invention. 
           [0011]      FIG. 4  illustrates a flow chart of the access function detection process P 100 . 
           [0012]      FIG. 5  illustrates a flow chart of the degrade mode access function process P 200 . 
           [0013]      FIG. 6  illustrates a flow chart of the rebuild function detection process P 300 . 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
       [0014]    Referring now in more detail to the drawings, in which like numerals indicate corresponding parts throughout the several views,  FIG. 1  illustrates an apparatus for detecting the stripping reliability in RAID level 5 according to one preferred embodiment of the present invention. Preferably, the reliability detection program  40  is integrated into a computing device, such as an Internet server  10 . The server  10  is coupled to a storage device, such as a redundant array of independent disks (RAID) device  20 . The reliability detection program  40  is used to perform a reliability detection process to determine whether or not the stripping arrangement in RAID level 5 is well to access. 
         [0015]    In an embodiment, the RAID device  20  in  FIG. 1  is composed of ten physical disks. A RAID controller  21  may group the first disk  31 , the second disk  32 , the third disk  33  and the fourth disk  34  into a disk set  30  to form a RAID level 5 configuration. The first disk  31 , the second disk  32  and the third disk  33  are identified as member disks used to storage data. The fourth disk  34  is identified a non-member disk. However, it is noticed that other numbers of physical disks may also be used to form the RAID device  20  in other embodiments. Furthermore, the identified disks for forming the RAID level 5 configuration may also be other disk in the RAID device  20 . 
         [0016]      FIG. 2  illustrates a schematic diagram of the reliability detection program  40  according to one preferred embodiment of the present invention. The reliability detection program  40  includes three detection subprogram. The first detection subprogram is access function detection subprogram  100 . The second detection subprogram is degrade mode access function detection subprogram  200 . The third detection subprogram is rebuild function detection subprogram  300 .) 
         [0017]    The access function detection subprogram  100  is used to perform the access function detection process P 100  in the  FIG. 4 .) The access function detection process P 100  detects whether or not the RAID level 5 disk set  30  may be accessed well. 
         [0018]      FIG. 4  illustrates a flow chart of the access function detection process P 100 . In step  401 , a user may define the number of member disks in a RAID level 5 configuration. It is noticed that the number of the member disks should be less than the number of the physical disks. In an embodiment, the number of the member disk s is three and the number of the physical disks is ten as illustrated in  FIG. 1 . 
         [0019]    Next, in step  402 , the user may identify the detection capacity of disk. The identified detection capacity should be less than the largest storage capacity of this disk and larger than one gigabytes (GB). 
         [0020]    Next, in step  403 , through the RAID controller  21 , the user may identify a disk set to form a RAID level 5 configuration based on the defined number in step  401 . In an embodiment, as shown in the  FIG. 1  and  FIG. 2 , the first disk  31 , the second disk  32 , the third disk  33  and the fourth disk  34  are grouped into a disk set  30  to form a RAID level 5 configuration. The first disk  31 , the second disk  32  and the third disk  33  are identified as member disks used to storage data. The fourth disk  34  is identified a non-member disk. Next, in step  404 , the number of the blocks located in the disk set  30  is read. Then, this number is set to equal to the variable B. 
         [0021]    Next, in step  405 , a set of detection data is written into the blocks located in the disk set  30  until all blocks are filled out. In an embodiment, as shown in the  FIG. 3A , the original detection data includes six data blocks, A, B, C, D, E and F. The six data blocks uses striping with parity data distributed across all member disks, the first disk  31 , the second disk  32  and the third disk  33 . For example, the data block A is written into the first disk  31 . The data block B is written into the second disk  32 . The parity data P(A, B) of the data block A and the data block B is written into the third disk  33 . The data block C is written into the first disk  31 . The parity data P(C, D) of the data block C and the data block D is written into the second disk  32 . The data block D is written into the third disk  33 . The parity data P(E, F) of the data block E and the data block F is written into the first disk  31 . The data block E is written into the second disk  32 . The data block F is written into the third disk  33 . 
         [0022]    Next, in step  406 , the data blocks stored in the disk set  30  are read out and compared with the original detection data to determine whether or not the read out data is different from the original detection data. When the read out data is different from the original detection data, a fail message is issued and shown in the display  11  of the server  10  (as shown in the  FIG. 1 ) to inform the user. 
         [0023]    Finally, in step  407 , the user may stop the disk set  30  through the RAID controller  21  and the access function detection process P 100  is stopped. 
         [0024]    The degrade mode access function detection subprogram  200  is used to perform the degrade mode access function process P 200  in the  FIG. 5 . The degrade mode access function process P 200  detects whether or not the operation of the disk set  30  whose one or more than one disk fails may be performed. The operation include to start and to access the disk set  30 . 
         [0025]      FIG. 5  illustrates a flow chart of the degrade mode access function process P 200 . In step  501 , a user may select a disk member in the disk set  30  to serve as a fail disk. For example, as shown in the  FIG. 3B , the second disk  32  is selected to serve as the fail disk. The superblock in the second disk  32  is cleaned out. 
         [0026]    Next, in step  502 , the RAID device  20  is started again through the RAID controller  21 . 
         [0027]    Next, in step  503 , a detection step is performed to determine whether or the RAID device  20  may be started again when the second disk  32  fails. A fails message is issued and shown in the display  11  of the server  10  to inform the user when the RAID device  20  can not is started again. 
         [0028]    Next, in step  504 , the data blocks stored in the disk set  30  are read out and compared with the original detection data to determine whether or not the read out data is different from the original detection data. In this embodiment, the data blocks stored in the first disk  31  and the third disk  33  are read out. When the read out data is different from the original detection data, a fail message is issued and shown in the display  11  of the server  10  (as shown in the  FIG. 1 ) to inform the user. 
         [0029]    Finally, in step  505 , the user may stop the RAID device  20  through the RAID controller  21  and the degrade mode access function process P 200  is stopped. 
         [0030]    The rebuild function detection subprogram  300  is used to perform the rebuild function detection process P 300  in the  FIG. 6 . The rebuild function detection process P 300  detects whether or not the data may be rebuilt by a non-member disk. In an embodiment, the fourth disk  34  is a non-member disk. The second disk  32  is selected to serve as a fail disk. This detection process P 300  is to determine whether or not the data stored in the second disk  32  may be rebuilt by the non-member disk  34 . 
         [0031]      FIG. 6  illustrates a flow chart of the rebuild function detection process P 300 . In step  601 , a user may select a non-member disk from the RAID device  20 . In this embodiment, the fourth disk  34  is selected to serve as the non-member disk, as shown in the  FIG. 3C . 
         [0032]    Next, in step  602 , the RAID device  20  is started again through the RAID controller  21 . 
         [0033]    Next, in step  603 , through the RAID controller  21 , the user may detect whether or not the RAID device  20  is in a rebuild state. When the RAID device  20  is not in a rebuild state, a fail message is issued and shown in the display  11  of the server  10  to inform the user. When the RAID device  20  is in a rebuild state, step  604  will be processed. 
         [0034]    Next, in step  604 , the rebuild process is detected periodically to determine whether or not the rebuild process is performed well. This step  604  is repeated performed until the rebuild process is finished and the fourth disk  34  replace the second disk  32  to serve as the second member disk. 
         [0035]    Next, in step  605 , the data blocks stored in the disk set  30  are read out and compared with the original detection data to determine whether or not the read out data is different from the original detection data. When the read out data is different from the original detection data, a fail message is issued and shown in the display  11  of the server  10  to inform the user. Finally, rebuild function detection process P 300  is stopped. 
         [0036]    It is noticed that only one failure disk is permitted in the RAID device  20  of RAID level 5 configuration. Therefore, in the reliability detection method, only one member disk RAID superblock is cleaned out to simulate a failure disk. Then, the RAID superblock is added into a non-member disk to make the non-member disk become a new member disk. Accordingly, the number of member disks in the RAID device  20  of RAID level 5 is also three. At this time, the superblock of another member disk, such as the first disk  31 , may be cleaned out to simulate as a failure disk. Then, the step  501  to step  505  and the step  601  to step  605  are performed again to determine whether or not the failure first disk  31  may affect the operation of the disk set  30 . According to the present invention, these steps are repeated performed until all the member disks have passed the foregoing detection. It is noticed that the reliability detection method may be performed by three disks. 
         [0037]    Accordingly, according to the present invention, the reliability detection program includes access function detection subprogram, degrade mode access function detection subprogram and rebuild function detection subprogram. During detecting, the access function of a disk set of RAID level 5 is detected first by the access function detection subprogram. Then, the degrade mode access function detection subprogram may select one of the disk set to serve as a failure disk to determine whether or not the failure disk may affect the operation of the disk set. Finally, the rebuild function detection subprogram selects one non-member disk to serve as a replae disk to rebuild the data stored in the selected failure disk. By this rebuild process to determine whether or not the data stored in the failure disk may be rebuildted in the non-member disk. Therefore, the operation reliability of RAID level 5 may be completely detected. 
         [0038]    As is understood by a person skilled in the art, the foregoing descriptions of the preferred embodiment of the present invention are an illustration of the present invention rather than a limitation thereof. Various modifications and similar arrangements are included within the spirit and scope of the appended claims. The scope of the claims should be accorded to the broadest interpretation so as to encompass all such modifications and similar structures. While a preferred embodiment of the invention has been illustrated and described, it will be appreciated that various changes can be made therein without departing from the spirit and scope of the invention.