Storage apparatus and controller

A storage apparatus includes a plurality of first storage mediums in which data is redundantly stored and a controller. The controller includes a formatting section which performs formatting in each of the plurality of first storage mediums, a detection section which detects a failure that has occurred in the plurality of first storage mediums, a control section which makes the formatting section stop the formatting at the time of the detection of the failure by the detection section and which rebuilds the data stored in the plurality of first storage mediums in which the failure has occurred in a second storage medium other than the plurality of first storage mediums, and a rebuild processing section which rebuilds the data stored in the plurality of first storage mediums in the second storage medium in accordance with instructions from the control section.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2011-059229, filed on Mar. 17, 2011, the entire contents of which are incorporated herein by reference.

FIELD

The embodiments discussed herein are related to a storage apparatus and a controller.

BACKGROUND

It is known that formatting a storage medium, such as an HDD (Hard Disk Drive), is performed as a first process for accessing all storage areas in the storage medium. With the formatting all the storage areas are accessed. Accordingly, there is a strong possibility that abnormal writing to the storage medium, for example, is detected first.

In addition, it is known that when abnormal writing to the storage medium occurs during the formatting, the process of rebuilding data in another storage medium (rebuild process) is performed.

If the formatting and the rebuild process are performed at the same time, the load on a CPU increases. This delays the completion of the formatting.

SUMMARY

According to one aspect, there is provided a storage apparatus that includes: a plurality of first storage mediums configured to redundantly store data; and one or more processors connected to the plurality of first storage mediums via a communication line for controlling writing of information to the plurality of first storage mediums and configured to perform a procedure that includes performing formatting in each of the plurality of first storage mediums, detecting a failure that has occurred in the plurality of first storage mediums, and stopping the formatting at the time of the detection of the failure and rebuilding the data stored in the plurality of first storage mediums in which the failure has occurred in a second storage medium other than the plurality of first storage mediums.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention will now be described in detail with reference to the accompanying drawings, wherein like reference numerals refer to like elements throughout.

FIG. 1illustrates a storage apparatus according to a first embodiment.

A storage apparatus1according to a first embodiment is connected to a host apparatus2via an electric communication line, an optical communication line, or the like.

The storage apparatus1includes a controller3and storage mediums4a,4b, and4c. The storage mediums4a,4b, and4chave storage areas in which information can be stored. The storage mediums4a,4b, and4care HDDs, SSDs (Solid State Drives), or the like. The storage apparatus1according to the first embodiment includes the three storage mediums4a,4b, and4c. However, the number of storage mediums may be two or less or four or more.

Each of the storage mediums4aand4bis an example of a first storage medium. Data is redundantly stored in the storage mediums4aand4b. That is to say, the same data is stored in the storage mediums4aand4b. Furthermore, the storage medium4cis an example of a second storage medium. InFIG. 1, the storage medium4cis included in advance in the storage apparatus1. However, the storage medium4cmay be mounted in the storage apparatus1at the time of the occurrence of a failure.

The controller3is connected to the storage mediums4a,4b, and4cvia communication lines (not illustrated). The controller3controls data access from the host apparatus2to the storage mediums4a,4b, and4c. That is to say, the controller3controls writing data to the storage medium4a,4b, or4cwhich is accepted from the host apparatus2and reading out data stored in the storage medium4a,4b, or4cwhich is accepted from the host apparatus2.

The controller3includes a formatting section3a, a detection section3b, a control section3c, a rebuild processing section3d, and a storage section3e.

The formatting section3aperforms formatting in each of the storage mediums4aand4b. In addition, the formatting section3amanages the progress of the formatting performed in each of the storage mediums4aand4b.

For example, if logical storage areas which are formed by logically dividing a storage area are formed in the storage mediums4aand4b, then the formatting can be performed by the logical storage area.

The detection section3bdetects a failure which occurs in the storage medium4aor4b. For example, if reading out data from the storage medium4bor writing data to the storage medium4bfails one or more times due to a fault or the like in the storage medium4b, then the detection section3bcan determine that a failure has occurred in the storage medium4b.FIG. 1indicates (by the mark “X”) a state in which a failure has occurred in the storage medium4b.

When the detection section3bdetects the failure, the control section3cmakes the formatting section3astop the formatting. The control section3cthen makes the rebuild processing section3drebuild data stored in the storage medium4bin which the failure has occurred in the storage medium4c.

