WO2012163223A1 - Data recovery methods and devices for bad sector of logical unit - Google Patents

Data recovery methods and devices for bad sector of logical unit Download PDF

Info

Publication number
WO2012163223A1
WO2012163223A1 PCT/CN2012/075492 CN2012075492W WO2012163223A1 WO 2012163223 A1 WO2012163223 A1 WO 2012163223A1 CN 2012075492 W CN2012075492 W CN 2012075492W WO 2012163223 A1 WO2012163223 A1 WO 2012163223A1
Authority
WO
WIPO (PCT)
Prior art keywords
logical unit
bad sector
host
unit
bad
Prior art date
Application number
PCT/CN2012/075492
Other languages
French (fr)
Chinese (zh)
Inventor
刘国霞
高军
曹红强
Original Assignee
成都市华为赛门铁克科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 成都市华为赛门铁克科技有限公司 filed Critical 成都市华为赛门铁克科技有限公司
Publication of WO2012163223A1 publication Critical patent/WO2012163223A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems

Definitions

  • Redundant Array of Independent Disk also known as a disk array (Disk Array) is a combination of multiple independent hard disks (physical hard disks) in different ways.
  • a hard disk group (logical hard disk).
  • the hard disk array can use striping technology to distribute data to each hard disk.
  • Each strip can be regarded as a logical unit (Logical Unit), which can use a logical unit number (Logical Unit Number). Said LUN) for identification.
  • Each logical unit is spread over a contiguous block, and the data is divided into blocks from 512 bytes to several megabytes, and then written to the respective hard disks.
  • the hard disk array can use the redundant data in the strip (that is, strip redundant data) to write and repair corrupted data in the strip.
  • the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data. If the damaged data in the stripe cannot be write-repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. When the host is triggered by the service to access the bad sectors of the logical unit, the bad sectors of the logical unit can be found and repaired, thereby reducing the timeliness of repair.
  • Embodiments of the present invention provide a data repair method and apparatus for a bad sector of a logical unit, which are used to improve the timeliness of repair.
  • An embodiment of the present invention provides a data repair method for a bad sector of a logical unit, including: the host queries a hard disk array for a bad sector of the logical unit;
  • the host receives the identification information of the bad sector of the logical unit sent by the hard disk array; the host repairs the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit.
  • the embodiment of the present invention provides another data repair method for a bad sector of a logical unit, including: the hard disk array stores the identification information of the bad sector of the logical unit;
  • the hard disk array sends, to the host, identification information of the bad sectors of the logical unit that is queried by the host, so that the host stores the bad sectors of the logical unit according to the identification information of the bad sectors of the logical unit.
  • the data is fixed.
  • the embodiment of the invention further provides a host, including:
  • the query unit is configured to query the hard disk array for a bad sector of the logical unit
  • a receiving unit configured to receive identification information of a bad sector of a logical unit sent by the hard disk array
  • a repairing unit configured to perform, according to the identification information of the bad sector of the logical unit, data stored in a bad sector of the logical unit repair.
  • the embodiment of the present invention further provides a hard disk array, including at least two hard disks and a hard disk controller, where the hard disk controller includes:
  • a storage unit configured to store identification information of a bad sector of the logical unit
  • a sending unit configured to send, to the host, identifier information of the bad sector of the logical unit that is queried by the host, so that the host sends a bad fan to the logical unit according to the identifier information of the bad sector of the logical unit The data stored in the area is repaired.
  • the host in the embodiment of the present invention queries the hard disk array for the bad sector of the logical unit, so that the host receives the identification information of the bad sector of the logical unit sent by the hard disk array, and further may be based on the bad sector of the logical unit.
  • the identification information is used to repair the data stored in the bad sector of the logical unit. Because the host can actively repair the data stored in the bad sector of the logical unit, the host in the prior art can only be triggered by the service. When the bad sector of the unit is used, the problem of repairing the data stored in the bad sector of the logical unit can be passively repaired, thereby improving the timeliness of repair.
  • FIG. 1 is a schematic flow chart of a data repairing method for a bad sector of a logical unit according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a data repairing method for a bad sector of a logical unit according to another embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a host according to another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a host according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention. detailed description
  • the data repair method for a bad sector of a logical unit in this embodiment may include:
  • the host queries the hard disk array for a bad sector of the logical unit
  • the host may periodically query the hard disk array for a bad sector of the logical unit. Write and repair corrupted data in the strip. If the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data, etc. When the damaged data in the strip is written and repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. At this time, the hard disk array can store the identification information of the bad sectors of the logical unit. For example: The identification information of the bad sectors of the logical unit may include, but is not limited to, a LUN, a logical block address (LBA), and a length (Length).
  • LBA logical block address
  • Length length
  • the above host receives the identification information of the bad sector of the logical unit sent by the hard disk array. Specifically, the host can receive the logical unit stored in the hard disk array sent by the hard disk array. The identification information of the sector.
  • the host performs repair on the data stored in the bad sector of the logical unit according to the identifier information of the bad sector of the logical unit.
  • the host may determine the bad sectors of the logical unit according to the identification information of the bad sectors of the logical unit, and then repair the data stored in the bad sectors of the logical unit.
  • the host can determine the file identifier corresponding to the identifier information of the bad sector of the logical unit according to the correspondence between the identifier information of the bad sector of the logical unit and the file identifier.
  • the method for the host to repair the data stored in the bad sector of the logical unit may be, for example, obtaining data stored in the bad sector of the logical unit by backing up data or other means, and sending a write request to the hard disk array, and the obtained data Rewrite.
  • the execution entity may be other devices such as a server in addition to the host.
  • the host queries the hard disk array for the bad sectors of the logical unit, so that the host receives the identification information of the bad sectors of the logical unit sent by the hard disk array, and further, according to the identification information of the bad sectors of the logical unit, the logic is The data stored in the bad sector of the unit is repaired.
  • the host can actively repair the data stored in the bad sector of the logical unit, so as to prevent the host from passively storing the bad sector of the logical unit when the host can only access the bad sector of the logical unit by the service.
  • the data is fixed to fix the problem, thus improving the timeliness of repair.
  • the host may indicate to the hard disk array that the logical unit is successfully repaired, so that the hard disk array is successfully Delete the identification information of the bad sectors of the above logical unit.
  • the hard disk array may delete the identification information of the bad sector of the logical unit.
  • the host in this embodiment may further receive the upcoming failure information sent by the hard disk array, where the invalidation information includes the identification information of the logical unit, and the foregoing invalidation information is a bad fan in the logical unit.
  • the hard disk array sends the data; then, the host may back up or migrate the data of the bad sector corresponding to the logical unit according to the identifier information of the logical unit.
  • These backup data can be used as reference data when the host repairs the data stored in the bad sectors of the logical unit.
  • the identifier information of the foregoing logical unit may include but is not limited to a LUN.
  • FIG. 2 is a schematic flowchart of a method for repairing a bad sector of a logical unit according to another embodiment of the present invention.
  • the data repair method for a bad sector of a logical unit in this embodiment may include:
  • the hard disk array stores identification information of a bad sector of the logical unit
  • the hard disk array can utilize the redundant data (ie, strip redundant data) in the strip to write and repair the damaged data in the strip. If the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data, etc. When the damaged data in the strip is written and repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. At this time, the hard disk array can store the identification information of the bad sectors of the logical unit. For example: The identification information of the bad sectors of the logical unit may include but is not limited to LUN, LBA and length.
  • the foregoing hard disk array sends, to the host, the bad sector of the foregoing logical unit that is queried by the host. And identifying information, so that the host repairs the data stored in the bad sector of the logical unit according to the identifier information of the bad sector of the logical unit.
  • the hard disk array may further receive the indication information sent by the host to indicate that the logical unit is successfully repaired by the logical unit, and then delete the bad sector of the logical unit. Identification information.
  • the hard disk array may delete the identification information of the bad sector of the logical unit.
  • the hard disk array in this embodiment may further send the upcoming failure information to the host, and the foregoing invalidation information
  • the identifier information of the logical unit is configured to enable the host to back up or migrate data of the bad sector corresponding to the logical unit according to the identifier information of the logical unit. These backup data can be used as reference data for the host to repair the data stored in the bad sectors of the logical unit.
  • the identification information of the foregoing logical unit may include, but is not limited to, a LUN.
  • the hard disk array when the hard disk array stores the identification information of the bad sectors of the logical unit, so that the host queries the hard disk array for the bad sectors of the logical unit, the hard disk array can send the identification information of the bad sectors of the logical unit that is queried by the host to the host. Therefore, the host can further repair the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit.
  • the hard disk array can provide the host with the identification information of the bad sectors of the logical unit according to the active query of the host, so that the host can actively repair the data stored in the bad sectors of the logical unit, thereby avoiding the host in the prior art.
  • FIG. 3 is a schematic structural diagram of a host according to another embodiment of the present invention.
  • the host in this embodiment may include a query unit 31, a receiving unit 32, and a repair unit 33.
  • the query unit 31 is configured to query the hard disk array for the bad sectors of the logical unit;
  • the receiving unit 32 is configured to receive the identification information of the bad sectors of the logical unit sent by the hard disk array;
  • the repair unit 33 is configured to use the foregoing logic received by the receiving unit 32.
  • the identification information of the bad sector of the unit is used to repair the data stored in the bad sector of the logical unit.
  • the functions of the host in the embodiment corresponding to the foregoing FIG. 1 and FIG. 2 can be implemented by the host provided in this embodiment.
  • the repairing unit 33 in this embodiment may specifically determine, according to the correspondence between the identification information of the bad sector of the logical unit and the file identifier, a file identifier corresponding to the identification information of the bad sector of the logical unit, and corresponding to the file identifier. The documents are recovered.
  • the repairing unit 33 in this embodiment may further indicate to the hard disk array that the logical unit bad sector repair is successful, so that the hard disk array deletes the logical unit bad sector. Identification information.
  • the query unit 31 in this embodiment may periodically periodically report to the foregoing hard disk array. Query the bad sectors of the logical unit.
  • the host queries the hard disk array for the bad sectors of the logical unit through the query unit 31, so that the receiving unit 32 receives the identification information of the bad sectors of the logical unit sent by the hard disk array, and the repair unit 33 can also use the logical unit according to the logical unit.
  • the identification information of the area is used to repair the data stored in the bad sector of the above logical unit.
  • the host can actively repair the data stored in the bad sector of the logical unit, so as to prevent the host from passively storing the bad sector of the logical unit when the host can only access the bad sector of the logical unit by the service.
  • the data is fixed to fix the problem, thus improving the timeliness of repair.
  • the host in this embodiment may further include a processing unit 41, configured to receive the upcoming invalidation information sent by the hard disk array, where the impending failure information includes the identification information of the logical unit, and the foregoing invalidation information is When the size of the bad sector in the logical unit exceeds a preset size threshold, the data of the bad sector corresponding to the logical unit is backed up or migrated according to the identifier information sent by the hard disk array.
  • a processing unit 41 configured to receive the upcoming invalidation information sent by the hard disk array, where the impending failure information includes the identification information of the logical unit, and the foregoing invalidation information is When the size of the bad sector in the logical unit exceeds a preset size threshold, the data of the bad sector corresponding to the logical unit is backed up or migrated according to the identifier information sent by the hard disk array.
  • FIG. 5 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention.
  • the hard disk array of this embodiment may include at least two hard disks 51 and a hard disk controller 52.
  • the hard disk controller 52 may include a storage unit 521 and a transmitting unit 522.
  • the storage unit 521 is configured to store the identifier information of the bad sector of the logical unit;
  • the sending unit 522 is configured to send, to the host, the identifier information of the bad sector of the logical unit that is queried by the host, so that the host is in accordance with the bad sector of the logical unit.
  • the identification information is used to repair the data stored in the bad sector of the logical unit.
  • the functions of the hard disk array in the embodiment corresponding to the foregoing FIG. 1 and FIG. 2 can be implemented by the hard disk controller 52 in the hard disk array provided in this embodiment.
  • the hard disk controller 52 in this embodiment may further include A deletion unit 523 is included.
  • the deleting unit 523 may receive the indication information sent by the host to indicate that the logical unit is successfully repaired, and delete the bad sector of the logical unit. Identification information;
  • the deleting unit 523 may directly delete the identification information of the bad sector of the logical unit.
  • the hard disk controller 52 in this embodiment may further include an indication unit 524, when the size of the bad sector in the logical unit stored by the storage unit 521 exceeds a preset size threshold. Sending the expiration information to the host, the foregoing invalidation information includes the identification information of the logical unit, so that the host backs up or migrates the data of the bad sector corresponding to the logical unit according to the identification information of the logical unit.
  • the hard disk array stores the identification information of the bad sectors of the logical unit through the storage unit 521 of the hard disk controller 52, so that when the host queries the hard disk array for the bad sectors of the logical unit, the sending unit 522 of the hard disk controller can send the sending unit 522 to the host.
  • the hard disk array can provide the host with the identification information of the bad sectors of the logical unit according to the active query of the host, so that the host can actively repair the data stored in the bad sectors of the logical unit, thereby avoiding the host in the prior art.
  • the service triggers access to the bad sectors of the logical unit, the problem of repairing the data stored in the bad sectors of the logical unit can be passively repaired, thereby improving the timeliness of repair.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a mobile hard disk, and a read only memory. (Read-Only Memory, ROM, ), Random Access Memory (RAM), disk or optical disk, and other media that can store program code.

