Abstract:
The present invention provides a generalized method for standard Galois Field operational schemes used in Advanced RAID parity calculations. This method places the standard-field and ring operations in their generalized context of linear operations, which can be described by matrices over the Galois Field with two elements (GF(2)). To ensure recovery of information, certain conditions on these matrices are imposed. A plurality of methods for generating such matrices are provided, thereby increasing the range of computational techniques for parity calculation. Further, the method provides increased flexibility and scope in finding a more efficient computational scheme that is adapted to a particular hardware or software implementation.

Description:
This application claims an invention which was disclosed in Provisional Application No. 60/345,040, filed Oct. 23, 2001, entitled “SYSTEM AND METHOD FOR IMPLEMENTING ADVANCED RAID USING A SET OF UNIQUE MATRICES AS COEFFICIENTS”. The benefit under 35 U.S.C § 119(e) of the United States provisional application is fully claimed, and the aforementioned application is hereby incorporated herein by reference. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention generally relates to storage systems. More specifically, the present invention pertains to systems and methods for implementing advanced RAID using a set of unique matrices as coefficients. 
     2. Description of the Related Art 
     The speed of most processors is increasing faster than the speed of virtually all input/output (I/O) devices. As a response to this widening gap, the invention of the so called RAID (Redundant Array of Independent Disks) system was invented, which is aimed to increase the speed of disk drive reads and writes by replacing single disk drive unit with an array of a plurality of disks with smaller storage capacity. The data contained therein is accessed in parallel. 
     However, a drawback which is inherent with this solution is while the amount of parallelism (hence efficiency) increases with the size of the array (i.e., the number of disks it contains), the probability of disk failure increases as well. Disk failure may result in the loss of data. Therefore, a method that is able to recover the information contained in any one of the disks needs to be provided. 
     One known method of insuring the recovery of the data loss in anyone of the disks in an array is to always have two disks containing exactly the same data. This technique (i.e. the so-called mirroring) is used in RAID level  1  architectures. The drawback of this solution is that half of the space needs to be allocated for redundancy. 
     Another known method is to have a single disk reserved for parity. Here the RAID system will maintain the parity disk to contain the bitwise XOR of all the other disks at all times. If any disk of the array fails, the information contained therein can be recovered along with the information of all the other disks (including the parity disk). The parity information is usually “striped” over all the disks of the array to avoid a bottleneck on one singled out parity disk (RAID level  5 ). It should be noted that maintaining the system in its “safe” state requires the parity disk to be updated as soon as any data is updated in other disks. 
     The Advanced RAID systems deal with the capability to recover data when two or more disks fail in a predetermined period before recovering occurs. One known approach to this problem is to group data disks into different “parity groups” each of which has it&#39;s corresponding parity disk. In this approach, the system maintains the bitwise XOR of the data of every disk of the same parity group on its corresponding parity disk. Much research has been done in this area. For example, a good tutorial on Reed-Solomon methods in RAID-like systems can be seen in “A tutorial on Reed-Solomon Coding for Fault-Tolerance in RAID-like Systems.” By James S. Plank (Technical Report UT-CS-96-332, Jul. 19, 1996). It can be proven that this method requires log 2 (N) parity disks to take care of N data disks. 
     It is desirous to have a system that is able to recover from disk failures originating from any two disks and maintaining a minimum number of possible redundancy disks; for example with only two redundancy disks. One standard Advanced RAID scheme using the bare minimum amount of redundancy information uses Reed-Solomon codes. The following is a brief description of the same. 
     First, a word size is fixed. The disks may be conceptualized as a sequence of chunks of memory, and each chunk (or word) having a fixed size. The redundancy words will then by computed over the data words of a same line. A line is defined as a sequence of words; and each word of the sequence comes from a distinct disk. Basically, as far as the coding scheme is concerned, one can think of our disks as containing only one word of fixed size. The details of implementation—such as the actual size of read and writes, stripping method, etc.—are irrelevant as far as the coding scheme is concerned. 
     Let D 1 , D 2 , . . . , D N  be the n data words of the N respective disks of the array. Further let P and Q be the two corresponding redundancy words. In a Reed-Solomon based scheme, P and Q are maintained to be 
     
       
           P=D   1   +D   2   + . . . +D   N  and 
       
     
     
       
           Q=c   1   *D   1   +c   2   *D   2   + . . . +c   N   *D   N , 
       
     
     where all operations take place in a carefully chosen Galois field, and c 1 , c 2 , . . . , c N  are carefully chosen distinct words of this Field. 
     In the context of Galois Fields, it helps to think of the following three elements (i.e., the bits of our data, redundant backup, and coefficient words) as being coefficients of a polynomial over GF(2). For example, if our words are of size 8, the words 11001101, 01101001 and 00111100 correspond respectively to polynomials: 
     
       
         X 7 +X 6 +X 3 +X 2 +1, 
       
     
     
       
         X 6 +X 5 +X 3 +1, and 
       
     
     
       
         X 5 +X 4 +X 3 +X 2 . 
       
     
     The degree of a polynomial is the largest exponent appearing as a superscript of the X&#39;s. The degrees of the three above polynomials are respectfully 7, 6, and 5. 
     The sum of two words then corresponds to summing the two corresponding polynomials (in GF(2), where, since 2=0, we have X i +X i =0); this corresponds to the bitwise XORing of both words. For example, the sum of the words 11001101 and 01101001 is 10100100. From now on the reader must understand the sum of two words as being what has just been described. 
     The * operand corresponds to polynomial multiplication, and a final reduction modulo by the fixed irreducible polynomial which generates the Field. An irreducible polynomial is a polynomial which can not be obtained by multiplying two other polynomials together (just as a prime number is one which is not the product of two other numbers). For example, let 
     
       
         
           F=X 
           8 
           +X 
           5 
           +X 
           4 
           +X 
           2 
           +X 
           1 
         
       
     
     be our chosen irreducible polynomial (field generator). To obtain the word 11001101*01101001 we first find the product M of the corresponding polynomials; and M is as shown in FIG.  0 A. 
     One then computes the remainder of M through the Euclidian division by F. This corresponds to adding shifts of F (polynomials of the form X a  F for some natural number a) to M until we get rid of all the terms of degree higher or equal to the degree of F. The computation is shown by FIG.  0 B. Thus 11001101*01101001=01101111 in the field generated by F. 
     The point of working in a field is that every element of a field is invertible. That is to say, for any word there is a corresponding “inverse word” w −1  such that w*w −1 =00 . . . 01. This relationship may be used to precisely recover lost information resulting from such events as failed disks. 
     A further example is provided to depict how one can recover data when the relations 
     
       
           P=D   1   +D   2   + . . . +D   N  and 
       
     
     
       
           Q=c   1   *D   1   +c   2   *D   2   + . . . +c   N   *D   N , 
       
     
     are maintained. Assuming disk  1  and disk  2  fail. This means that the information contained in D 1  and D 2  are lost. By solving the above system of equations for D 1  and D 2 , we get 
     
       
           D   1 =( c   1   +c   2 ) −1 *( c   2   *P+Q+c   3   *D   3   + . . . +c   N   *D   N ) 
       
     
     and 
     
       
           D   2   =P+D   1   +D   3   + . . . +D   N . 
       
     
     As can be seen, D 1  and D 2  can be computed if P, Q, D 3 , D 4 , . . . , D N  are not lost (or are known). 
     It can further be seen that in order to maintain the system in a safe state the * operation must be done not only at every update of a data word, but also needs to be done many times during recovery. Therefore, the field generating polynomial and the N coefficients must be chosen carefully so as to minimize the time needed to compute the * operation between two words. 
     Lookup table methods have been used to compute the * operation, but this method becomes unreasonable as the word size increases. For example, too many calculations are needed in a too limited period of time. Yet a smaller word size induces a larger number of operations per data block, hence the need to increase the word size or pipe line the operations is required 
     U.S. Pat. No. 5,499,253, entitled “System and Method for Calculating RAID  6  Check Codes” teaches a careful matching of the characteristics of the Commutative Ring in which calculations take place to the capabilities of modern high-speed computers. 
     U.S. Pat. No. 6,148,430, entitled “Encoding Apparatus for RAID- 6  System and Tape Drives” teaches a system including an irreducible polynomial. The choice of the polynomial or a “good generating polynomial” show that one can find such good polynomials for arbitrary large word sizes. 
     As pointed out in U.S. Pat. No. 5,499,253, one does not need all the properties of Galois Fields for the specific purpose of maintaining the system in a recoverable state. A less restrictive * operation (placing it in what is called a Commutative Ring) is desirable to increase the space of possible generating polynomials, thereby finding one which reduces further the complexity of the * operation. Therefore, for two large words, one can also compute the * operation with controlled complexity by carefully choosing the polynomial generating the Galois Field. Large word means any suitable sized word in use without reducing the size of the word for fitting into a specific system. For example, if it is desirous to use 32 bit words in a system, and it is required to done size the 32 bit words to 8 bit for processing, then 32 bit word is the big word and 8 bit word is not. 
     As can be appreciated, it is desirous to generalize the known field and ring methods to any suitable large word sizes. One resultant benefit is the increased range of computational techniques for parity calculations, thereby allowing more flexibility and scope in finding an adaptable and efficient computational scheme. For example, word size can be any size; it may be as small as 4 bits and as large as any suitable size. With the increase in the word size, the scope (i.e., number) of co-efficients can be correspondingly increased as well. Therefore, it is desirable to a system and method for permitting more flexibility and scope in finding the adaptable and efficient computational scheme such that a generalized approaching using field and ring can be applied. 
     SUMMARY OF THE INVENTION 
     The present invention provides a generalized method for standard Galois Field operational schemes used in Advanced RAID parity calculations. This method places the standard field and ring operations in their generalized context of linear operations, which can be described by matrices over the Galois Field with two elements (GF(2)). To ensure recovery of information, one must impose certain conditions on these matrices. A plurality of methods for generating such matrices are provided, thereby increasing the range of computational techniques for parity calculation. Further, the method provides increased flexibility and scope in finding a more efficient computational scheme that is adapted to a particular hardware or software implementation. 
     Accordingly, in an advanced RAID system, having at least one array of n disks wherein n is a positive integer greater than or equal to 2 is provided. The RAID system further has a set of m redundancy disks associated with said at least one array wherein m is a positive integer greater than or equal to 3. The system further includes data and redundancy data in the form of a set of word segments residing in the above disks. The word segments have equal length and predetermined size. A method for updating redundancy information and associated with the advanced RAID system, includes: providing a first expression of redundancy data in terms of a first summation of a sequence of data, said sequence including a summation of data segments; providing a second expression of redundancy data in terms of a second summation, wherein the elements of said second summation includes elements of the first summation having each of the elements contained therein multiplied by a first sequence of co-effiecients; providing a m th  expression of redundancy data in terms of a (m−1) th  summation of a sequence of data, wherein the elements of said (m−1) th  summation includes elements of the m th  summation having each of the elements multiplied by a (m−1) th  sequence of co-effiecients; computing said first expression having at most m unknown values; computing said second expression having at most m unknown values, and second expression includes a set of translation of said sequence of data, said translation of data being subjected to conditions including for any 2 given words w and w′ T k (w+w′)=T k (w)+T k (w′); and computing a (m−1) th  set of values representing said m th  sequence of co-efficients. Thereby a large set of co-efficients for first to m−1 expressions can be carefully selected for use in redundancy calculations for at most m disk failures. 
     In addition, an advanced RAID system, having at least one array of n disks wherein n is a positive integer greater than or equal to 2, and a set of 2 redundancy disks associated with said at least one array is accordingly provided. The system further includes data and redundancy data in the form of a set of word segments residing in the above disks. The word segments have equal length and predetermined size. A method for updating redundancy information associated with the advanced RAID system, including: providing a first expression of redundancy data in terms of a first summation of a sequence of data, said sequence including a summation of data segments; providing a second expression of redundancy data in terms of a second summation, wherein the elements of said second summation includes elements of the first summation having each of the elements contained therein multiplied by a first sequence of co-effiecients; computing said first expression having at most 2 unknown values; computing said second expression having at most 2 unknown values, and second expression includes a set of translation of said sequence of data, said translation of data being subjected to conditions including for any 2 given words w and w′ T k (w+w′)=T k (w)+T k (w′); and computing a (m−1) th  set of values representing said m th  sequence of co-efficients. Thereby a large set of co-efficients for 2 expressions can be carefully selected for use in redundancy calculations for at most 2 disk failures. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     So that the manner in which the above recited features, advantages and objects of the present invention are attained and can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to the embodiments thereof which are illustrated in the appended drawings. 
     It is to be noted, however, that the appended drawings illustrate only typical embodiments of this invention and are therefore not to be considered limiting of its scope, for the invention may admit to other equally effective embodiments. 
     FIG. 0A shows a first computation example. 
     FIG. 0B shows a second computation example. 
     FIG. 1 is an array of data disks with 2 parity check disks. 
     FIG. 1A is a flowchart depicting the present invention. 
     FIG. 2 is an exemplified embodiment of the present invention having fixed P and Q disks. 
     FIG. 3 is an exemplified embodiment of the present invention having distributed P and Q disks. 
     FIGS. 4A-4H, in combination, are a table showing an exemplified computing result of the instant invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The following detailed description is of the best currently contemplated modes of carrying out the invention. The description is not to be taken in a limiting sense, but is made merely for the purpose of illustrating the general principles of the invention, since the scope of the invention is best defined by the appended claims. 
     Referring to FIG. 1, an array of disks is shown. A set of data disks D 1  . . . Dn, where n may be any integer greater than or equal to 2, is shown. A backup disk P and a backup disk Q is also provided. It should be noted that for practical purposes, only 2 backup disks are shown and discussed in detail herein. However, more disks may be used for backup purposes if required. Further, this array may be part of a larger disk array system. In the present invention, the * operation described supra takes a word of size N (where N denotes bit number) and returns another word of size N. It is then through this “translation” of the original word that was summed with the other words in the same line, thereby translating itself via its own distinct translator. In this sense, the P word (a specific word in disk P) corresponds to the sum of every word of the same line, and the Q word (a specific word in disk Q) is the sum of the translations of every word of the same line. It is noted that the translation operation could be costly since it was done through field multiplication. 
     Turning now to the translation process, the present invention provides a translation scheme of a word of size N to another word of size N in a more general context, yet keeping all other aspects of standard ADVANCED RAID described supra unchanged. For example, word size can be any size; it may be as small as 4 bits and as large as any suitable size. With the increase in the word size, the scope (i.e., number) of co-efficients can be correspondingly increased as well. By doing this, the number of choices of translators is increased, thereby permitting more efficient and/or more adequate translators in the context of a given implementation or application. 
     Let W(N) represents the set of all bit words of size N. A translator T for the set W(N) is a map (or operator) 
     
       
         T:W(N)→W(N). 
       
     
     To ensure the recovery of lost data the P-backup disk and Q-backup disk must be updated as soon as any data word in the array is updated. Since this update happens very frequently, the optimization of this update process is significant. 
     For a given stripe s whose words are w 1 , w 2 , . . . , w N , the P-backup and Q-backup words are as follows: 
     
       
           P=w   1   +w   2   + . . . +w   k   + . . . +w   N .  (1) 
       
     
     
       
           Q=T   1 ( w   1 )+ T   2 ( w   2 )+ . . . + T   k ( w   k )+ . . . + T   N ( w   N ).  (2) 
       
     
     As discussed supra, the sum of two words is understood to be a bitwise XORing of these words. The set of translators {T 1 , . . . , T N } will have some special properties which will be described infra. 
     To ensure recovery, P backup disk and Q backup disk must be updated as soon as any word of the stripe s is updated. If we wish to update word w k  to w k ′, the P-backup and Q-backup words corresponding to that stripe must be updated to be: 
     
       
           P′=w   1   +w   2   + . . . +w   k   ′+ . . . +w   N . 
       
     
     
       
           Q′=T   1 ( w   1 )+ T   2 ( w   2 )+ . . . + T   k ( w   k ′)+ . . . + T   N ( w   N ). 
       
     
     Since the sum of a word with itself yields the zero word (a zero word denotes a word wherein all bit therein are zero bits), we can update the P-backup and Q-backup as follows: 
     
       
           P′=P +( w   k   +w   k ′). 
       
     
     
       
           Q′=Q+T   k ( w   k )+ T   k ( w   k ′). 
       
     
     The translators are required to be linear so that this update computation can be simplified. In other words, translator T k  are required to satisfy the following conditions. 
     Condition 1 
     For any given words w and w′ 
     
       
           T   k ( w+w ′)= T   k ( W )+ T   k ( w ′). 
       
     
     If T k  satisfies this condition, the update of the Q-backup can be done using directly the sum of the new and old words (done already for the update of the P-backup. We get: 
     
       
           Q′=Q+T   k ( w   k   +w   k ′). 
       
     
     Next, we need to impose two more conditions on our translators in order for them to ensure further recovery. 
     If P or Q (or both) are lost (but no data word is lost), we can re-compute them using w 1  through w N  using (1) and (2). If any one data word w k  is lost (but not P), we can recompute w k  using (1) (note that sum and difference are the same in GF(2)): 
     
       
         
           w 
           k 
           =w 
           1 
           + . . . +w 
           k−1 
           +w 
           k+1 
           + . . . +w 
           N 
           +P. 
         
       
     
     If Q was lost along with w k  we could, once w k  recovered, re-compute Q using (2). As can be appreciated, the only losses the set up described in (1) and (2) does not ensure is the loss of a single data word w k  along with P and the loss of two or more data words. 
     The following two conditions address these types of losses. 
     Condition 2 
     Every translator T k  needs to be a bijection (one-to-one correspondence), i.e. there must be a mapping T k   −1 : W(N)→W(N) such that T k   −1 (T k (w))=w for any word w. 
     Condition 3 
     The sum (T j +T k ) of any two translators T j  and T k  must be a bijection. 
     A translator T is a bijection means that there must be a mapping T −1 : W(n)→W(n) such that T −1 (T(w))=w for any word w. We call this mapping T −1  the inverse mapping of T. In Condition 3 the sum of two translators T j  and T k  is defined to be the mapping (T j +T k ):W(n)→W(n) verifying (T j +T k )(w)=T j (w)+T k (w) for any given word w. 
     Condition 2 ensures that when a word w k  is lost, along with the word P corresponding to its line, it could be recovered. Indeed, assuming relations (1) and (2) are maintained, we have 
     
       
           T   k ( w   k )= T   1 ( w   1 )+ T   2 ( w   2 )+ . . . + T   k+1 ( w   k+1 )+ . . . + T   N ( w   N )+ Q   
       
     
     (Note that addition and subtraction are equivalent here). Since all the terms of the right hand side are known, we can compute T k (w k ) and deduce w k  using T k   −1 : 
       w   k   =T   k   −1 ( T   k ( w   k )). 
     We then recompute P using (1), thereafter we are back to a normal state. 
     The condition 3 allows us to recover if we loose two data words w j  and w k . Indeed, (1) and (2) yield 
     
       
           w   j   +w   k   =w   1   + . . . +w   j−1   +w   j+1   + . . . +w   k−1   +w   k+1   + . . . +w   N   (3) 
       
     
     and 
     
       
           T   j ( w   j )+ T   k ( w   k )= T   1 ( w   1 )+ . . . + T   j−1 ( w   j−1 ) + . . . + T   k−1 ( w   k−1 )+ T   k+1 ( w   k+1 )+ T   N ( w   N ).  (4) 
       
     
     Since all the terms of the right hand side are known, we can compute w j +w k  and T j (w j )+T k (w k ). Let these two words be A and B respectively denoted by T jk   −1  the inverse mapping of T j +T k  (the existence of this inverse is exactly what Condition  3  ensures). Then 
     
       
           w   j   =T   jk   −1 ( T   k ( A )+ B )  (5) 
       
     
     and 
     
       
           w   k   =T   jk   −1 ( T   j ( A )+ B ).  (6) 
       
     
     Indeed, 
     
       
           T   j ( A )= T   j ( w   j   +w   k )= T   j ( w   j )+ T   j ( w   k )  (by Condition 1) 
       
     
     hence 
     
       
           B+T   j ( A )= T   j ( w   j )+ T   k ( w   k )+ T   j ( w   j )+ T   j ( w   k )= T   k (w k )+T j (w k ) 
       
     
     (since the two T j (w j ) cancel each other out), 
     so by definition of the sum of translators; 
     
       
           B+T   j ( A )=( T   k   +T   j )( w   k ). 
       
     
     Making T jk   −1  operate on both sides of this equation we get that 
     
       
           T   jk   −1 ( B+T   j ( A ))= T   jk   −1 (( T   k   +T   j )( w   k ))= w   k . 
       
     
     We get w j =T jk   −1 (T k (A)+B) by a similar argument. Note that once, say w j , is obtained, we can get w k  with the simple computation w k =A−w j . One benefit of the use of (5) and (6) is that the two can be calculated in parallel. 
     A more Intuitive depiction can be described as follows. One can compute the P-parity using the standard way in that one can sum all the words of a given line together. The Q-parity, on the other hand is obtained by first translating every word of a given line with a particular translator corresponding to it&#39;s position in the line, and then summing these translations together. Further, every translator must be “smooth” (linear (condition 1)) and “backtrackable” (bijective (condition 2)), that is one needs to be able to tell what word has been translated if translation is done. Further, the sum of any two translators must be “backtrackable” (bijective (condition 3), that is we must be able to tell which word has been translated by both translators if given the sum of both translations. 
     This approach generalizes the standard approach using Galois fields and even Commutative Rings since the present teaches in the context of 2 or more redundant disks in an array of more than two data disks having fixed large word size the following: 
     1. Multiplication by a constant c k  in a given field or ring is linear; for any given words and w′, it is true that c k *(w+w′)=c k *w+c k *w′. 
     2. c k  has an inverse c k   −1  so that any given word w can be retrieved from the product c k *w since c k   −1 *c k *w=1*w=w (1 corresponds to the word 00 . . . 01). 
     3. The sum of any two coefficients c j +c k  is an element of the field or ring, hence has an inverse. 
     Showing these three properties corresponds to show, or is the equivalent of showing, that a set of distinct coefficients of a field satisfies the three conditions we imposed on our set of translators. 
     The linearity condition (Condition 1) of the translators suggests that we can represent them by matrices. If the size of one word is N, our matrix should have N columns of words of size N (we call this a N×N matrix). The matrix M k  corresponding to translator T k  will be such that the i th  column of M k  is the word T k (e i ) where e i  is the word having all 0s except in the i th  position. 
     The bijectivity of a translator corresponds to the invertibility of its related matrix. A matrix M is invertible if and only if the sum of any subset of its rows is non-zero. This is to say that not only no row can have all it&#39;s entries being 0, but also summing any two, three etc. rows of M must not result to the all-zero word. 
     The sum of two translators will correspond to the sum (in GF(2)) of its related matrices, that is, the matrix obtained by XORing each digit of one matrix with the digit of the other matrix which is at the same position. 
     A set of translators for a line of N words of size n will be hence a set of N n x n matrices such that every matrix is invertible, and the sum of any two matrices of the set is also invertible. That is, every individual matrix and the sum of any two matrices must have the following properties: 
     a) No row can have all it&#39;s entries being 0 and 
     b) XORing any two, three etc. row must not result in the all-zero word. 
     A set of columns satisfying a) and b) is said to be linearly independent. 
     The following representation shows explicitly which bits of word w must be XORed in order to obtain its translation T k (w). For example, if the i th  row is 00101001, then the i th  bit of the translated word is obtained by XORing together the third, fifth and eighth bit of the input word. Knowing this, the set of translators can be chosen so as to suit the implementations structure and requirements. For example we can minimize the total number of XORs needed for a translation by minimizing the total number of 1s in the matrix. We can further minimize the number of parallel XOR levels (if handling the computation of each bit of the translation in parallel) by minimizing the number of 1s per row. In addition, we can also choose the matrices so as to facilitate the pipelining of the XORs, etc. 
     Note that this scheme can be easily generalized to handle any number f of disks failures with only f redundancy disks. In other words, so far only 2 redundancy disks (P and Q) are provided. This necessarily means that only 2 errors can be corrected in a single array. However, if required, the present invention can use any natural number of redundancy disks greater than 2. For example, the present invention contemplates using 3 redundancy disks (e.g., P, Q, and Q′) to correct 3 errors occurring before correction or backup is performed. But it should be noted that for redundancy disks of greater than 2, increased number of computations than the 2 redundancy system is necessarily required. Therefore, depending upon the number of data disks and their quality, a given number of redundancy disks can be determined. 
     Methods of Matrix Set Generation 
     Lets define a set of {0,1}-matrices that satisfies the recoverability conditions described supra as a safe set. The more safe sets we possess, the more choices we shall have for use when required. Finding a large enough safe set can be difficult. Using known brute force “generate and check” algorithm may have exponential time complexity. Indeed, there is an order of 2 dxnxn  sets of d nxn matrices, and for every one of these sets, checking to see if these are safe requires an order of d 2 2 n  checks where d is the number of matrices in a set. An improvement can be achieved by using linear algebraic techniques and dexterous algorithmic design. 
     Suppose the choice of row words has a restricted and fixed structure; and the row words are independent of the other rows. Further, the number of desired matrices is fixed in advance. The following method of safe matrix set generation may be used. The method involves simply attempt to complete all rows of the matrices one by one, matrix by matrix, starting from the first row of the first matrix till the first row of the last matrix, then moving on to the second row of the first matrix, till the second row of the last matrix, and so on. At every step one must choose from the fixed set of words that can be used for matrix rows, and check for conditions or properties a) and b) listed supra. If the check fails, one must backtrack and choose another word for the previous position. This method reduces the overall number of checks, but can still be for all practical purposes intractable for some word spaces and number of disks. 
     The instant invention provides an improved method for generating many safe sets of matrices is provided. A given seed of invertible matrix and a generator key word are used to generate these safe sets. Generating these sets with different choices of seeds and words allows one to create a family of safe sets out of which to choose an optimal safe set. The optimal safe set is defined as a safe set which optimizes specific metrics of the chosen implementation scheme. In designing a disk array with N data disks, one can choose an optimal subset of size N from one of the safe sets. The point is that any subset of a safe set is safe. 
     The generation takes a seed M 1  (an invertible matrix),            M   1     =     [           —                   w   1        —               —                   w   2        —             ⋯             —                   w   n        —           ]       ,                          
     and let K(1), K(2), . . . , K(n) be the bits of any word K with K(1)=1.          The                 matrices                   M   i       =       [           —                   w   i        —               —                   w     i   +   1          —             ⋯             —                   w     i   +   n   -   1          —           ]                     (       i   =   2     ,   3   ,   …                )                              
     are recursively defined so that all w j  are obtained by the n previous words w j−1 , w j−2 , . . . , w j−n  through the relation 
     
       
           w   j   =K (1) w   j−n   +K (2) w   j−n−1   + . . . +K ( t ) w   j−n+t−1   + . . . +K ( n −1)w j−2   +k ( n )w j−1 . 
       
     
     We obtain M i  from M i−1  by letting rows  1  through n−1 of M i  be respectively rows  2  through n of M i−1 , and letting row n of M i  be obtained by summing given rows of M i−1 —these rows being determined by the key word K. 
     By this method we can check the invertibility of the matrix M i  a lot faster. More precisely; 
     1) M i  is automatically invertible. Indeed the first n−1 rows of M i  are automatically linearly independent (these were the last n−1 rows of M i−1 , which is invertible) and the K(1)=1 requirement forces the independence of any combination of the first n−1 rows of M i  with the last row. 
     2) This set up reduces the number of conditions to check for the invertibility of M h +M i  for h=i−n, . . . , i−1. Namely the first i-h rows of M h +M i  are automatically linearly independent. 
     Referring to FIG. 1A, flowchart  10  depicts a method suitable for both hardware as well as software implementation. 
     a) Start with any invertible seed matrix M 1  (step  12 ). 
     b) Select a key K (step  14 ). 
     c) Use the current matrix M i−1 , (initially i=2) and the key K to generate next matrix M i  (step  16 ) as described above. Then check if the set remains safe when this new matrix is added thereby M i  (step  18 ). 
     d) If the set is still safe then increase i by 1 (step  22 ) and go to step  18 . If the set is no longer safe then output (step  20 ) the current set (without new matrix) and go to step  14 . If all the possible choices of Matrices M i  have been exhausted (step  24 ) then go to step  12 . 
     Note that this method may be enhanced to produce yet a broader range of safe matrix set. To do so, instead of computing the “new word” of every new matrix using only words of the previous matrix, one can use words of earlier matrices even (not shown). One productive scheme would be, for example, not only use the “top word” of the previous matrix in calculating the new word, but use the XOR of the top words of several previous matrices (also not shown). 
     Note also that one could implement a similar method by shifting downward instead of upward, or by shifting columns instead of rows. 
     Let us illustrate the main method by example. We will choose a word having a size of 4. 
     a) Start with an invertible matrix, say the unit matrix:          [         1000           0100           0010           0001         ]       M   1                            
     b) Select a key K. Let us say K=1010. It is noted that the selection of K has 8 choices, namely K={1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111}. The selection of K=1010 is a random choice among the above 8. 
     c) To generate the subsequent matrix, shift the rows upward, and compute the new word:            [         1           0           1           0         ]     Key                       [         1000           0100           0010           0001         ]     M1                       [         0100           0010           0001             w   5           ]     M2                            
     Where w 5 =K(1)w 1 +K(2)w 2 +K(3)w 3 +K(4)w 4 =w 1 +w 3 =1000+0010=1010. 
     d) If M 2  and M 1 +M 2  are invertible, we can try to expand the sequence by going back to step c) with i=3.            [         1           0           1           0         ]     Key                       [         1000           0100           0010           0001         ]       M   1                         [         0100           0010           0001           1010         ]       M   2                         [         0100           0001           1010             w   6           ]       M   3                              
     Where w 6 =K(1)w 2 +K(2)w 3 +K(3)w 4 +K(4)w 5 =w 2 +w 4 =0100+0001=0101 
     d) If M 3 , M 1 +M 3  and M 2 +M 3  are invertible, we can try to expand the sequence by going back to step c) with i=4. 
     Continue this process until the matrix created in step c) fails to be invertible. 
     Illustration of the Instant Invention in Advanced RAID (by Way of an Example) 
     This illustration demonstrates a method that provides fault tolerance against two disk drive failures. This method may be implemented in hardware and may not require very high speed ASIC (Application Specific Integrated Circuits) process technology. The method can be expanded or scaled to any number of disk drives in an array and also to any number of data bits that will be processed simultaneously. 
     In some Advanced RAID implementation, to guard against any two disk drive failure, there are two check blocks created for every stripe of data. These check blocks are called P and Q check blocks. For example, if a stripe consists of ‘n’ data blocks DB 1 , DB 2 , . . . DBn then the P and Q blocks are computed as shown: 
     
       
           P=DB   1 + DB   2 + . . . + DBn   
       
     
       Q=M   1 ( DB   1 )+ M   2 ( DB   2 )+ . . . + Mn ( DBn ) 
     Note that in the equations above+means XOR operation. 
     M 1 , M 2 , . . . Mn are the unique matrices based on the position of the data blocks in the physical array. For example, if we want to operate on 4 bits of data at a time, then we need unique matrices M of size 4×4 such that              Q   =            [                       Q   1               Q   2                     Q   3                     Q   4           ]                 =                [           M     1   -   11             M     1   -   12             M     1   -   13             M     1   -   14                 M     1   -   21             M     1   -   22             M     1   -   23             M     1   -   24                 M     1   -   31             M     1   -   32             M     1   -   33             M     1   -   34                 M     1   -   41             M     1   -   42             M     1   -   43             M     1   -   44             ]                [                       DB   11               DB   12                     DB   13                     DB   14           ]     +                              [           M     2   -   11             M     2   -   12             M     2   -   13             M     2   -   14                 M     2   -   21             M     2   -   22             M     2   -   23             M     2   -   24                 M     2   -   31             M     2   -   32             M     2   -   33             M     2   -   34                 M     2   -   41             M     2   -   42             M     2   -   43             M     2   -   44             ]                [                       DB   21               DB   22                     DB   23                     DB   24           ]     +   …                 and         P   =       [                       P   1               P   2                     P   3                     P   4           ]     =         [         1       0       0       0           0       1       0       0           0       0       1       0           0       0       0       1         ]          [                       DB   11               DB   12                     DB   13                     DB   14           ]       +       [         1       0       0       0           0       1       0       0           0       0       1       0           0       0       0       1         ]          [                       DB   21               DB   22                     DB   23                     DB   24           ]       +   …                              
     For example, FIG. 2 shows a fixed RAID 4 type of physical disk array where there is a fixed disk drive for P check blocks and a fixed disk drive for Q check blocks in the example above, the Matrix is fixed with having one block in every disk drive. 
     FIG. 3 shows another example where the P and Q check blocks are distributed over n+2 disks like in a RAID  5  array configuration. In this case, the Matrix is not fixed for a disk drive. The Matrix value depends on the position of a block in a particular stripe. 
     To simplify our example, we will show a detailed analysis based upon FIG.  2 . It should be noted that the same method can be applied to FIG. 3 if each stripe in therein can be imagined as a separate disk array since the M value is not fixed to a physical disk. In other words, M is independent of physical disks. In the case of two disk failure in FIG. 2, we have: 
     Case 1: If the failure are two data disks k and m then 
     For stripe #s 
     
       
           DBk,s+DBm,s=IPs=Ps+ΣDBy,s ( y =1 , . . . , n  and  y≠k  or  m )  (1a) 
       
     
     
       
           Mk ( DBk,s )+ Mm ( DBm,s )= IQs=Qs+ΣMy ( DBy,s )( y =1 , . . . , n  and  y≠k  or  m )  (2a) 
       
     
     IPs and IQs are intermediate P and Q values derived from reading all the non-failed disks and P and Q disks. 
     So the data blocks are regenerated from the equations below: 
     
       
           DBk,s =( Mk+Mm ) −1 ( Mm ( IPs )+ IQs )  (3a) 
       
     
     
       
           DBm,s =( Mk+Mm ) −1 ( Mk ( IPs )+ IQs )  (4a) 
       
     
     Case 2: If the failure is one data disk k and check disk P 
     For stripe #s 
     
       
           Mk ( DBk,s )= IQs=Qs+ΣMy ( DBy,s )( y =1 , . . . , n  and  y≠k )  (5a) 
       
     
     
       
           DBk,s =( Mk ) −1 ( IQs )  (6a) 
       
     
     
       
           Ps=ΣDBy,s ( y =1 , . . . , n )  (7a) 
       
     
     The Ps is calculated after DBk,s is recovered. 
     Case 3: If the failure is one data disk k and check disk Q 
     For stripe #s 
     
       
           DBk,s=Ps+ΣDBy,s ( y =1 , . . . , n  and  y≠k )  (8a) 
       
     
     
       
           Qs=ΣMy ( DBy,s )( y =1 , . . . , n )  (9a) 
       
     
     The Qs is calculated after DBk,s is recovered. 
     So in cases 1 and 2, to calculate the data bits properly, all the matrices Mk should be individually invertible and the sum of any two matrices Mj and Mk in the set of matrices My (y=1 to n) should be invertible. If they are not invertible, we won&#39;t be able to get ‘w’ set of unique algebraic equations to solve all ‘w’ bits in a data word. Note that in the case of two data block failures, the equation 1 provides ‘w’ set of unique equations. 
     So when the Matrices of size w×w are chosen, they should satisfy conditions 2 and 3 mentioned in section 3. 
     It is noted that in a write operation in an optimal disk array (no disk has failed), if a data block DBj,m in stripe ‘m’ needs to be updated with new data (partial stripe write), the new values of Pm and Qm can be computed as below: 
     
       
         New  Pm =Old  Pm +Old  DBj,m +New  DBj,m   
       
     
     
       
         New  Qm =Old  Qm +( Cm *(Old  DBj,m +New  DBj,m )) 
       
     
     So the above operation requires reading three old blocks from the disk array, compute new P and Q blocks and writing the new data block, new P and new Q block. 
     For a whole stripe write operation in an optimal disk array (no disk has failed) or degraded disk array (one or two disk failure), the old data blocks, P and Q blocks do not need to be read. The new P and Q are calculated from the new data blocks of the full stripe. 
     
       
         New  Pm =New  DB   1 , m +New  DB   2 , m + . . . +New  DBn,m   
       
     
     
       
         New  Qm =( C   1 *New  DB   1 , m )+( C   2 *New  DB   2 , m )+ . . . +( Cn *New  DBn,m ) 
       
     
     In the case above, for an optimal disk array, there are n+2 block writes that include P and Q. For a degraded array with one disk failure, there will be n+1 block writes. Also if P or Q block belongs to the failed disk, then P or Q block does not need to be calculated. For a degraded array with two disk failures, there will be n block writes. Also if P or Q or both P and Q blocks belong to the two failed disks then P or Q or both P and Q do not need to be calculated. 
     For a write operation in a degraded disk array with failure in one disk position with distributed data, P and Q blocks as shown in FIG. 3, if a data block DBj,m in stripe ‘m’ needs to be updated with new data (partial stripe write), the new values of Pm and Qm can be computed as below: 
     1. If the data block DBj,m does not belong to failed disk then, 
     
       
         New  Pm =Old  Pm +Old  DBj,m +New  DBj,m   
       
     
     
       
         New  Qm =Old  Qm +( Cm *(Old  DBj,m +New  DBj,m )) 
       
     
     Above operation requires reading three old blocks from the disk array, compute new P and Q blocks and writing the new data block, new P and new Q block. It is noted that New Pm or New Qm does not need to be calculated if any of these two blocks belong to the failed disk since it cannot be updated. 
     2. If the data block DBj,m belongs to the failed disk then, 
     
       
         New  Pm =( XOR  of  DBn,m  where  n  is not equal to  j )+(New  DBj,m ) 
       
     
     
       
         New  Qm =( XOR  of ( Cn*DBn,m ) where  n  is not equal to  j )+( Cm *New  DBj,m ) 
       
     
     Above operation requires reading n+1 old blocks from the disk array, compute new P and Q blocks and writing new P and new Q block. 
     For a write operation in a degraded disk array with failure in two disk positions with distributed data, P and Q blocks as shown in FIG. 3, if a data block DBj,m in stripe ‘m’ needs to be updated with new data (partial stripe write), the new values of Pm and Qm can be computed as below: 
     1. If the data block DBj,m does not belong to failed disk then, 
     
       
         New  Pm =Old  Pm +Old  DBj,m +New  DBj,m   
       
     
     
       
         New  Qm =Old  Qm +( Cm *(Old  DBj,m +New  DBj,m )) 
       
     
     The above operation requires reading three old blocks from the disk array, compute new P and Q blocks and writing the new data block, new P and new Q block. It is noted that New Pm and/or New Qm does not need to be calculated if any of these two blocks belong to the failed disk since it cannot be updated. 
     2. If the data block DBj,m belongs to one of the failed disk (assuming disk j &amp; k failed) then, 
     
       
         New  Pm =Old  Pm +Calculated Old  DBj,m +New  DBj,m   
       
     
     
       
         New  Qm =Old  Qm +( Cm *(Calculated Old  DBj,m +New  DBj,m )) 
       
     
     Where Calculated Old DBj,m=(Mj+Mk) −1 (Mk(IPm)+IQm)—Refer to equation 3a. 
     The above operation requires reading n old blocks from the disk array, compute new P and Q blocks and writing new P and new Q block. It is noted that New Pm or New Qm does not need to be calculated if any of these two blocks belong to the failed disk since it cannot be updated. 
     For a read operation in a degraded disk array with failure in one disk position with distributed data, P and Q blocks as in FIG. 2, if a data block DBj,m in stripe ‘m’ needs to be read, this can be achieved as below: 
     
       
           DBj,m=Pm+ΣDBy,m ( y =1 , . . . , n  and  y≠j ) 
       
     
     Above operation requires reading n+1 old block from the disk array and computing DBj,m. 
     For a read operation in a degraded disk array with failure in two disk positions with distributed data, P and Q blocks as in FIG. 2, if a data block DBj,m in stripe ‘m’ needs to be read, this can be achieved as below: 
     
       
           DBj,m =( Mj+Mk ) −1 ( Mk ( IPs )+ IQs )  Refer to equation 3. 
       
     
     Above operation requires reading n old blocks from the disk array and compute DBj,m. 
     A simple example of 4 data disk and two parity disks is shown below. We will take 4 bits of data for our example. 
     D 1 =0001 
     D 2 =0010 
     D 3 =0100 
     D 4 =1000 
     Let us assume that the following matrices are associated with this stripe of data:              [         1000           0100           0010           0001         ]                  M1                         [         0011           1000           0100           0010         ]                  M2                       [         0110           0011           1000           0100         ]     M3                       [         1100           0110           0011           1000         ]     M4                            
     We can calculate P &amp; Q as follows:              P   =       D1   +   D2   +   D3   +   D4     =   1111.                 Q   =     M1D1   +   M2D2   +   M3D3   +   M4D4                 =     0001   +   1001   +   1001   +   1001                 =   1000                                
     Let us examine the various disk failure cases and the recovery methods. 
     Case 1: D 1  and D 2  failed. 
     We calculate the IP and IQ (see equation 1 &amp; 2) first.                      I                 P     =     D3   +   D4   +   P                 =     0100   +   1000   +   1111                 =   0011                             I                 Q     =     M3D3   +   M4D4   +   Q                 =     1001   +   1001   +   1000                 =   1000                                      
     D 1  can be recovered as follows:                         D1   =         (     M1   +   M2     )       -   1              (       M2        (   IP   )       +   IQ     )     .                   =         (       [                     1000           0100                 0010                 0001         ]     +     [                     0011           1000                 0100                 0010         ]       )       -   1            (       [                     0011           1000                 0100                 0010         ]     +     [                     0           0                 1                 1         ]     +   1000     )                   =         (     [                     1011           1100                 0110                 0011         ]     )       -   1            (     0001   +   1000     )                   =       [                     1001           1101                 1111                 1110         ]          (   1001   )                   =   0001                   See                 equation                 3                                
     Similarly,                    D2   =         (     M1   +   M2     )       -   1              (       M1        (     I                 P     )       +     I                 Q       )     .                   =         (     M1   +   M2     )       -   1              (     0011   +   1000     )     .                   =         (     M1   +   M2     )       -   1              (   1011   )     .                   =   0010                 See                 equation                 3                                
     Case 2: D 2  and P failed.                      I                 Q     =     Q   +   M1D1   +   M3D3   +     M4D4   .                                =     1000   +   0001   +   1001   +   1001                                =   1001                   See                 equation                 5                           D2   =     (   M2   )       )       -   1              (     I                 Q     )     .                              =         [                     0011           1000                 0100                 0010         ]       -   1            (   0001   )                                  =       [                     0100           0010                 0001                 1001         ]                     (   0001   )                                  =   0010.                   See                 equation                 6                                
     After calculating D 2  we can calculate P as below:                    P   =            D1   +   D2   +   D3   +     D4   .                   =          1111.                 See                 equation                 7                                
     Case 3: D 2  and Q failed                    D2   =            P   +   D1   +   D3   +     D4   .                   =            1111   +   0001   +   0100   +   1000                 =          0010                 See                 equation                 8                                
     After calculating D 2 , we can calculate Q as below:                    Q   =     M1D1   +   M2D2   +   M3D3   +     M4D4   .                   =     0001   +   1001   +   1001   +   1001                 =   1000                 See                 equation                 9                                
     FIGS. 4A-4H is a table showing a safe set of 255 matrices of size 8×8 obtained by the main method as depicted in FIG.  1 A. The key used in the table equals 142. It should be noted that the above table is just an example for 8 bits matrices. The same method can be used to generate matrices of any suitable size. 
     One embodiment of the invention is implemented as a program product for use with a computer system such as, for example, the Advanced RAID storage system and described below. The program(s) of the program product defines functions of the embodiments (including the methods described below with reference to FIGS. 1-3 and can be contained on a variety of signal-bearing media. Illustrative signal-bearing media include, but are not limited to: (i) information permanently stored on non-writable storage media (e.g., read-only memory devices within a computer such as CD-ROM disks readable by a CD-ROM drive); (ii) alterable information stored on writable storage media (e.g., floppy disks within a diskette drive or hard-disk drive); or (iii) information conveyed to a computer by a communications medium, such as through a computer or telephone network, including wireless communications. The latter embodiment specifically includes information downloaded from the Internet and other networks. Such signal-bearing media, when carrying computer-readable instructions that direct the functions of the present invention, represent embodiments of the present invention. 
     In general, the routines executed to implement the embodiments of the invention, whether implemented as part of an operating system or a specific application, component, program, module, object, or sequence of instructions may be referred to herein as a “program”. The computer program typically is comprised of a multitude of instructions that will be translated by the native computer into a machine-readable format and hence executable instructions. Also, programs are comprised of variables and data structures that either reside locally to the program or are found in memory or on storage devices. In addition, various programs described hereinafter may be identified based upon the application for which they are implemented in a specific embodiment of the invention. However, it should be appreciated that any particular program nomenclature that follows is used merely for convenience, and thus the invention should not be limited to use solely in any specific application identified and/or implied by such nomenclature. 
     While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.