In accordance with instructions from the control section3c, the rebuild processing section3drebuilds the data stored in the storage medium4bin the storage medium4c.

The formatting and the rebuild process are performed separately as a result of the processes by the control section3cand the rebuild processing section3d. Accordingly, it is possible to avoid performing the formatting and the rebuild process at the same time. As a result, a delay caused by performing the formatting and the rebuild process at the same time can be controlled. For example, if the rebuild process drags on, a fault may occur in the storage medium4ain which a fault has not occurred and stored data may be lost. However, avoiding performing the formatting and the rebuild process at the same time prevents this possibility.

In addition, by avoiding performing the formatting and the rebuild process at the same time, time taken to perform the rebuild process can be determined comparatively easily compared with the case where the formatting and the rebuild process are performed at the same time. Accordingly, time taken to perform each of the formatting and the rebuild process can be estimated easily.

Furthermore, the storage section3estores a management table3e1indicative of whether or not data is written to the storage medium4aor4bin which the formatting section3ais performing formatting. The management table3e1can indicate by the logical storage area whether or not data is written to the storage medium4aor4b.

The control section3crefers to the management table3e1and determines whether or not data is written to the storage medium4bin which the failure has occurred. If data is not written to the storage medium4b, then the control section3comits rebuilding data stored in a logical storage area in which the formatting section3ais performing formatting in the storage medium4c. The logical storage area is to be formatted by formatting performed later. Accordingly, the extra trouble of performing a rebuild process and rebuilding data can be saved by this process by the control section3c. Furthermore, the control section3cmay make the formatting section3abegin to perform formatting from the first in logical storage areas of the first storage mediums4aand4bfor which a rebuild process is omitted and in which a failure has not occurred. By doing so, formatting can be performed in the logical storage areas of the first storage mediums4aand4bfor which a rebuild process is omitted.

The formatting section3a, the detection section3b, the control section3c, the rebuild processing section3d, and the storage section3ecan be realized by functions which a CPU (Central Processing Unit) included in the controller3has. In addition, the management table3e1can be realized by an area of a nonvolatile storage medium, such as a flash ROM (Read Only Memory), included in the controller3.

The disclosed storage apparatus will now be described more concretely.

FIG. 2is a block diagram of a storage system according to a second embodiment.

A storage system1000includes a host apparatus30and a storage apparatus100connected to the host apparatus30via an FC (Fiber Channel) switch31. InFIG. 2, one host apparatus30is connected to the storage apparatus100. However, a plurality of host apparatus may be connected to the storage apparatus100.

The storage apparatus100includes a DE (Drive Enclosure)20aincluding a plurality of HDDs20and CMs (Controller Modules)10a,10b, and10cwhich manage a physical storage area of the drive enclosure20aby RAID (Redundant Arrays of Inexpensive/Independent Disks). In this embodiment the HDDs20are indicated as examples of storage mediums included in the drive enclosure20a. However, other storage mediums such as SSDs may be used. If distinctions are not made among the plurality of HDDs included in the drive enclosure20a, hereinafter the plurality of HDDs20will be referred to as a “HDD20group”. The total capacity of the HDD20group is, for example, 600 GB (GigaByte) to 240 TB (TeraByte).

The storage apparatus100uses the three controller modules10a,10b, and10cfor operation. By doing so, redundancy is ensured. The number of controller modules included in the storage apparatus100is not limited to three. Redundancy may be ensured by the use of two or four or more controller modules. Alternatively, only the controller module10amay be used.

Each of the controller modules10a,10b, and10cis an example of a controller. The controller modules10a,10b, and10care realized by the same hardware configuration.

Each of the controller modules10a,10b, and10ccontrols access to data stored in a physical storage area of an HDD20included in the drive enclosure20aby RAID in response to a data access request from the host apparatus30.

The controller modules10a,10b, and10care realized by the same hardware configuration, so the hardware configuration of the controller module10a, for example, will be described.

The controller module10aincludes a CPU101, a RAM (Random Access Memory)102, a flash ROM103, a cache memory104, a CA (Channel Adapter)105a, and DIs (Device Interfaces)106aand106b.

The CPU101controls the whole of the controller module10asynthetically by executing programs stored in the flash ROM103and the like. The RAM102temporarily stores at least a part of a program executed by the CPU101and various pieces of data which the CPU101needs to perform a process based on the program. The flash ROM103is a nonvolatile memory and stores a program executed by the CPU101, various pieces of data which the CPU101needs to execute the program, and the like.