Abstract

Embodiments of the present invention provide data recovery methods and devices for a bad sector of a logical unit. One of the methods comprises: a host querying a bad sector of a logical unit from a disk array; the host receiving identification information, sent by the disk array, of the bad sector of the logical unit; and the host recovering, according to the identification information of the bad sector of the logical unit, data stored in the bad sector of the logical unit. In the embodiments of the present invention, the host can actively recover data stored in a bad sector of a logical unit, so that the problem that data stored in a bad sector of a logical unit cannot be passively recovered until access of the host to the bad sector of the logical unit is triggered by a service in the prior art is avoided, and the recovery timeliness is enhanced.

Description

逻辑单元坏扇区的数据修复方法及装置 本申请要求于 11年 6月 2日提交中国专利局、申请号为 201110147934.4、 发明名称为 "逻辑单元坏扇区的数据修复方法及装置" 的中国专利申请的优先 权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及通信技术,尤其涉及逻辑单元坏扇区的数据修复方法及装置。 背景技术  Data repairing method and device for bad sector of logical unit This application claims to be Chinese patent filed on June 2, 2011, Chinese Patent Office, application number 201110147934.4, and the invention titled "data repair method and device for logical unit bad sector" Priority of the application, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD The present invention relates to communication technologies, and in particular, to a data repair method and apparatus for a bad sector of a logical unit. Background technique
独立磁盘冗余阵歹' J ( Redundant Array of Independent Disk, f¾ RAID ), 还可以筒称为硬盘阵列 (Disk Array ), 为多块独立的硬盘(物理硬盘)按不同 的方式组合起来所形成的一个硬盘组(逻辑硬盘)。 硬盘阵列可以利用条带 ( striping )技术将数据分布到各个硬盘上,每个条带可以看作是一个逻辑单元 ( Logical Unit, 筒称 LU ), 其可以用逻辑单元号 ( Logical Unit Number, 筒称 LUN ) 进行标识。 每个逻辑单元被分散到连续块(block )上, 数据被分成从 512字节到数兆字节的若干块之后, 再分别写到各个硬盘中。 硬盘阵列可以利 用条带内的冗余数据 (即条带冗余数据), 对条带内的损坏数据进行写修复。  Redundant Array of Independent Disk (f3⁄4 RAID), also known as a disk array (Disk Array), is a combination of multiple independent hard disks (physical hard disks) in different ways. A hard disk group (logical hard disk). The hard disk array can use striping technology to distribute data to each hard disk. Each strip can be regarded as a logical unit (Logical Unit), which can use a logical unit number (Logical Unit Number). Said LUN) for identification. Each logical unit is spread over a contiguous block, and the data is divided into blocks from 512 bytes to several megabytes, and then written to the respective hard disks. The hard disk array can use the redundant data in the strip (that is, strip redundant data) to write and repair corrupted data in the strip.
然而, 如果硬盘阵列没有条带冗余数据, 例如: 当 RAID 5中有一个硬盘 失效时, 就不能再对另一个失效的硬盘进行修复, 或者 RAID 0本身就没有条 带冗余数据等情况, 则无法对条带内的损坏数据进行写修复, 则出现了与损坏 数据相应的坏扇区即逻辑单元坏扇区。 当主机由业务触发访问逻辑单元坏扇区 时, 才能发现该逻辑单元坏扇区, 并对其进行修复, 从而降低了修复及时性。 本发明实施例提供逻辑单元坏扇区的数据修复方法及装置, 用以提高修复 及时性。 However, if the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data. If the damaged data in the stripe cannot be write-repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. When the host is triggered by the service to access the bad sectors of the logical unit, the bad sectors of the logical unit can be found and repaired, thereby reducing the timeliness of repair. Embodiments of the present invention provide a data repair method and apparatus for a bad sector of a logical unit, which are used to improve the timeliness of repair.
本发明实施例提供了一种逻辑单元坏扇区的数据修复方法, 包括: 主机向硬盘阵列查询逻辑单元坏扇区;  An embodiment of the present invention provides a data repair method for a bad sector of a logical unit, including: the host queries a hard disk array for a bad sector of the logical unit;
所述主机接收所述硬盘阵列发送的逻辑单元坏扇区的标识信息; 所述主机根据所述逻辑单元坏扇区的标识信息,对所述逻辑单元坏扇区存 储的数据进行修复。  The host receives the identification information of the bad sector of the logical unit sent by the hard disk array; the host repairs the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit.
本发明实施例提供了另一种逻辑单元坏扇区的数据修复方法, 包括: 硬盘阵列存储逻辑单元坏扇区的标识信息;  The embodiment of the present invention provides another data repair method for a bad sector of a logical unit, including: the hard disk array stores the identification information of the bad sector of the logical unit;
所述硬盘阵列向主机发送所述主机查询的所述逻辑单元坏扇区的标识信 息, 以使所述主机根据所述逻辑单元坏扇区的标识信息, 对所述逻辑单元坏扇 区存储的数据进行修复。  The hard disk array sends, to the host, identification information of the bad sectors of the logical unit that is queried by the host, so that the host stores the bad sectors of the logical unit according to the identification information of the bad sectors of the logical unit. The data is fixed.
本发明实施例还提供了一种主机, 包括:  The embodiment of the invention further provides a host, including:
查询单元, 用于向硬盘阵列查询逻辑单元坏扇区;  The query unit is configured to query the hard disk array for a bad sector of the logical unit;
接收单元, 用于接收所述硬盘阵列发送的逻辑单元坏扇区的标识信息; 修复单元, 用于根据所述逻辑单元坏扇区的标识信息, 对所述逻辑单元坏 扇区存储的数据进行修复。  a receiving unit, configured to receive identification information of a bad sector of a logical unit sent by the hard disk array, and a repairing unit, configured to perform, according to the identification information of the bad sector of the logical unit, data stored in a bad sector of the logical unit repair.
本发明实施例还提供了一种硬盘阵列, 包括至少两个硬盘和硬盘控制器, 所述硬盘控制器包括:  The embodiment of the present invention further provides a hard disk array, including at least two hard disks and a hard disk controller, where the hard disk controller includes:
存储单元, 用于存储逻辑单元坏扇区的标识信息;  a storage unit, configured to store identification information of a bad sector of the logical unit;
发送单元, 用于向主机发送所述主机查询的所述逻辑单元坏扇区的标识信 息, 以使所述主机根据所述逻辑单元坏扇区的标识信息, 对所述逻辑单元坏扇 区存储的数据进行修复。 a sending unit, configured to send, to the host, identifier information of the bad sector of the logical unit that is queried by the host, so that the host sends a bad fan to the logical unit according to the identifier information of the bad sector of the logical unit The data stored in the area is repaired.
由上述技术方案可知, 本发明实施例的主机通过向硬盘阵列查询逻辑单元坏 扇区, 使得主机接收该硬盘阵列发送的逻辑单元坏扇区的标识信息, 进而可以 根据上述逻辑单元坏扇区的标识信息,对上述逻辑单元坏扇区存储的数据进行 修复, 由于主机能够主动对逻辑单元坏扇区存储的数据进行修复, 在一定程度 上避免了现有技术中主机只能由业务触发访问逻辑单元坏扇区时才能被动地 对该逻辑单元坏扇区存储的数据进行修复的问题, 从而提高了修复及时性。 附图说明 为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。  According to the foregoing technical solution, the host in the embodiment of the present invention queries the hard disk array for the bad sector of the logical unit, so that the host receives the identification information of the bad sector of the logical unit sent by the hard disk array, and further may be based on the bad sector of the logical unit. The identification information is used to repair the data stored in the bad sector of the logical unit. Because the host can actively repair the data stored in the bad sector of the logical unit, the host in the prior art can only be triggered by the service. When the bad sector of the unit is used, the problem of repairing the data stored in the bad sector of the logical unit can be passively repaired, thereby improving the timeliness of repair. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only the present invention. In some embodiments, other drawings may be obtained from those of ordinary skill in the art in light of the inventive work.
图 1为本发明一实施例提供的逻辑单元坏扇区的数据修复方法的流程示意 图;  1 is a schematic flow chart of a data repairing method for a bad sector of a logical unit according to an embodiment of the present invention;
图 2为本发明另一实施例提供的逻辑单元坏扇区的数据修复方法的流程示 意图;  2 is a schematic flowchart of a data repairing method for a bad sector of a logical unit according to another embodiment of the present invention;
图 3为本发明另一实施例提供的主机的结构示意图;  3 is a schematic structural diagram of a host according to another embodiment of the present invention;
图 4为本发明另一实施例提供的主机的结构示意图;  4 is a schematic structural diagram of a host according to another embodiment of the present invention;
图 5为本发明另一实施例提供的硬盘阵列的结构示意图;  FIG. 5 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention;
图 6为本发明另一实施例提供的硬盘阵列的结构示意图;  FIG. 6 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention;
图 7为本发明另一实施例提供的硬盘阵列的结构示意图。 具体实施方式 FIG. 7 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中 的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其 他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图 1为本发明一实施例提供的逻辑单元坏扇区的数据修复方法的流程 示意图, 如图 1所示, 本实施例的逻辑单元坏扇区的数据修复方法可以包 括:  1 is a schematic flowchart of a method for repairing a bad sector of a logical unit according to an embodiment of the present invention. As shown in FIG. 1, the data repair method for a bad sector of a logical unit in this embodiment may include:
1 01、 主机向硬盘阵列查询逻辑单元坏扇区;  1 01. The host queries the hard disk array for a bad sector of the logical unit;
具体地, 上述主机可以周期性向上述硬盘阵列查询逻辑单元坏扇区。 对条带内的损坏数据进行写修复。 如果硬盘阵列没有条带冗余数据, 例如: 当 RAID 5中有一个硬盘失效时, 就不能再对另一个失效的硬盘进行修复, 或者 RAID 0本身就没有条带冗余数据等情况,则无法对条带内的损坏数据 进行写修复, 则出现了与损坏数据相应的坏扇区即逻辑单元坏扇区。 此时, 硬盘阵列可以存储逻辑单元坏扇区的标识信息。 例如: 逻辑单元坏扇区的 标识信息可以包括但不限于 LUN、 逻辑块地址 ( Logical Block Address, 筒称 LBA ) 和长度 ( Length ) 。  Specifically, the host may periodically query the hard disk array for a bad sector of the logical unit. Write and repair corrupted data in the strip. If the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data, etc. When the damaged data in the strip is written and repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. At this time, the hard disk array can store the identification information of the bad sectors of the logical unit. For example: The identification information of the bad sectors of the logical unit may include, but is not limited to, a LUN, a logical block address (LBA), and a length (Length).
1 02、 上述主机接收上述硬盘阵列发送的逻辑单元坏扇区的标识信息; 具体地, 主机可以接收硬盘阵列发送的该硬盘阵列存储的逻辑单元坏 扇区的标识信息。 The above host receives the identification information of the bad sector of the logical unit sent by the hard disk array. Specifically, the host can receive the logical unit stored in the hard disk array sent by the hard disk array. The identification information of the sector.
1 03、 上述主机根据上述逻辑单元坏扇区的标识信息, 对上述逻辑单元 坏扇区存储的数据进行修复。  1 03. The host performs repair on the data stored in the bad sector of the logical unit according to the identifier information of the bad sector of the logical unit.
例如: 主机可以根据上述逻辑单元坏扇区的标识信息, 确定上述逻辑 单元坏扇区, 然后, 对上述逻辑单元坏扇区存储的数据进行修复。  For example, the host may determine the bad sectors of the logical unit according to the identification information of the bad sectors of the logical unit, and then repair the data stored in the bad sectors of the logical unit.
再例如: 主机可以根据逻辑单元坏扇区的标识信息与文件标识的对应 关系, 确定与上述逻辑单元坏扇区的标识信息对应的文件标识, 最后, 上 可以理解的是: 本实施例中, 主机对逻辑单元坏扇区存储的数据进行 修复的方法可以采用的方法, 例如: 通过备份数据、 或者其他途径获得逻 辑单元坏扇区存储的数据, 并向硬盘阵列发送写请求, 将获得的数据重新 写入。  For example, the host can determine the file identifier corresponding to the identifier information of the bad sector of the logical unit according to the correspondence between the identifier information of the bad sector of the logical unit and the file identifier. Finally, it can be understood that, in this embodiment, The method for the host to repair the data stored in the bad sector of the logical unit may be, for example, obtaining data stored in the bad sector of the logical unit by backing up data or other means, and sending a write request to the hard disk array, and the obtained data Rewrite.
需要说明的是, 在本发明实施例中执行主体除了主机以外, 还可以是 服务器等其他设备。  It should be noted that, in the embodiment of the present invention, the execution entity may be other devices such as a server in addition to the host.
本实施例中, 主机通过向硬盘阵列查询逻辑单元坏扇区, 使得主机接 收该硬盘阵列发送的逻辑单元坏扇区的标识信息, 进而可以根据上述逻辑 单元坏扇区的标识信息, 对上述逻辑单元坏扇区存储的数据进行修复。 本 实施例中, 主机能够主动对逻辑单元坏扇区存储的数据进行修复, 避免了 现有技术中主机只能由业务触发访问逻辑单元坏扇区时才能被动地对该逻 辑单元坏扇区存储的数据进行修复的问题, 从而提高了修复及时性。  In this embodiment, the host queries the hard disk array for the bad sectors of the logical unit, so that the host receives the identification information of the bad sectors of the logical unit sent by the hard disk array, and further, according to the identification information of the bad sectors of the logical unit, the logic is The data stored in the bad sector of the unit is repaired. In this embodiment, the host can actively repair the data stored in the bad sector of the logical unit, so as to prevent the host from passively storing the bad sector of the logical unit when the host can only access the bad sector of the logical unit by the service. The data is fixed to fix the problem, thus improving the timeliness of repair.
可选地, 如果上述主机修复上述逻辑单元坏扇区成功, 则上述主机可 以向上述硬盘阵列指示上述逻辑单元坏扇区修复成功, 以使上述硬盘阵列 删除上述逻辑单元坏扇区的标识信息。 Optionally, if the host repairs the bad sector of the logical unit successfully, the host may indicate to the hard disk array that the logical unit is successfully repaired, so that the hard disk array is successfully Delete the identification information of the bad sectors of the above logical unit.
可选地, 如果上述主机修复上述逻辑单元坏扇区成功, 则硬盘阵列可 以删除上述逻辑单元坏扇区的标识信息。  Optionally, if the host repairs the bad sector of the logical unit successfully, the hard disk array may delete the identification information of the bad sector of the logical unit.
可选地, 在 101之前, 本实施例中的主机还可以进一步接收上述硬盘 阵列发送的即将失效信息, 上述即将失效信息包括逻辑单元的标识信息, 上述即将失效信息为当上述逻辑单元中坏扇区的大小超过预先设置的大小 阈值时, 上述硬盘阵列发送的; 然后, 上述主机可以根据上述逻辑单元的 标识信息, 对上述逻辑单元所对应的坏扇区的数据进行备份或迁移。 这些 备份数据可以作为主机对逻辑单元坏扇区存储的数据进行修复时的参考数 据。 其中, 上述逻辑单元的标识信息可以包括但不限于 LUN。  Optionally, before the 101, the host in this embodiment may further receive the upcoming failure information sent by the hard disk array, where the invalidation information includes the identification information of the logical unit, and the foregoing invalidation information is a bad fan in the logical unit. When the size of the area exceeds a preset size threshold, the hard disk array sends the data; then, the host may back up or migrate the data of the bad sector corresponding to the logical unit according to the identifier information of the logical unit. These backup data can be used as reference data when the host repairs the data stored in the bad sectors of the logical unit. The identifier information of the foregoing logical unit may include but is not limited to a LUN.
图 2为本发明另一实施例提供的逻辑单元坏扇区的数据修复方法的流 程示意图, 如图 2所示, 本实施例的逻辑单元坏扇区的数据修复方法可以 包括:  FIG. 2 is a schematic flowchart of a method for repairing a bad sector of a logical unit according to another embodiment of the present invention. As shown in FIG. 2, the data repair method for a bad sector of a logical unit in this embodiment may include:
201、 硬盘阵列存储逻辑单元坏扇区的标识信息;  201. The hard disk array stores identification information of a bad sector of the logical unit;
具体地, 硬盘阵列可以利用条带内的冗余数据 (即条带冗余数据) , 对条带内的损坏数据进行写修复。 如果硬盘阵列没有条带冗余数据, 例如: 当 RAID 5中有一个硬盘失效时, 就不能再对另一个失效的硬盘进行修复, 或者 RAID 0本身就没有条带冗余数据等情况,则无法对条带内的损坏数据 进行写修复, 则出现了与损坏数据相应的坏扇区即逻辑单元坏扇区。 此时, 硬盘阵列可以存储逻辑单元坏扇区的标识信息。 例如: 逻辑单元坏扇区的 标识信息可以包括但不限于 LUN、 LBA和长度。  Specifically, the hard disk array can utilize the redundant data (ie, strip redundant data) in the strip to write and repair the damaged data in the strip. If the hard disk array does not have strip redundant data, for example: When one hard disk in RAID 5 fails, it can no longer repair another failed hard disk, or RAID 0 itself has no striped redundant data, etc. When the damaged data in the strip is written and repaired, a bad sector corresponding to the corrupted data, that is, a bad sector of the logical unit appears. At this time, the hard disk array can store the identification information of the bad sectors of the logical unit. For example: The identification information of the bad sectors of the logical unit may include but is not limited to LUN, LBA and length.
202、上述硬盘阵列向主机发送上述主机查询的上述逻辑单元坏扇区的 标识信息, 以使上述主机根据上述逻辑单元坏扇区的标识信息, 对上述逻 辑单元坏扇区存储的数据进行修复。 202. The foregoing hard disk array sends, to the host, the bad sector of the foregoing logical unit that is queried by the host. And identifying information, so that the host repairs the data stored in the bad sector of the logical unit according to the identifier information of the bad sector of the logical unit.
可选地, 如果上述主机修复上述逻辑单元坏扇区成功, 硬盘阵列还可 以进一步接收上述主机发送的用于指示上述逻辑单元坏扇区修复成功的指 示信息, 然后, 删除上述逻辑单元坏扇区的标识信息。  Optionally, if the host repairs the bad sector of the logical unit successfully, the hard disk array may further receive the indication information sent by the host to indicate that the logical unit is successfully repaired by the logical unit, and then delete the bad sector of the logical unit. Identification information.
可选地, 如果上述主机修复上述逻辑单元坏扇区成功, 则硬盘阵列可 以删除上述逻辑单元坏扇区的标识信息。  Optionally, if the host repairs the bad sector of the logical unit successfully, the hard disk array may delete the identification information of the bad sector of the logical unit.
可选地, 在 201之后, 当硬盘阵列存储的逻辑单元中坏扇区的大小超 过预先设置的大小阈值时, 本实施例中的硬盘阵列还可以进一步向主机发 送即将失效信息, 上述即将失效信息包括上述逻辑单元的标识信息, 以使 上述主机根据上述逻辑单元的标识信息, 对上述逻辑单元所对应的坏扇区 的数据进行备份或迁移。 这些备份数据可以作为主机对逻辑单元坏扇区存 储的数据进行修复时的参考数据。 其中, 上述逻辑单元的标识信息可以包 括但不限于 LUN。  Optionally, after 201, when the size of the bad sector in the logical unit of the hard disk array exceeds a preset size threshold, the hard disk array in this embodiment may further send the upcoming failure information to the host, and the foregoing invalidation information And the identifier information of the logical unit is configured to enable the host to back up or migrate data of the bad sector corresponding to the logical unit according to the identifier information of the logical unit. These backup data can be used as reference data for the host to repair the data stored in the bad sectors of the logical unit. The identification information of the foregoing logical unit may include, but is not limited to, a LUN.
本实施例中, 硬盘阵列通过存储逻辑单元坏扇区的标识信息, 使得主 机向硬盘阵列查询逻辑单元坏扇区时, 硬盘阵列能够向主机发送该主机查 询的上述逻辑单元坏扇区的标识信息, 使得主机进而可以根据上述逻辑单 元坏扇区的标识信息, 对上述逻辑单元坏扇区存储的数据进行修复。 本实 施例中, 硬盘阵列能够根据主机的主动查询向主机提供逻辑单元坏扇区的 标识信息, 使得主机能够主动对逻辑单元坏扇区存储的数据进行修复, 避 免了现有技术中主机只能由业务触发访问逻辑单元坏扇区时才能被动地对 该逻辑单元坏扇区存储的数据进行修复的问题, 从而提高了修复及时性。 需要说明的是: 对于前述的各方法实施例, 为了筒单描述, 故将其都表述 为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不受所描述的 动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。 其次, 本领域技术人员也应该知悉, 说明书中所描述的实施例均属于优选实施 例, 所涉及的动作和模块并不一定是本发明所必须的。 In this embodiment, when the hard disk array stores the identification information of the bad sectors of the logical unit, so that the host queries the hard disk array for the bad sectors of the logical unit, the hard disk array can send the identification information of the bad sectors of the logical unit that is queried by the host to the host. Therefore, the host can further repair the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit. In this embodiment, the hard disk array can provide the host with the identification information of the bad sectors of the logical unit according to the active query of the host, so that the host can actively repair the data stored in the bad sectors of the logical unit, thereby avoiding the host in the prior art. When the service triggers access to the bad sectors of the logical unit, the problem of repairing the data stored in the bad sectors of the logical unit can be passively repaired, thereby improving the timeliness of repair. It should be noted that, for each of the foregoing method embodiments, for the description of the package, it is expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present invention. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有详 述的部分, 可以参见其他实施例的相关描述。  In the above embodiments, the descriptions of the various embodiments are different, and the details are not described in the specific embodiments. For details, refer to related descriptions of other embodiments.
图 3为本发明另一实施例提供的主机的结构示意图, 如图 3所示, 本 实施例的主机可以包括查询单元 31、 接收单元 32和修复单元 33。 其中, 查询单元 31用于向硬盘阵列查询逻辑单元坏扇区; 接收单元 32用于接收 上述硬盘阵列发送的逻辑单元坏扇区的标识信息; 修复单元 33用于根据接 收单元 32接收的上述逻辑单元坏扇区的标识信息, 对上述逻辑单元坏扇区 存储的数据进行修复。  FIG. 3 is a schematic structural diagram of a host according to another embodiment of the present invention. As shown in FIG. 3, the host in this embodiment may include a query unit 31, a receiving unit 32, and a repair unit 33. The query unit 31 is configured to query the hard disk array for the bad sectors of the logical unit; the receiving unit 32 is configured to receive the identification information of the bad sectors of the logical unit sent by the hard disk array; and the repair unit 33 is configured to use the foregoing logic received by the receiving unit 32. The identification information of the bad sector of the unit is used to repair the data stored in the bad sector of the logical unit.
上述图 1和图 2对应的实施例中主机的功能可以由本实施例提供的主 机实现。  The functions of the host in the embodiment corresponding to the foregoing FIG. 1 and FIG. 2 can be implemented by the host provided in this embodiment.
进一步地, 本实施例中的修复单元 33具体可以根据逻辑单元坏扇区的 标识信息与文件标识的对应关系, 确定与上述逻辑单元坏扇区的标识信息 对应的文件标识, 对上述文件标识对应的文件进行爹复。  Further, the repairing unit 33 in this embodiment may specifically determine, according to the correspondence between the identification information of the bad sector of the logical unit and the file identifier, a file identifier corresponding to the identification information of the bad sector of the logical unit, and corresponding to the file identifier. The documents are recovered.
进一步地, 若修复上述逻辑单元坏扇区成功, 本实施例中的修复单元 33还可以进一步向上述硬盘阵列指示上述逻辑单元坏扇区修复成功, 以使 上述硬盘阵列删除上述逻辑单元坏扇区的标识信息。  Further, if the repairing of the logical unit bad sector is successful, the repairing unit 33 in this embodiment may further indicate to the hard disk array that the logical unit bad sector repair is successful, so that the hard disk array deletes the logical unit bad sector. Identification information.
进一步地, 本实施例中的查询单元 31具体可以周期性向上述硬盘阵列 查询逻辑单元坏扇区。 Further, the query unit 31 in this embodiment may periodically periodically report to the foregoing hard disk array. Query the bad sectors of the logical unit.
本实施例中, 主机通过查询单元 31向硬盘阵列查询逻辑单元坏扇区, 使得接收单元 32接收该硬盘阵列发送的逻辑单元坏扇区的标识信息, 进而 修复单元 33可以根据上述逻辑单元坏扇区的标识信息, 对上述逻辑单元坏 扇区存储的数据进行修复。 本实施例中, 主机能够主动对逻辑单元坏扇区 存储的数据进行修复, 避免了现有技术中主机只能由业务触发访问逻辑单 元坏扇区时才能被动地对该逻辑单元坏扇区存储的数据进行修复的问题, 从而提高了修复及时性。  In this embodiment, the host queries the hard disk array for the bad sectors of the logical unit through the query unit 31, so that the receiving unit 32 receives the identification information of the bad sectors of the logical unit sent by the hard disk array, and the repair unit 33 can also use the logical unit according to the logical unit. The identification information of the area is used to repair the data stored in the bad sector of the above logical unit. In this embodiment, the host can actively repair the data stored in the bad sector of the logical unit, so as to prevent the host from passively storing the bad sector of the logical unit when the host can only access the bad sector of the logical unit by the service. The data is fixed to fix the problem, thus improving the timeliness of repair.
进一步地, 如图 4所示, 本实施例的主机还可以进一步包括处理单元 41 , 用于接收上述硬盘阵列发送的即将失效信息, 上述即将失效信息包括 逻辑单元的标识信息, 上述即将失效信息为当上述逻辑单元中坏扇区的大 小超过预先设置的大小阈值时, 上述硬盘阵列发送的, 以及根据上述逻辑 单元的标识信息, 对上述逻辑单元所对应的坏扇区的数据进行备份或迁移。  Further, as shown in FIG. 4, the host in this embodiment may further include a processing unit 41, configured to receive the upcoming invalidation information sent by the hard disk array, where the impending failure information includes the identification information of the logical unit, and the foregoing invalidation information is When the size of the bad sector in the logical unit exceeds a preset size threshold, the data of the bad sector corresponding to the logical unit is backed up or migrated according to the identifier information sent by the hard disk array.
图 5为本发明另一实施例提供的硬盘阵列的结构示意图, 如图 5所示, 本实施例的硬盘阵列可以包括至少两个硬盘 51和硬盘控制器 52。 其中, 硬盘控制器 52可以包括存储单元 521和发送单元 522。 其中, 存储单元 521用于存储逻辑单元坏扇区的标识信息; 发送单元 522用于向主机发送 主机查询的上述逻辑单元坏扇区的标识信息, 以使上述主机根据上述逻辑 单元坏扇区的标识信息, 对上述逻辑单元坏扇区存储的数据进行修复。  FIG. 5 is a schematic structural diagram of a hard disk array according to another embodiment of the present invention. As shown in FIG. 5, the hard disk array of this embodiment may include at least two hard disks 51 and a hard disk controller 52. The hard disk controller 52 may include a storage unit 521 and a transmitting unit 522. The storage unit 521 is configured to store the identifier information of the bad sector of the logical unit; the sending unit 522 is configured to send, to the host, the identifier information of the bad sector of the logical unit that is queried by the host, so that the host is in accordance with the bad sector of the logical unit. The identification information is used to repair the data stored in the bad sector of the logical unit.
上述图 1和图 2对应的实施例中硬盘阵列的功能可以由本实施例提供 的硬盘阵列中的硬盘控制器 52实现。  The functions of the hard disk array in the embodiment corresponding to the foregoing FIG. 1 and FIG. 2 can be implemented by the hard disk controller 52 in the hard disk array provided in this embodiment.
进一步地, 如图 6所示, 本实施例中的硬盘控制器 52还可以进一步包 括删除单元 523。 可选地, 若上述主机修复上述逻辑单元坏扇区成功, 删除 单元 523则可以接收上述主机发送的用于指示上述逻辑单元坏扇区修复成 功的指示信息, 并删除上述逻辑单元坏扇区的标识信息; 可选地, 若上述 主机修复上述逻辑单元坏扇区成功, 删除单元 523则还可以直接删除上述 逻辑单元坏扇区的标识信息。 Further, as shown in FIG. 6, the hard disk controller 52 in this embodiment may further include A deletion unit 523 is included. Optionally, if the host repairs the bad sector of the logical unit successfully, the deleting unit 523 may receive the indication information sent by the host to indicate that the logical unit is successfully repaired, and delete the bad sector of the logical unit. Identification information; Optionally, if the host repairs the bad sector of the logical unit successfully, the deleting unit 523 may directly delete the identification information of the bad sector of the logical unit.
进一步地, 如图 7所示, 本实施例中的硬盘控制器 52还可以进一步包 括指示单元 524, 用于当存储单元 521存储的逻辑单元中坏扇区的大小超 过预先设置的大小阈值时, 向上述主机发送即将失效信息, 上述即将失效 信息包括上述逻辑单元的标识信息, 以使上述主机根据上述逻辑单元的标 识信息, 对上述逻辑单元所对应的坏扇区的数据进行备份或迁移。  Further, as shown in FIG. 7, the hard disk controller 52 in this embodiment may further include an indication unit 524, when the size of the bad sector in the logical unit stored by the storage unit 521 exceeds a preset size threshold. Sending the expiration information to the host, the foregoing invalidation information includes the identification information of the logical unit, so that the host backs up or migrates the data of the bad sector corresponding to the logical unit according to the identification information of the logical unit.
本实施例中,硬盘阵列通过硬盘控制器 52的存储单元 521存储逻辑单 元坏扇区的标识信息, 使得主机向硬盘阵列查询逻辑单元坏扇区时, 硬盘 控制器的发送单元 522能够向主机发送该主机查询的上述逻辑单元坏扇区 的标识信息, 使得主机进而可以根据上述逻辑单元坏扇区的标识信息, 对 上述逻辑单元坏扇区存储的数据进行修复。 本实施例中, 硬盘阵列能够根 据主机的主动查询向主机提供逻辑单元坏扇区的标识信息, 使得主机能够 主动对逻辑单元坏扇区存储的数据进行修复, 避免了现有技术中主机只能 由业务触发访问逻辑单元坏扇区时才能被动地对该逻辑单元坏扇区存储的 数据进行修复的问题, 从而提高了修复及时性。  In this embodiment, the hard disk array stores the identification information of the bad sectors of the logical unit through the storage unit 521 of the hard disk controller 52, so that when the host queries the hard disk array for the bad sectors of the logical unit, the sending unit 522 of the hard disk controller can send the sending unit 522 to the host. The identifier information of the bad sector of the logical unit that is queried by the host, so that the host can further repair the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit. In this embodiment, the hard disk array can provide the host with the identification information of the bad sectors of the logical unit according to the active query of the host, so that the host can actively repair the data stored in the bad sectors of the logical unit, thereby avoiding the host in the prior art. When the service triggers access to the bad sectors of the logical unit, the problem of repairing the data stored in the bad sectors of the logical unit can be passively repaired, thereby improving the timeliness of repair.
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述 描述的系统, 装置和单元的具体工作过程, 可以参考前述方法实施例中的 对应过程, 在此不再赞述。 在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是 示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现 时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到 另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的 相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元 的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。 A person skilled in the art can clearly understand that for the convenience and cleanness of the description, the specific working processes of the system, the device and the unit described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be further described herein. In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form. The components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用软 件功能单元的形式实现。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销 售或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方 案的全部或部分可以以软件产品的形式体现出来, 该计算机软件产品存储 在一个存储介质中, 包括若干指令用以使得一台计算机设备(可以是个人 计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全 部或部分步骤。 而前述的存储介质包括: U盘、 移动硬盘、 只读存储器 ( Read-Only Memory, 筒称 ROM , )、 随机存取存储器 ( Random Access Memory, 筒称 RAM ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a mobile hard disk, and a read only memory. (Read-Only Memory, ROM, ), Random Access Memory (RAM), disk or optical disk, and other media that can store program code.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其限 制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员 应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其 中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的 本质脱离本发明各实施例技术方案的精神和范围。  It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

权利要求 Rights request
1、 一种逻辑单元坏扇区的数据修复方法, 其特征在于, 包括: 向硬盘阵列查询逻辑单元坏扇区; A data repair method for a bad sector of a logical unit, comprising: querying a hard disk array for a bad sector of a logical unit;
接收所述硬盘阵列发送的逻辑单元坏扇区的标识信息;  Receiving identification information of a bad sector of a logical unit sent by the hard disk array;
根据所述逻辑单元坏扇区的标识信息, 对所述逻辑单元坏扇区存储 的数据进行修复。  And repairing data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit.
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述逻辑 单元坏扇区的标识信息, 对所述逻辑单元坏扇区存储的数据进行修复, 包括:  The method according to claim 1, wherein the repairing the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit comprises:
根据逻辑单元坏扇区的标识信息与文件标识的对应关系, 确定与所 述逻辑单元坏扇区的标识信息对应的文件标识;  Determining, according to a correspondence between the identification information of the bad sector of the logical unit and the file identifier, a file identifier corresponding to the identification information of the bad sector of the logical unit;
对所述文件标识对应的文件进行爹复。  The file corresponding to the file identifier is duplicated.
3、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述逻辑 单元坏扇区的标识信息, 对所述逻辑单元坏扇区存储的数据进行修复, 之后还包括:  The method according to claim 1, wherein the repairing the data stored in the bad sector of the logical unit according to the identification information of the bad sector of the logical unit, further comprising:
当所述逻辑单元坏扇区修复成功时, 向所述硬盘阵列指示所述逻辑 单元坏扇区修复成功, 以使所述硬盘阵列删除所述逻辑单元坏扇区的标 识信息。  When the logical unit bad sector repair is successful, indicating to the hard disk array that the logical unit bad sector repair is successful, so that the hard disk array deletes the identification information of the logical unit bad sector.
4、 根据权利要求 1至 3任一权利要求所述的方法, 其特征在于, 所述向硬盘阵列查询逻辑单元坏扇区, 之前还包括:  The method according to any one of claims 1 to 3, wherein the querying the bad sectors of the logical unit to the hard disk array further includes:
接收所述硬盘阵列发送的即将失效信息, 所述即将失效信息包括逻 根据所述逻辑单元的标识信息, 对所述逻辑单元所对应的坏扇区的 数据进行备份或迁移。 Receiving the upcoming failure information sent by the hard disk array, where the invalidation information includes logic And backing up or migrating data of the bad sector corresponding to the logical unit according to the identifier information of the logical unit.
5、 一种逻辑单元坏扇区的数据修复方法, 其特征在于, 包括: 存储逻辑单元坏扇区的标识信息;  A data repair method for a bad sector of a logical unit, comprising: storing identification information of a bad sector of a logical unit;
向主机发送所述主机查询的所述逻辑单元坏扇区的标识信息, 以使 所述主机根据所述逻辑单元坏扇区的标识信息, 对所述逻辑单元坏扇区 存储的数据进行修复。  Sending, to the host, the identifier information of the bad sector of the logical unit that is queried by the host, so that the host repairs the data stored in the bad sector of the logical unit according to the identifier information of the bad sector of the logical unit.
6、 根据权利要求 5所述的方法, 其特征在于, 所述方法还包括: 当所述主机修复所述逻辑单元坏扇区成功时, 接收所述主机发送的 用于指示所述逻辑单元坏扇区修复成功的指示信息, 并删除所述逻辑单 元坏扇区的标识信息。  The method according to claim 5, wherein the method further comprises: when the host repairs that the logical unit bad sector is successful, receiving, by the host, indicating that the logical unit is bad The sector repairs the indication information of the success, and deletes the identification information of the bad sector of the logical unit.
7、 根据权利要求 5或 6所述的方法, 其特征在于, 所述存储逻辑 单元坏扇区的标识信息, 之后还包括:  The method according to claim 5 or 6, wherein the storing the identification information of the bad sector of the logical unit further comprises:
当存储的逻辑单元中坏扇区的大小超过预先设置的大小阈值时, 向 所述主机发送即将失效信息, 所述即将失效信息包括所述逻辑单元的标 识信息, 以使所述主机根据所述逻辑单元的标识信息, 对所述逻辑单元 所对应的坏扇区的数据进行备份或迁移。  When the size of the bad sector in the stored logical unit exceeds a preset size threshold, sending the upcoming failure information to the host, where the invalidation information includes the identification information of the logical unit, so that the host according to the The identification information of the logical unit backs up or migrates the data of the bad sector corresponding to the logical unit.
8、 一种主机, 其特征在于, 包括:  8. A host, characterized in that:
查询单元, 用于向硬盘阵列查询逻辑单元坏扇区;  The query unit is configured to query the hard disk array for a bad sector of the logical unit;
接收单元, 用于接收所述硬盘阵列发送的逻辑单元坏扇区的标识信 修复单元, 用于根据所述逻辑单元坏扇区的标识信息, 对所述逻辑 据进行修复。 a receiving unit, configured to receive an identifier identifying unit of a logical unit bad sector sent by the hard disk array, configured to repair the logic according to the identifier information of the bad unit of the logical unit.
9、 根据权利要求 8所述的主机, 其特征在于, 所述修复单元具体 用于: The host according to claim 8, wherein the repairing unit is specifically configured to:
根据逻辑单元坏扇区的标识信息与文件标识的对应关系, 确定与所 述逻辑单元坏扇区的标识信息对应的文件标识, 对所述文件标识对应的 文件进行爹复。  And determining, according to the correspondence between the identifier information of the bad sector of the logical unit and the file identifier, a file identifier corresponding to the identifier information of the bad sector of the logical unit, and recovering the file corresponding to the file identifier.
1 0、 根据权利要求 8至 9任一权利要求所述的主机, 其特征在于, 所述主机还包括:  The host according to any one of claims 8 to 9, wherein the host further comprises:
处理单元, 用于接收所述硬盘阵列发送的即将失效信息, 所述即将 失效信息包括逻辑单元的标识信息,以及根据所述逻辑单元的标识信息, 对所述逻辑单元所对应的坏扇区的数据进行备份或迁移。  a processing unit, configured to receive impending failure information sent by the hard disk array, where the invalidation information includes identifier information of the logical unit, and the bad sector corresponding to the logical unit according to the identification information of the logical unit Data is backed up or migrated.
1 1、 一种硬盘阵列, 包括至少两个硬盘和硬盘控制器, 其特征在于, 所述硬盘控制器包括:  1 1. A hard disk array, comprising at least two hard disks and a hard disk controller, wherein the hard disk controller comprises:
存储单元, 用于存储逻辑单元坏扇区的标识信息;  a storage unit, configured to store identification information of a bad sector of the logical unit;
发送单元, 用于向主机发送所述主机查询的所述逻辑单元坏扇区的 标识信息, 以使所述主机根据所述逻辑单元坏扇区的标识信息, 对所述 逻辑单元坏扇区存储的数据进行修复。  a sending unit, configured to send, to the host, identifier information of the bad sector of the logical unit that is queried by the host, so that the host stores the bad sector of the logical unit according to the identifier information of the bad unit of the logical unit The data is fixed.
1 2、 根据权利要求 1 1所述的硬盘阵列, 其特征在于, 所述硬盘控 制器还包括删除单元, 用于  The hard disk array according to claim 1 , wherein the hard disk controller further includes a deleting unit, and is configured to:
若所述主机修复所述逻辑单元坏扇区成功, 接收所述主机发送的用 于指示所述逻辑单元坏扇区修复成功的指示信息, 并删除所述逻辑单元 坏扇区的标识信息。  And if the host repairs the logical unit bad sector successfully, receiving indication information sent by the host to indicate that the logical unit is successfully repaired by the bad unit, and deleting the identification information of the bad unit of the logical unit.
1 3、 根据权利要求 1 1或 12所述的硬盘阵列, 其特征在于, 所述硬 示单元, 用于 当所述存储单元存储的逻辑单元中坏扇区的大小超过预先设置的大小阈 值时, 则向所述主机发送即将失效信息, 所述即将失效信息包括所述逻辑 单元的标识信息, 以使所述主机根据所述逻辑单元的标识信息, 对所述逻 辑单元所对应的坏扇区的数据进行备份或迁移。 The hard disk array according to claim 1 or 12, wherein the hard display unit is used for And when the size of the bad sector in the logical unit stored by the storage unit exceeds a preset size threshold, sending, to the host, the invalidation information, where the invalidation information includes the identification information of the logical unit, so that The host backs up or migrates the data of the bad sector corresponding to the logical unit according to the identification information of the logical unit.
4 4
PCT/CN2012/075492 2011-06-02 2012-05-15 Data recovery methods and devices for bad sector of logical unit WO2012163223A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110147934.4 2011-06-02
CN201110147934.4A CN102193848B (en) 2011-06-02 2011-06-02 Data recovery method and device for bad sector of logic unit

Publications (1)

Publication Number Publication Date
WO2012163223A1 true WO2012163223A1 (en) 2012-12-06

Family

ID=44601951

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/075492 WO2012163223A1 (en) 2011-06-02 2012-05-15 Data recovery methods and devices for bad sector of logical unit

Country Status (2)

Country Link
CN (1) CN102193848B (en)
WO (1) WO2012163223A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193848B (en) * 2011-06-02 2014-09-03 华为数字技术(成都)有限公司 Data recovery method and device for bad sector of logic unit
CN103049354B (en) * 2012-12-21 2015-08-19 华为技术有限公司 Data recovery method, data restore device and storage system
CN103544995B (en) 2013-08-27 2016-09-21 华为技术有限公司 A kind of bad track repairing method and bad track repairing device
CN105242985B (en) * 2015-09-09 2018-05-25 华为技术有限公司 Data recovery method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5220569A (en) * 1990-07-09 1993-06-15 Seagate Technology, Inc. Disk array with error type indication and selection of error correction method
US20040128582A1 (en) * 2002-11-06 2004-07-01 Ching-Hai Chou Method and apparatus for dynamic bad disk sector recovery
US20060107091A1 (en) * 2004-11-02 2006-05-18 International Business Machines Corporation System and method for recovery of data for a lost sector in a storage system
CN102193848A (en) * 2011-06-02 2011-09-21 成都市华为赛门铁克科技有限公司 Data recovery method and device for bad sector of logic unit

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100395717C (en) * 2005-07-11 2008-06-18 英业达股份有限公司 Method and system for monitoring hard-disk damage
CN101772757B (en) * 2007-08-21 2016-06-29 汤姆逊许可公司 For repairing the method and system of damaged hard disk file systems
CN102044278A (en) * 2009-10-12 2011-05-04 英业达股份有限公司 Method and device for simulating logic hard disk test by using bad sector log sheet

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5220569A (en) * 1990-07-09 1993-06-15 Seagate Technology, Inc. Disk array with error type indication and selection of error correction method
US20040128582A1 (en) * 2002-11-06 2004-07-01 Ching-Hai Chou Method and apparatus for dynamic bad disk sector recovery
US20060107091A1 (en) * 2004-11-02 2006-05-18 International Business Machines Corporation System and method for recovery of data for a lost sector in a storage system
CN102193848A (en) * 2011-06-02 2011-09-21 成都市华为赛门铁克科技有限公司 Data recovery method and device for bad sector of logic unit

Also Published As

Publication number Publication date
CN102193848A (en) 2011-09-21
CN102193848B (en) 2014-09-03

Similar Documents

Publication Publication Date Title
US10467246B2 (en) Content-based replication of data in scale out system
US9250824B2 (en) Backing up method, device, and system for virtual machine
US9542272B2 (en) Write redirection in redundant array of independent disks systems
TWI353536B (en) Virtualized storage computer system and method of
JP6344798B2 (en) Data transmission method, data reception method, and storage device
JP6009095B2 (en) Storage system and storage control method
US10120769B2 (en) Raid rebuild algorithm with low I/O impact
WO2013159503A1 (en) Hard disk data recovery method, device and system
CN106776147B (en) Differential data backup method and differential data backup device
US20130103902A1 (en) Method and apparatus for implementing protection of redundant array of independent disks in file system
JP2004118837A (en) Method for storing data in fault tolerance storage sub-system, the storage sub-system and data formation management program for the system
WO2014079028A1 (en) Data processing method and storage device
WO2015054897A1 (en) Data storage method, data storage apparatus, and storage device
US10067833B2 (en) Storage system
WO2015058542A1 (en) Reconstruction method and device for redundant array of independent disks
WO2013107295A1 (en) Method for recovering hard drive data, server and distributed storage system
WO2015085529A1 (en) Data replication method, data replication device and storage device
CN111124258B (en) Data storage method, device and equipment of full flash memory array and readable storage medium
WO2012163223A1 (en) Data recovery methods and devices for bad sector of logical unit
US8539156B2 (en) Storage subsystem and its logical unit processing method
US20220129346A1 (en) Data processing method and apparatus in storage system, and storage system
US8433949B2 (en) Disk array apparatus and physical disk restoration method
JP2006011811A (en) Storage control system and storage control method
WO2021088586A1 (en) Method and apparatus for managing metadata in storage system
JP5817296B2 (en) Control device, control method, and storage device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12792076

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12792076

Country of ref document: EP

Kind code of ref document: A1