In addition, data stored in the cache memory104is saved in the flash ROM103at the time of, for example, a power failure of the storage apparatus100.

The cache memory104temporarily stores data written to the HDD20group or read out from the HDD20group.

For example, when the controller module10areceives a data read instruction from the host apparatus30, the controller module10adetermines whether or not data to be read out is stored in the cache memory104. If the data to be read out is stored in the cache memory104, then the controller module10atransmits the data to be read out which is stored in the cache memory104to the host apparatus30. The controller module10acan quickly transmit the data to the host apparatus30, compared with the case where the controller module10areads out the data to be read out from the HDD20group.

In addition, the cache memory104may temporarily store data which the CPU101needs to perform a process. For example, a volatile semiconductor device, such as an SRAM, is used as the cache memory104. Furthermore, there is no special limit to the storage capacity of the cache memory104. The storage capacity of the cache memory104is, for example, about 2 to 64 GB.

The channel adapter105ais connected to the fiber channel switch31and is connected to a channel of the host apparatus30via the fiber channel switch31. The channel adapter105aprovides an interface function for exchanging data between the host apparatus30and the controller module10a.

The device interfaces106aand106bare connected to the drive enclosure20a. The device interfaces106aand106bprovide an interface function for exchanging data between the HDD20group included in the drive enclosure20aand the cache memory104. The controller module10aexchanges data via the device interfaces106aand106bwith the HDD20group included in the drive enclosure20a.

The controller modules10a,10b, and10care connected to one another via routers32and33. For example, when data is transmitted from the host apparatus to the controller module10avia the channel adapter105aand the host apparatus30requests the controller module10ato write the data to the HDD20group, the CPU101stores the received data in the cache memory104. In addition, the CPU101not only stores the received data in the cache memory104but also transmits the received data to the controller modules10band10cvia the routers32and33. A CPU included in each of the controller modules10band10cthen stores the received data in its cache memory. By doing so, the same data is stored in the cache memory104of the controller module10aand the cache memories of the controller modules10band10c.

A RAID group made up of one or more HDDs20of the plurality of HDDs20included in the drive enclosure20ais formed in the drive enclosure20a. This RAID group may also be referred to as a “logical volume,” a “virtual disk,” an “RLU (RAID Logical Unit),” or the like.

InFIG. 2, three RAID groups21,22, and23the RAID level of each of which is RAID1are indicated. The structure of each RAID group is taken as an example. Each RAID group may have another structure. For example, each of the RAID groups21,22, and23may include any number of HDDs20. Furthermore, the RAID groups21,22, and23may be set to any RAID level, such as RAID5or RAID6.

In addition, an HDD24is included in the drive enclosure20ain preparation for the occurrence of a failure in an HDD20. For example, if reading out data from or writing data to an HDD20fails one or more times due to a fault or the like in the HDD20, then the controller module10a,10b, or10cdetermines that a failure has occurred. When the storage apparatus100is in operation, the HDD24is on standby in an energized state. The HDD24is referred to as a hot spare disk. When a failure occurs in an HDD20in any of the RAID groups21,22, and23, a controller module that manages the HDD20in which the failure has occurred rebuilds data (same data that is) stored in the HDD20in which the failure has occurred in the HDD24. When the HDD20in which the failure has occurred is replaced with a normal HDD20, the controller module that manages the HDD20in which the failure has occurred copies back the data stored in the HDD24to the normal HDD20with which the HDD20in which the failure has occurred is replaced. The copy-back process is performed in the background.

For example, storage areas of HDDs20which make up the RAID group21are logically divided. A LUN (Logical Unit Number) is set for each storage area after the division. The controller module10aincludes a table (hereinafter referred to as the “LUN management table”) for managing set LUNs.

FIG. 3is a block diagram of the functions of the controller module in the second embodiment.

The controller module10aincludes an I/O control section111, a schedule control section112, a quick formatting section113, a write management table storage section114, a rebuild processing section115, and a failure detection section116.

The I/O control section111controls I/O access from the host apparatus30.

When the failure detection section116of the controller module10ainforms the schedule control section112that a failure has occurred in an HDD20included in the RAID group21during quick formatting by the quick formatting section113, the schedule control section112gives the rebuild processing section115instructions to perform a rebuild process corresponding to a state in which data is written to a set LUN. In addition, when the HDD20in which the failure has occurred is replaced with a normal HDD20, the schedule control section112gives the rebuild processing section115instructions to perform a copy-back process corresponding to the state in which data is written to the set LUN.

The quick formatting section113performs quick formatting by the LUN in a storage area of an HDD20included in the RAID group21. Quick formatting is an example of formatting. Quick formatting is performed in the following way. The quick formatting section113permits the host apparatus30access to the RAID group21before actually performing logical formatting and then performs the logical formatting in the background of the access by the host apparatus30. In this embodiment two kinds of quick formatting are defined: one-point formatting and sequential formatting. One-point formatting is performed in an area corresponding to an I/O request which the I/O control section111receives from the host apparatus30. Sequential formatting is performed sequentially in the storage areas of the HDDs20which make up the RAID group21regardless of an I/O request from the host apparatus30.

In addition, the quick formatting section113includes a table (hereinafter referred to as the “progress table”) for managing the progress of quick formatting according to LUNs.

The write management table storage section114stores a write management table for managing writing to a LUN included in a storage area of an HDD20at quick formatting time. The write management table storage section114is an example of a storage section.

When the above failure has occurred in the HDD20, the rebuild processing section115performs a rebuild process and a copy-back process. The rebuild processing section115includes a table (hereinafter referred to as the “rebuild management table”) for managing a rebuild process according to set LUNs and a table (hereinafter referred to as the “copy-back management table”) for managing a copy-back process according to set LUNs. When the rebuild processing section115performs a rebuild process, the rebuild processing section115sets a column in the rebuild management table corresponding to a LUN in which a rebuild process has ended to “rebuild completed”. When the rebuild management table is referred to, it is possible to determine whether or not a rebuild process is completed in each set LUN. Furthermore, When the rebuild processing section115performs a copy-back process, the rebuild processing section115sets a column in the copy-back management table corresponding to a LUN in which a copy-back process has ended to “copy-back completed”. When the copy-back management table is referred to, it is possible to determine whether or not a copy-back process is completed in each set LUN.

The failure detection section116detects that the failure has occurred in the HDD20included in the RAID group21.

FIG. 4is an example of a write management table.

A write management table114aindicated inFIG. 4includes LUN and QF (Quick Format) columns. Pieces of information arranged in the vertical direction are associated with each other.

Information for identifying LUNs set in the RAID group21is set in the LUN column.

Information for determining whether or not the host apparatus30writes data to a LUN in which quick formatting is being performed is set in the QF column. That is to say, “Yes” indicates that the host apparatus30writes data to a LUN in which the quick formatting section113is performing quick formatting. On the other hand, “No” indicates that the host apparatus30does not write data to a LUN in which the quick formatting section113is performing quick formatting.

Write management tables including the same information that is included in the write management table114aare constructed in the controller modules10band10c. The write management table constructed in the controller module10bmanages the state of the progress of quick formatting in LUNs set in the RAID group22. The write management table constructed in the controller module10cmanages the state of the progress of quick formatting in LUNs set in the RAID group23.

Quick formatting performed by the controller module10awill now be described.

FIGS. 5A through 5CandFIGS. 6A and 6Bare views for describing quick formatting performed by the controller module.

HDDs201and202illustrated inFIGS. 5A through 5Care two of the plurality of HDDs20which make up the RAID group21. I/O data from the host apparatus30is written to the HDDs201and202at the same time. That is to say, the HDDs201and202form what is called a mirrored pair. In order to begin quick formatting in the HDDs201and202, the schedule control section112gives the quick formatting section113instructions to begin quick formatting. As illustrated inFIG. 5A, the quick formatting section113begins to perform quick formatting in the HDDs201and202.

FIG. 5Bindicates a state in which a fault has occurred after the beginning of the quick formatting in the HDD202in which the quick formatting is being performed. If a fault has occurred in the HDD202, then the schedule control section112gives the rebuild processing section115instructions to perform a rebuild process.

FIG. 5Cindicates a rebuild process performed by the rebuild processing section115. The rebuild processing section115rebuilds (restores) data stored in the HDD201in the HDD24. The same data that is stored in the HDD202in which the failure has occurred is stored in the HDD201. When the rebuild process ends, a mirrored pair is formed by the HDDs201and204. After that, the schedule control section112gives the quick formatting section113instructions to resume the quick formatting.

After that, a new HDD203is mounted in place of the HDD202in which the failure has occurred. At this time, as illustrated inFIG. 6A, the schedule control section112gives the rebuild processing section115instructions to perform a copy-back process. The rebuild processing section115copies back the data stored in the HDD24to the new HDD203. When the copy-back process ends, a mirrored pair is formed by the HDDs201and203. As illustrated inFIG. 6B, the schedule control section112gives the quick formatting section113instructions to resume the quick formatting.

A process performed by the schedule control section112in the state illustrated inFIGS. 5B and 5C, that is to say, at the time of the occurrence of the failure in the HDD202after the beginning of the quick formatting by the quick formatting section113will now be described by the use of a flow chart.

FIG. 7is a flow chart of a process performed by the schedule control section.

When the failure detection section116of the controller module10ainforms the schedule control section112that a failure has occurred in an HDD included in the RAID group21, the schedule control section112gives the quick formatting section113instructions to temporarily stop sequential formatting. In accordance with these instructions the quick formatting section113temporarily stops the sequential formatting. In addition, the quick formatting section113stores the temporary stoppage of the sequential formatting in a storage area (not illustrated) of, for example, the quick formatting section113. However, when the quick formatting section113is performing one-point formatting or newly accepts a request to perform one-point formatting, the quick formatting section113performs the one-point formatting. Furthermore, at the time when the quick formatting section113stops the sequential formatting, the progress table is not rewritten. That is to say, even when the quick formatting section113stops the sequential formatting in a LUN set in the RAID group21, information which is indicative that the sequential formatting is being performed in the LUN is set in the progress table. After that, the schedule control section112proceeds to step S2.

(Step S2) The schedule control section112refers to the rebuild management table and selects one of LUNs to be checked. After that, the schedule control section112proceeds to step S3.

(Step S3) The schedule control section112refers to the progress of quick formatting in each LUN stored in the progress table, and determines whether or not quick formatting is being performed in the LUN selected in step S2. If a quick formatting is being performed in the LUN selected in step S2(“Yes” in step S3), then the schedule control section112proceeds to step S4. If quick formatting is not being performed in the LUN selected in step S2(“No” in step S3), then the schedule control section112proceeds to step S7.

(Step S4) The schedule control section112refers to the write management table114aand determines whether or not data is written to the LUN selected in step S2. If data is written to the LUN selected in step S2(“Yes” in step S4), then the schedule control section112proceeds to step S7. If data is not written to the LUN selected in step S2(“No” in step S4), then the schedule control section112proceeds to step S5.

(Step S5) The schedule control section112informs the quick formatting section113that all formatting is stopped in the LUN selected in step S2. As a result, even when the quick formatting section113is performing one-point formatting in the LUN selected in step S2, the quick formatting section113stops the one-point formatting. The schedule control section112then gives the rebuild processing section115instructions to instantly complete a rebuild process for the LUN selected in step S2. The rebuild processing section115which receives these instructions sets a column in the rebuild management table corresponding to the LUN selected in step S2to “rebuild completed”. That is to say, if data is not written to the LUN selected in step S2, to perform a rebuild process is omitted.

When the schedule control section112receives from the rebuild processing section115notice that the rebuild processing section115sets the column in the rebuild management table corresponding to the LUN selected in step S2to “rebuild completed”, the schedule control section112proceeds to step S6.

(Step S6) The schedule control section112sets a column in the progress table corresponding to the progress of quick formatting in the LUN selected in step S2to 0 (no progress). After that, the schedule control section112proceeds to step S8.

(Step S7) The schedule control section112gives the rebuild processing section115instructions to perform an ordinary rebuild process (which differs from the rebuild process in step S5). As a result, the rebuild processing section115reads out all data stored in the HDD201, and writes the data read out to the HDD24. After that, the schedule control section112proceeds to step S8.

(Step S8) The schedule control section112refers to the state of the progress of a rebuild process for each LUN in the rebuild management table and determines whether or not a rebuild process is completed for all LUNs set in the RAID group21. If a rebuild process is completed for all the LUNs set in the RAID group21(“Yes” in step S8), then the schedule control section112proceeds to step S9. If a rebuild process is not completed for all the LUNs set in the RAID group21(“No” in step S8), then the schedule control section112proceeds to step S2. A LUN to be checked is selected in step S2and steps S3ff. are then performed.

(Step S9) The schedule control section112gives the quick formatting section113instructions to resume the sequential formatting which is temporarily stopped in step S1. After that, the schedule control section112terminates the process indicated inFIG. 7.

The above is the description of the process indicated inFIG. 7.

A process performed by the schedule control section112in the state illustrated inFIG. 6A, that is to say, at the time of the HDD203being mounted in place of the HDD202after the resumption and during the performance of the quick formatting by the quick formatting section113will now be described by the use of a flow chart.

FIG. 8is a flow chart of a process performed by the schedule control section.

(Step S11) When a section of the controller module10awhich detects the replacement of an HDD20informs the schedule control section112that the HDD203is mounted in place of the HDD202in which the failure has occurred, the schedule control section112gives the quick formatting section113instructions to temporarily stop the sequential formatting. In accordance with these instructions the quick formatting section113temporarily stops the sequential formatting. However, when the quick formatting section113is performing one-point formatting or newly accepts a request to perform one-point formatting, the quick formatting section113performs the one-point formatting. Furthermore, at the time when the quick formatting section113stops the sequential formatting, the progress table is not rewritten by the use of initialization data or the like and holds information at the time of the sequential formatting being stopped. That is to say, even when the quick formatting section113stops the sequential formatting in a LUN set in the RAID group21, information which is indicative that the sequential formatting is being performed in the LUN is set in the progress table. After that, the schedule control section112proceeds to step S12.

(Step S12) The schedule control section112refers to the copy-back management table and selects one of LUNs to be checked. After that, the schedule control section112proceeds to step S13.

(Step S13) The schedule control section112refers to the progress table and determines whether or not quick formatting is being performed in the LUN selected in step S12. If quick formatting is being performed in the LUN selected in step S12(“Yes” in step S13), then the schedule control section112proceeds to step S14. If quick formatting is not being performed in the LUN selected in step S12(“No” in step S13), then the schedule control section112proceeds to step S17.

(Step S14) The schedule control section112refers to the write management table114aand determines whether or not data is written to the LUN selected in step S12. If data is written to the LUN selected in step S12(“Yes” in step S14), then the schedule control section112proceeds to step S17. If data is not written to the LUN selected in step S12(“No” in step S14), then the schedule control section112proceeds to step S15.

(Step S15) The schedule control section112informs the quick formatting section113that all formatting is stopped in the LUN selected in step S12. As a result, even when the quick formatting section113is performing one-point formatting in the LUN selected in step S12, the quick formatting section113stops the one-point formatting. The schedule control section112then gives the rebuild processing section115instructions to instantly complete a copy-back process for the LUN selected in step S12. The rebuild processing section115which receives these instructions sets a column in the copy-back management table corresponding to the LUN selected in step S12to “copy-back completed”. That is to say, if data is not written to the LUN selected in step S12, to perform a copy-back process is omitted.

When the schedule control section112receives from the rebuild processing section115notice that the rebuild processing section115sets the column in the copy-back management table corresponding to the LUN selected in step S12to “copy-back completed”, the schedule control section112proceeds to step S16.

(Step S16) The schedule control section112sets a column in the progress table corresponding to the progress of quick formatting in the LUN selected in step S12to 0 (no progress). After that, the schedule control section112proceeds to step S18.

(Step S17) The schedule control section112gives the rebuild processing section115instructions to perform an ordinary copy-back process (which differs from the copy-back process in step S15). As a result, the rebuild processing section115reads out all data stored in the HDD24, and writes the data read out to the HDD203. After that, the schedule control section112proceeds to step S18.

(Step S18) The schedule control section112refers to the copy-back management table and determines whether or not a copy-back process is completed for all LUNs set in the RAID group21. If a copy-back process is completed for all the LUNs set in the RAID group21(“Yes” in step S18), then the schedule control section112proceeds to step S19. If a copy-back process is not completed for all the LUNs set in the RAID group21(“No” in step S18), then the schedule control section112proceeds to step S12. A LUN to be checked is selected in step S12and steps S13ff. are then performed.

(Step S19) The schedule control section112gives the quick formatting section113instructions to resume the sequential formatting which is temporarily stopped in step S11. After that, the schedule control section112terminates the process indicated inFIG. 8.

The above is the description of the process indicated inFIG. 8.

As has been described in the foregoing, according to the controller module10athe schedule control section112performs the process indicated inFIG. 7. By doing so, the sequential formatting is temporarily stopped and the rebuild process is performed before the sequential formatting. The process indicated inFIG. 7makes it possible to avoid performing the rebuild process and the quick formatting at the same time. In addition, the schedule control section112performs the process indicated inFIG. 8. By doing so, the sequential formatting is temporarily stopped and the copy-back process is performed before the sequential formatting. The process indicated inFIG. 8makes it possible to avoid performing the copy-back process and the quick formatting at the same time. For example, if the rebuild process or the copy-back process drags on, a fault may occur in an HDD20which forms a mirrored pair and in which a fault has not occurred, and stored data may be lost. However, avoiding performing the rebuild process and the quick formatting at the same time or performing the copy-back process and the quick formatting at the same time prevents this possibility.

In addition, by avoiding performing the rebuild process and the quick formatting at the same time or performing the copy-back process and the quick formatting at the same time, time taken to perform the rebuild process or the copy-back process separately can be determined comparatively easily compared with the case where the rebuild process and the quick formatting or the copy-back process and the quick formatting are performed at the same time. Accordingly, time taken to perform each of the rebuild process and the copy-back process can be estimated easily.

Furthermore, if data is not written to the LUN selected in step S2ofFIG. 7, to perform a rebuild process is omitted in step S5ofFIG. 7. The LUN is to be formatted by quick formatting performed later. Accordingly, by performing step S5, the extra trouble of performing a rebuild process and rebuilding data can be saved. In addition, the rebuild process can be completed quickly. Moreover, if data is not written to the LUN selected in step S12ofFIG. 8, to perform a copy-back process is omitted in step S15ofFIG. 8. The LUN is to be formatted by quick formatting performed later. Accordingly, by performing step S15, the extra trouble of performing a copy-back process and copying back data can be saved. In addition, the copy-back process can be completed quickly. Furthermore, by performing the processes indicated inFIGS. 7 and 8, it is possible to omit performing a rebuild process and a copy-back process without a table for determining whether or not writing is performed by the stripe which is a part of a storage area of each of the HDDs20which make up the RAID group21.

In addition, if the quick formatting and the rebuild process are performed at the same time, a load on a transmission line or a disk may become heavy. A heavy load on the transmission line or the disk may also cause a delay. According to the controller module10aa delay caused by a heavy load on the transmission line or the disk can be controlled by the process ofFIG. 7performed by the schedule control section112.

The storage apparatus and the controller according to the present invention have been described on the basis of the embodiments illustrated. However, the present invention is not limited to these embodiments. The structure of each section can be replaced with any structure having the same function. In addition, any other section or process may be added to the present invention.

Furthermore, in the present invention the structures (characteristics) of the above two embodiments may be combined.

The above functions can be realized with a computer. In this case, a program in which the contents of the functions which the controller3and the controller modules10a,10b, and10chave are described is provided. By executing this program on the computer, the above functions are realized on the computer. This program can be recorded on a computer readable record medium. A computer readable record medium can be a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or the like. A magnetic recording device can be a hard disk drive, a flexible disk (FD), a magnetic tape, or the like. An optical disk can be a digital versatile disk (DVD), a DVD-RAM, a compact disk read only memory (CD-ROM)/rewritable (CD-RW), or the like. A magneto-optical recording medium can be a magneto-optical disk (MO) or the like.

To place the program on the market, portable record media, such as DVDs or CD-ROMs, on which it is recorded are sold. Alternatively, the program is stored in advance in a storage unit of a server computer and is transferred from the server computer to another computer via a network.

When the computer executes this program, it will store the program, which is recorded on a portable record medium or which is transferred from the server computer, on, for example, its storage unit. Then the computer reads the program from its storage unit and performs processes in compliance with the program. The computer can also read the program directly from a portable record medium and perform processes in compliance with the program. Furthermore, each time the program is transferred from the server computer connected thereto via a network, the computer can perform processes in turn in compliance with the program it receives.

In addition, at least a part of the above functions can be realized with an electronic circuit such as a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), or a PLD (Programmable Logic Device).

As has been described in the foregoing, according to the disclosed storage apparatus and controller a delay caused by performing a rebuild process and formatting at the same time can be controlled.