WO2014019360A1 - Method and device for remapping a disk - Google Patents

Method and device for remapping a disk Download PDF

Info

Publication number
WO2014019360A1
WO2014019360A1 PCT/CN2013/072036 CN2013072036W WO2014019360A1 WO 2014019360 A1 WO2014019360 A1 WO 2014019360A1 CN 2013072036 W CN2013072036 W CN 2013072036W WO 2014019360 A1 WO2014019360 A1 WO 2014019360A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
sector
bad
bad sector
track
Prior art date
Application number
PCT/CN2013/072036
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 WO2014019360A1 publication Critical patent/WO2014019360A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/18Error detection or correction; Testing, e.g. of drop-outs
    • G11B20/1883Methods for assignment of alternate areas for defective areas
    • G11B20/1889Methods for assignment of alternate areas for defective areas with discs

Abstract

The embodiments of the present invention provide a method and device for remapping a disk, and the method comprises: when reading a bad sector in each disk, getting a position of the bad sector according to a logical address of the bad sector; if the bad sector is in the zone of the inner track, migrating the data from the bad sector to a original reserved zone, and redirecting the physical address corresponding to the logical address of the bad sector to the physical address of the migrated data of the bad sector; if the bad sector is not in the zone of the inner track, migrating the data from the bad track zone where the bad sector meets the preset zone mapping condition to the preset new reserved zone, and redirecting the physical address corresponding to the logical address of the bad track zone to the physical address of the migrated data; according to the logical address of the data, reading the data in the sector corresponding to the logical address. Embodiments of the present invention also provide the device for mapping a disk. The embodiments of the present invention reduce latency caused by swinging a magnetic head.

Description

磁盘重映射方法和装置 本申请要求于 2012 年 07 月 31 日提交中国专利局、 申请号为 201210268767.3、 发明名称为 "磁盘重映射方法和装置" 的中国专利申请的优 先权, 其全部内容通过引用结合在本申请中。  The present invention claims priority to Chinese Patent Application No. 201210268767.3, entitled "Disk Re-mapping Method and Apparatus", filed on July 31, 2012, the entire contents of which are hereby incorporated by reference. Combined in this application.
技术领域 本发明涉及通信技术, 尤其涉及一种磁盘重映射方法和装置。 背景技术 硬盘坏道问题是存储领域的常见问题, 硬盘坏道分为逻辑坏道和物理坏 道。 其中, 物理坏道无法修复, 逻辑坏道可以通过写操作进行修复, 即按照硬 盘重映射机制,将逻辑坏道的地址重映射到硬盘固有的预留区域中。硬盘逻辑 块寻址 (Logic Block Addressing; 以下简称: LBA ) 按照柱面 -磁头 -扇区 ( Cylinder-Head-Sector; 以下简称: CHS )对应到硬盘盘体, 并按同心圓的磁 盘轨道(track )进行分布, 最外面的称为外道。 现有的 1T/2T硬盘通常预留 4096个扇区, 3T硬盘通常预留 8192个扇区。 TECHNICAL FIELD The present invention relates to communications technologies, and in particular, to a disk remapping method and apparatus. BACKGROUND OF THE INVENTION A hard disk bad track problem is a common problem in the storage field. Hard disk bad sectors are classified into logical bad sectors and physical bad sectors. The physical bad sectors cannot be repaired, and the logical bad sectors can be repaired by a write operation, that is, the logical bad track address is remapped to the reserved area of the hard disk according to the hard disk remapping mechanism. Logic Block Addressing (LBA): Corresponding to the hard disk body according to the cylinder-head-sector (hereinafter referred to as CHS), and pressing the concentric disk track (track) ) Distribution, the outermost is called the outer road. Existing 1T/2T hard disks usually reserve 4096 sectors, and 3T hard disks usually reserve 8192 sectors.
在现有技术中, 在顺序读取硬盘中的数据时, 当读取到坏道 1时, 读磁头 自动摆到预留区域中读取坏道 1对应的重映射地址的信息,然后读磁头再返回 读取坏道 1和坏道 2之间的良好扇区; 当读到坏道 2时,读磁头自动摆到预留 区域中读取坏道 2对应的重映射地址的信息, 然后读磁头再返回读取坏道 2 和坏道 3之间的良好扇区, 以此类推, 完成包含坏道的整个硬盘的数据读取。  In the prior art, when sequentially reading data in the hard disk, when the bad track 1 is read, the read head automatically swings into the reserved area to read the information of the remapping address corresponding to the bad track 1, and then reads the magnetic head. Returning to read the good sector between bad track 1 and bad track 2; when reading bad track 2, the read head automatically swings into the reserved area to read the information of the remapping address corresponding to bad track 2, and then reads The head then returns to read a good sector between bad track 2 and bad track 3, and so on, to complete the data reading of the entire hard disk containing the bad track.
然而, 现有技术中读磁头反复摆动, 造成较大的磁盘读写延时  However, in the prior art, the read head repeatedly swings, resulting in a large disk read and write delay.
发明内容 本发明实施例提供一种磁盘重映射方法和装置, 减少磁盘读写延时。 本发明实施例的第一方面提供了一种磁盘重映射方法, 包括: SUMMARY OF THE INVENTION Embodiments of the present invention provide a disk remapping method and apparatus, which reduce disk read and write delays. A first aspect of the embodiments of the present invention provides a disk remapping method, including:
当读取到各碟片上的坏道扇区时,根据所述坏道扇区的逻辑地址获取所述 坏道扇区的位置;  When the bad sectors on each disc are read, the position of the bad sectors is obtained according to the logical address of the bad sectors;
若所述坏道扇区位于内道区域中,则将所述坏道扇区中的数据迁移到原始 预留区域中,并将所述坏道扇区的逻辑地址对应的物理地址重新指向到所述坏 道扇区中的数据迁移后的物理地址; If the bad sector is located in the inner track area, the data in the bad track sector is migrated to the original Reserving the physical address corresponding to the logical address of the bad sector and redirecting to the physical address after the data migration in the bad sector;
若所述坏道扇区位于非内道区域中,则将满足预设的区域映射条件的坏道 扇区所在坏道区域中的数据迁移到预设的新增预留区域中,并将所述坏道区域 中数据对应的逻辑地址对应的物理地址分别重新指向到所述坏道区域中的数 据迁移后的物理地址; 其中, 所述内道区域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区 域, 其中, R为所述碟片的半径, Ρ为预设的大于 1且小于 R的实数; 所述非内 道区域为所述碟片上除所述内道区域外的区域。  If the bad sector is located in the non-inner area, the data in the bad track area where the bad sector is satisfied by the preset area mapping condition is migrated to the preset new reserved area, and the The physical address corresponding to the logical address corresponding to the data in the bad track area is respectively redirected to the physical address after the data migration in the bad track area; wherein the inner track area is a radius of R/P in the disc. a region within the track corresponding to the concentric circle, where R is the radius of the disc, and Ρ is a preset real number greater than 1 and less than R; the non-inner track region is the inner disc The area outside the road area.
结合第一方面,在第一方面的第一种可能的实现方式中, 所述将满足预设 域中包括:  In conjunction with the first aspect, in a first possible implementation manner of the first aspect, the
对所述坏道扇区所在坏道区域进行扫描,所述坏道扇区所在坏道区域为由 物理地址为 [X-Q,X+Q]的扇区构成的区域, 其中, X为所述坏道扇区的物理地 址, Q为预设的正整数;  Scanning the bad track area where the bad sectors are located, and the bad track area where the bad sectors are located is an area composed of sectors having a physical address of [XQ, X+Q], where X is the bad The physical address of the track sector, Q is a preset positive integer;
当所述坏道区域中存在其他坏道扇区时,则所述坏道区域满足预设的区域 映射条件, 将所述坏道区域中的数据迁移到预设的新增预留区域中。  When there are other bad sectors in the bad track area, the bad track area satisfies the preset area mapping condition, and the data in the bad track area is migrated to the preset new reserved area.
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中, 所 的新增预留区域中还包括:  In conjunction with the first possible implementation of the first aspect, in the second possible implementation, the newly added reserved area further includes:
当所述坏道区域中不存在其他坏道扇区时,则所述坏道区域不满足预设的 区域映射条件,将所述坏道扇区中的数据迁移到预设的新增预留区域中, 并将 所述坏道扇区中的数据的逻辑地址对应的物理地址重新指向到所述坏道扇区 中的数据迁移后的物理地址。  When there are no other bad sectors in the bad track area, the bad track area does not satisfy the preset area mapping condition, and the data in the bad track sector is migrated to the preset new reserved. In the area, the physical address corresponding to the logical address of the data in the bad track sector is redirected to the physical address after the data migration in the bad track sector.
结合第一方面或第一方面的第一种可能的实现方式,在第三种可能的实现 方式中, 本发明实施例提供的磁盘重映射方法还包括:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation manner, the disk remapping method provided by the embodiment of the present invention further includes:
预配置所述新增预留区域, 所述新增预留区域均勾分布在各碟片上, 所述 各碟片中的新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心 圓组成的区域,所述新增预留区域中的逻辑地址总数为所述原始预留区域中的 逻辑地址总数的 n倍, M和 N为预设的大于 1且小于 2的实数, M<N, n为预设的 大于 1的正整数。 The new reserved area is pre-configured, and the newly added reserved area is uniformly distributed on each of the discs, and the newly added reserved areas in the discs are respectively distributed in the discs by a radius of An area composed of concentric circles of [R/N, R/M], the total number of logical addresses in the newly added reserved area is in the original reserved area N times the total number of logical addresses, M and N are preset real numbers greater than 1 and less than 2, and M < N, n is a preset positive integer greater than 1.
结合第一方面或第一方面的第一种可能的实现方式,在第四种可能的实现 方式中, 本发明实施例提供的磁盘重映射方法还包括:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a fourth possible implementation manner, the disk remapping method provided by the embodiment of the present invention further includes:
获取各硬盘所包含的碟片数、各碟片所包含的磁轨数以及各磁轨所包含的 扇区个数;  Obtaining the number of discs included in each hard disk, the number of tracks included in each disc, and the number of sectors included in each track;
根据所述各硬盘所包含的碟片数、各碟片所包含的磁轨数、各磁轨所包含 的扇区个数以及各磁轨中首尾扇区对应的首尾逻辑地址,生成各磁轨与所述磁 轨中首尾逻辑地址的对应关系。  Generating each track according to the number of disks included in each hard disk, the number of tracks included in each disk, the number of sectors included in each track, and the first and last logical addresses corresponding to the first and last sectors in each track. Correspondence with the first and last logical addresses in the track.
本发明实施例的第二方面提供了一种磁盘重映射装置, 包括:  A second aspect of the embodiments of the present invention provides a disk remapping apparatus, including:
第一获取单元, 用于当读取到各碟片上的坏道扇区时,根据所述坏道扇区 的逻辑地址获取所述坏道扇区的位置;  a first acquiring unit, configured to: when reading a bad track sector on each disc, acquire a location of the bad track sector according to a logical address of the bad track sector;
第一迁移单元,用于若所述第一获取单元获取到的所述坏道扇区位于内道 区域中, 则将所述坏道扇区中的数据迁移到原始预留区域中, 并将所述坏道扇 区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物 理地址;  a first migration unit, configured to migrate data in the bad track sector to an original reserved area if the bad sector sector acquired by the first acquiring unit is located in an inner track area, and The physical address corresponding to the logical address of the bad sector is redirected to the physical address after data migration in the bad sector;
第二迁移单元,用于若所述第一获取单元获取到的所述坏道扇区位于非内 移到预设的新增预留区域中 ,并将所述坏道区域中数据的逻辑地址对应的物理 地址分别重新指向到所述坏道区域中的数据迁移后的物理地址;  a second migration unit, configured to: if the bad sector sector acquired by the first acquiring unit is located in a non-internal move to a preset new reserved area, and the logical address of the data in the bad track area Corresponding physical addresses are respectively redirected to physical addresses after data migration in the bad track area;
读取模块,用于根据所述第一迁移单元和所述第二迁移单元重新指向的数 其中, 所述内道区域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区 域, 其中, R为所述碟片的半径, P为预设的 1且小于 R的实数; 所述非内道区 域为所述碟片上除所述内道区域外的区域。  a reading module, configured to re-point according to the first migration unit and the second migration unit, wherein the inner channel region is within a track corresponding to a concentric circle having a radius of R/P in the disc An area, where R is a radius of the disc, P is a preset 1 and less than a real number of R; and the non-inner track area is an area on the disc other than the inner track area.
结合第二方面,在第二方面的第一种可能的实现方式中, 所述第二迁移单 元包括:  With reference to the second aspect, in a first possible implementation manner of the second aspect, the second migration unit includes:
扫描子单元,用于若所述第一获取单元获取到的所述坏道扇区位于非内道 区域中, 则对所述坏道扇区所在坏道区域进行扫描, 所述坏道扇区所在坏道区 域为由物理地址为 [X-Q,X+Q]的扇区构成的区域, 其中, X为所述坏道扇区的 物理地址, Q为预设的正整数; a scanning subunit, configured to scan a bad track area where the bad track sector is located, if the bad track sector acquired by the first acquiring unit is located in a non-inner track area, the bad track sector The bad track area is an area composed of sectors having a physical address of [XQ, X+Q], where X is the sector of the bad track Physical address, Q is a preset positive integer;
迁移子单元,用于当所述扫描子单元扫描的结果为所述坏道区域中存在其 他坏道扇区时, 所述坏道区域满足预设的区域映射条件, 将所述坏道区域中的 数据迁移到预设的新增预留区域中。  a migration subunit, configured to: when the scan subunit scans that there are other bad sectors in the bad track area, the bad track area satisfies a preset area mapping condition, and the bad track area is The data is migrated to the preset new reserved area.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现 方式中, 所述第二迁移单元还包括:  With reference to the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, the second migration unit further includes:
处理子单元,用于当所述扫描子单元扫描的结果为所述坏道区域中不存在 其他坏道扇区时, 所述坏道区域不满足预设的区域映射条件,将所述坏道扇区 中的数据迁移到预设的新增预留区域中,并将所述坏道扇区中的数据的逻辑地 址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物理地址。  a processing subunit, configured to: when the scan subunit scans that there are no other bad sectors in the bad track area, the bad track area does not satisfy a preset area mapping condition, and the bad track is The data in the sector is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad track sector is redirected to the data in the bad sector. Physical address.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第三种 可能的实现方式中, 本实施例提供的磁盘重映射装置还包括:  With the second aspect or the first possible implementation of the second aspect, in a third possible implementation manner of the second aspect, the disk remapping apparatus provided in this embodiment further includes:
预配置模块, 用于在所述第一获取模块获取所述坏道扇区的位置之前,预 配置所述新增预留区域, 所述新增预留区域均勾分布在各碟片上, 所述各碟片 中的新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心圓组成 的区域,所述新增预留区域中的逻辑地址总数为所述原始预留区域中的逻辑地 址总数的 n倍, M和 N为预设的大于 1且小于 2的实数, M<N, n为预设的大于 1 的正整数。  a pre-configuration module, configured to pre-configure the newly added reserved area, where the newly added reserved area is hooked on each disc, before the first acquiring module acquires the location of the bad sector sector, The newly added reserved areas in the respective discs are respectively distributed in an area composed of concentric circles having a radius of [R/N, R/M] in the respective discs, and logic in the newly added reserved area The total number of addresses is n times the total number of logical addresses in the original reserved area, and M and N are preset real numbers greater than 1 and less than 2, and M<N, n is a preset positive integer greater than 1.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第四种 可能的实现方式中, 本实施例提供的磁盘重映射装置还包括:  With the second aspect or the first possible implementation of the second aspect, in a fourth possible implementation manner of the second aspect, the disk remapping apparatus provided by the embodiment further includes:
第二获取模块, 用于在所述第一获取模块获取所述坏道扇区的位置之前, 获取各硬盘所包含的碟片数、各碟片所包含的磁轨数以及各磁轨所包含的扇区 个数;  a second acquiring module, configured to acquire, before the first acquiring module acquires the location of the bad sector sector, the number of disks included in each hard disk, the number of magnetic tracks included in each disk, and the track included in each track Number of sectors;
生成模块, 用于根据所述第二获取模块获取的所述各硬盘所包含的碟片 数、各碟片所包含的磁轨数、各磁轨所包含的扇区个数以及各磁轨中首尾扇区 对应的首尾逻辑地址, 生成各磁轨与所述磁轨中首尾逻辑地址的对应关系。  a generating module, configured to: according to the second obtaining module, the number of disks included in each hard disk, the number of tracks included in each disk, the number of sectors included in each track, and each track The first and last logical addresses corresponding to the first and last sectors generate a correspondence between each track and the first and last logical addresses in the track.
本发明实施例的技术效果是: 通过对坏道扇区的位置进行区分, 釆用就近 预留区域中数据迁移后的物理地址,将非内道区域中的坏道扇区的逻辑地址对 应的物理地址重新指向到新增预留区域中数据迁移后的物理地址,减少了磁头 从良好扇区向预留区域摆动的距离,从而减少了磁头摆动带来了延时; 通过将 满足预设的区域映射条件的坏道区域中的数据整体迁移到新增预留区域中,使 得当读取到该坏道区域中的数据时, 直接从新增预留区域中进行整体读取,避 免了由于某个区域中存在多个相近但不连续的坏道扇区导致磁头反复摆动,从 而大大减少了因磁头反复摆动带来的延时。 The technical effect of the embodiment of the present invention is: by distinguishing the location of the bad sectors, using the physical address after data migration in the nearby reserved area, and corresponding to the logical address of the bad sectors in the non-inner area The physical address is redirected to the physical address after data migration in the newly added reserved area, reducing the head The distance from the good sector to the reserved area, thereby reducing the delay caused by the head swing; by migrating the data in the bad track area that satisfies the preset area mapping condition to the newly added reserved area, When the data in the bad track area is read, the overall reading is directly performed from the newly added reserved area, thereby avoiding repeated head swings due to the presence of a plurality of similar but discontinuous bad sectors in a certain area. Thereby, the delay caused by the repeated swing of the head is greatly reduced.
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地, 下面 描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明磁盘重映射方法实施例一的流程图; BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. The drawings are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive labor. 1 is a flowchart of Embodiment 1 of a disk remapping method according to the present invention;
图 2为本发明磁盘重映射方法实施例一中碟片的结构示意图;  2 is a schematic structural diagram of a disc in Embodiment 1 of a disk remapping method according to the present invention;
图 3为本发明磁盘重映射方法实施例二的流程图;  3 is a flowchart of Embodiment 2 of a disk remapping method according to the present invention;
图 4为本发明磁盘重映射装置实施例一的结构示意图;  4 is a schematic structural diagram of Embodiment 1 of a disk remapping apparatus according to the present invention;
图 5为本发明磁盘重映射装置实施例二的结构示意图;  5 is a schematic structural diagram of Embodiment 2 of a disk remapping apparatus according to the present invention;
图 6为本发明磁盘重映射装置实施例三的结构示意图。  FIG. 6 is a schematic structural diagram of Embodiment 3 of a disk remapping apparatus according to 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所示, 本实施例提 供了一种磁盘重映射方法, 可以包括如下步骤:  FIG. 1 is a flowchart of Embodiment 1 of a disk remapping method according to the present invention. As shown in FIG. 1 , this embodiment provides a disk remapping method, which may include the following steps:
步骤 101 , 当读取到各碟片上的坏道扇区时, 根据所述坏道扇区的逻辑地 址获取所述坏道扇区的位置。  Step 101: When a bad track sector on each disc is read, the location of the bad track sector is obtained according to the logical address of the bad sector.
本步骤为当读取到各碟片上存在坏道扇区 ,则通过数据读取可以读取到各 碟片上的坏道扇区, 可以根据该坏道扇区的逻辑地址获取到该坏道扇区的位 置,此处的逻辑地址可以为 LBA, 通过逻辑地址可以获取到坏道扇区所处的位 置。 本实施例提供的磁盘重映射方法可以应用于使用传统硬盘建立磁盘阵列 ( Redundant Arrays of Inexpensive Disks; 以下简称: RAID )组的各种存储软 件产品, 包括电脑操作系统、 存储控制软件等。 在对创建的 RAID组中的数据 进行输入输出 ( Input Output; 以下简称: 10 )操作时, 如果 RAID组中各硬盘 中各碟片上存在坏道扇区, 则通过数据读取可以读取到 RAID组中各碟片上的 坏道扇区。 当读取到 RAID组中的坏道扇区时, 可以根据该坏道扇区的逻辑地 址获取到该坏道扇区的位置, 此处的逻辑地址可以为 LBA,通过逻辑地址可以 获取到坏道扇区所处的位置, 可以为获取到坏道扇区位于哪个磁轨上。在本实 施例中, 一个 RAID组由多个硬盘组成, 一个硬盘由多个碟片组成, 一个碟片 由多个磁轨组成, 每个磁轨包含多个扇区。 其中, 磁轨可以为碟片上以碟片中 心为圓心的同心圓, 碟片上的一个同心圓可以对应一个磁轨 ( track ) , 即以碟 片中心为圓心,不同半径对应不同的磁轨。由于同一碟片上的各扇区是连续的, 即同一碟片上不同半径的同心圓对应的磁轨中扇区对应的逻辑地址可以按照 半径从大到小或从小到大的顺序连续排列,而同一磁轨中扇区对应的逻辑地址 可以按照逆时针或顺时针的顺序连续排列,则通过逻辑地址可以获取到坏道扇 区所处的位置。 In this step, when there are bad sectors on each disc, the bad sectors on each disc can be read by data reading, and the bad can be obtained according to the logical address of the bad sectors. The location of the track sector, where the logical address can be an LBA, and the bit at which the bad sector is located can be obtained by the logical address. Set. The disk remapping method provided in this embodiment can be applied to various storage software products, such as a computer operating system and storage control software, using a Redundant Arrays of Inexpensive Disks (RAID) group. When the input/output (hereinafter referred to as 10) operation is performed on the data in the created RAID group, if there are bad sectors on each disk in the RAID group, it can be read by data reading. Bad sectors on each disc in the RAID group. When the bad sectors in the RAID group are read, the location of the bad sectors can be obtained according to the logical address of the bad sectors. The logical address here can be an LBA, and the logical address can be obtained. The location of the track sector can be on which track the bad sector is located. In this embodiment, a RAID group is composed of a plurality of hard disks, one hard disk is composed of a plurality of disks, and one disk is composed of a plurality of magnetic tracks, each of which includes a plurality of sectors. The magnetic track may be a concentric circle on the disc centered on the center of the disc, and a concentric circle on the disc may correspond to a track, that is, centered on the center of the disc, and different radii correspond to different tracks. . Since the sectors on the same disc are continuous, that is, the logical addresses corresponding to the sectors in the tracks corresponding to the concentric circles of different radii on the same disc can be successively arranged in the order of the radius from large to small or from small to large. The logical addresses corresponding to the sectors in the same track can be consecutively arranged in a counterclockwise or clockwise order, and the location of the bad sectors can be obtained by the logical address.
步骤 102, 根据坏道扇区的位置判断坏道扇区是否位于内道区域中, 如果 是, 则执行步骤 103 , 否则执行步骤 104。  Step 102: Determine whether the bad sectors are located in the inner track area according to the position of the bad sectors. If yes, go to step 103, otherwise go to step 104.
在获取到坏道扇区的位置, 即获取到坏道扇区所处的磁轨后,根据坏道扇 区的位置判断坏道扇区是否位于内道区域中,可以根据磁轨所在的同心圓的半 径来判断坏道扇区是否位于内道区域中, 如果是, 则执行步骤 103 , 否则执行 步骤 104。本实施例中的内道区域可以为碟片中以 R/P为半径的同心圓对应的磁 轨以内的区域, 其中, R为所述碟片的半径, P为预设的大于 1且小于 R的实数, 优选地可以将 P设置为大于 2;非内道区域为所述碟片上除所述内道区域外的区 域。 图 2为本发明磁盘重映射方法实施例一中碟片的结构示意图, 如图 2所示, 由于一个碟片包含上万个磁轨,每个磁轨与碟片中的一个同心圓相对应。本实 施例通过设置参数 P的值来将碟片的存储区域分为内道区域与外道区域, 通常 情况下, P可以取值为 3 , 即将碟片中以 R/3为半径的同心圓对应的磁轨以内的 扇区设为内道区域, 以 R/3为半径的同心圓对应的磁轨以外的扇区设为非内道 区域。 需要指出的是, R/P的值不一定恰好等于某个磁轨对应的同心圓的半径 的大小, 此处可以选择半径值与 R/P最接近的磁轨。 After acquiring the track of the bad track sector, that is, after acquiring the track where the bad track sector is located, determining whether the bad track sector is located in the inner track area according to the position of the bad track sector may be based on the concentricity of the track The radius of the circle is used to determine whether the bad sectors are located in the inner track area, and if so, step 103 is performed, otherwise step 104 is performed. The inner channel region in this embodiment may be an area within the disc corresponding to a concentric circle having a radius of R/P, wherein R is a radius of the disc, and P is a preset greater than 1 and less than The real number of R may preferably be set to be greater than 2; the non-inner track area is the area on the disc other than the inner track area. 2 is a schematic structural diagram of a disc in the first embodiment of the disk remapping method according to the present invention. As shown in FIG. 2, since one disc includes tens of thousands of magnetic tracks, each magnetic track corresponds to a concentric circle in the disc. . In this embodiment, the storage area of the disc is divided into an inner lane area and an outer lane area by setting the value of the parameter P. Generally, P can take a value of 3, which corresponds to a concentric circle with a radius of R/3 in the disc. A sector within the track is set as an inner track area, and a sector other than the track corresponding to a concentric circle having a radius of R/3 is set as a non-inner track area. It should be pointed out that the value of R/P is not necessarily equal to the radius of the concentric circle corresponding to a certain magnetic track. The size of the track, where you can select the track with the radius value closest to R/P.
步骤 103 , 将所述坏道扇区中的数据迁移到原始预留区域中, 并将坏道扇 区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物 理地址。  Step 103: The data in the bad sector is migrated into the original reserved area, and the physical address corresponding to the logical address of the bad sector is redirected to the physical after migration of the data in the bad sector. address.
当坏道扇区的逻辑地址位于内道区域中时,将所述坏道扇区中的数据迁移 到原始预留区域中,并将坏道扇区的逻辑地址对应的物理地址重新指向到所述 坏道扇区中的数据迁移后的物理地址, 即釆用硬盘自带的重映射机制, 将坏道 扇区的逻辑地址重映射到原始预留区域中。此处的原始预留区域为硬盘自带的 预留区域, 通常位于碟片的内道中。 迁移到预设的新增预留区域中 ,并将坏道区域中数据的逻辑地址对应的物理地 址分别重新指向到所述坏道区域中的数据迁移后的物理地址。  When the logical address of the bad sector is located in the inner track area, the data in the bad track sector is migrated into the original reserved area, and the physical address corresponding to the logical address of the bad track sector is redirected to the location The physical address after the data migration in the bad sectors is the remapping mechanism of the hard disk, and the logical address of the bad sectors is remapped into the original reserved area. The original reserved area here is the reserved area of the hard disk, usually located in the inner track of the disc. The data is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad track area is redirected to the physical address after the data migration in the bad track area.
当坏道扇区的逻辑地址位于非内道区域中时,将满足预设的区域映射条件 的坏道扇区所在坏道区域中的数据, 迁移到预设的新增预留区域中, 并将所述 坏道区域中数据的逻辑地址对应的物理地址分别重新指向到所述坏道区域中 的数据迁移后的物理地址。此处的坏道扇区所在的坏道区域可以指该坏道扇区 附近的区域, 区域范围可以根据实际情况来设定。 此处所指的区域映射条件可 以为该坏道扇区所在的坏道区域中还存在其他坏道扇区,还可以为相邻的多个 track上组成的坏道区域中存在多个坏道扇区。新增预留区域为本实施例自定义 的用于逻辑地址重新指向的预留区域,该新增预留区域可以位于碟片中存储区 域的中间位置, 而非内道位置。 当坏道扇区所在的坏道区域中还存在其他坏道 扇区时,表明该坏道区域满足预设的区域映射条件, 否则该坏道区域不满足预 设的区域映射条件。本实施例将满足预设的区域映射条件的坏道区域中的数据 整体迁移到新增预留区域中,可以将这些数据整体迁移到新增预留区域中与该 坏道区域距离最近的空闲区域。 当坏道区域不满足预设的区域映射条件时, 可 以将坏道扇区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据 迁移后的物理地址。 在完成数据的迁移和逻辑地址的重新指向后, 当后续再对该 RAID组中的 数据进行 10操作时,则根据重新指向后的逻辑地址来从逻辑地址对应的区域中 读取数据。 由于硬盘中坏道扇区的逻辑地址已被重新指向, 在读取 RAID组中 的数据时, 良好扇区中数据的逻辑地址未被重新指向, 则仍从良好扇区中读取 数据; 出现坏道扇区的扇区中的数据的逻辑地址被重新指向,对于内道区域中 的数据, 则从原始预留区域中读取重新指向后的逻辑地址对应的数据,对于非 内道区域中的数据, 则从新增预留区域中读取数据。 在本实施例中, 当扫描出 一个坏道扇区附近还存在其余坏道扇区时,将多个相近但不连续的坏道扇区所 在的整个坏道区域中的数据进行整体迁移 ,以及该坏道区域中逻辑地址的整体 重新指向,从而当读取到该坏道区域中的数据时, 直接从新增预留区域中进行 整体读取,避免了由于某个区域中存在多个相近但不连续的坏道扇区导致磁头 反复摆动, 从而大大减少了因磁头反复摆动带来的磁盘读写延时。 When the logical address of the bad sector is located in the non-inner area, the data in the bad track area of the bad sector that satisfies the preset area mapping condition is migrated to the preset new reserved area, and Relocating the physical address corresponding to the logical address of the data in the bad track area to the physical address after the data migration in the bad track area. The bad track area where the bad sectors are located here may refer to the area near the bad sectors, and the area range may be set according to actual conditions. The area mapping condition referred to herein may be that there are other bad sectors in the bad track area where the bad sectors are located, and there may be multiple bad sectors in the bad track area formed on the adjacent multiple tracks. Sector. The newly reserved area is a reserved area for the logical address redirection pointed to by the embodiment, and the newly added reserved area may be located in the middle of the storage area in the disc instead of the inner track position. When there are other bad sectors in the bad track area where the bad sectors are located, it indicates that the bad track area satisfies the preset area mapping condition, otherwise the bad track area does not satisfy the preset area mapping condition. In this embodiment, the data in the bad track area that satisfies the preset area mapping condition is migrated to the newly added reserved area, and the data may be migrated to the idle of the newly added reserved area and the closest to the bad track area. region. When the bad track area does not satisfy the preset area mapping condition, the physical address corresponding to the logical address of the bad track sector may be redirected to the physical address after the data migration in the bad track sector. After the data migration and the redirection of the logical address are completed, when 10 operations are performed on the data in the RAID group, the logical address corresponding to the redirection is used in the area corresponding to the logical address. Read the data. Since the logical address of the bad sector in the hard disk has been redirected, when the data in the RAID group is read, the logical address of the data in the good sector is not redirected, and the data is still read from the good sector; The logical address of the data in the sector of the bad track sector is redirected. For the data in the inner track area, the data corresponding to the logical address after the redirection is read from the original reserved area, for the non-inner track area. The data is read from the newly added reserved area. In this embodiment, when the remaining bad sectors are found in the vicinity of a bad sector, the data in the entire bad track area where a plurality of similar but discontinuous bad sectors are located is integrally migrated, and The overall logical address of the bad track area is re-pointed, so that when the data in the bad track area is read, the overall reading is directly performed from the newly added reserved area, thereby avoiding the existence of multiple similarities in a certain area. However, the discontinuous bad sectors cause the head to repeatedly oscillate, thereby greatly reducing the disk read/write delay caused by the repeated swing of the head.
本实施例提供了一种磁盘重映射方法, 通过对坏道扇区的位置进行区分, 向到原始预留区域中数据迁移后的物理地址,将非内道区域中的坏道扇区的逻 辑地址对应的物理地址重新指向到新增预留区域中数据迁移后的物理地址,减 少了磁头从良好扇区向预留区域摆动的距离, 从而减少了磁头摆动带来了延 时;通过将满足预设的区域映射条件的坏道区域中的数据整体迁移到新增预留 区域中,使得当读取到该坏道区域中的数据时, 直接从新增预留区域中进行整 体读取,避免了由于某个区域中存在多个相近但不连续的坏道扇区导致磁头反 复摆动, 从而大大减少了因磁头反复摆动带来的延时。  This embodiment provides a disk remapping method. By distinguishing the location of bad sectors, the physical address of the data after migration to the original reserved area, the logic of the bad sectors in the non-inner area The physical address corresponding to the address is redirected to the physical address after the data migration in the newly added reserved area, which reduces the distance that the magnetic head swings from the good sector to the reserved area, thereby reducing the delay caused by the head swing; The data in the bad track area of the preset area mapping condition is migrated to the newly added reserved area, so that when the data in the bad track area is read, the overall reading is directly performed from the newly added reserved area. It is avoided that the head is repeatedly oscillated due to the presence of a plurality of similar but discontinuous bad sectors in a certain area, thereby greatly reducing the delay caused by the repeated swing of the head.
图 3为本发明磁盘重映射方法实施例二的流程图,如图 3所示, 本实施例提 供了一种磁盘重映射方法, 可以包括如下步骤:  FIG. 3 is a flowchart of Embodiment 2 of the disk remapping method of the present invention. As shown in FIG. 3, this embodiment provides a disk remapping method, which may include the following steps:
步骤 301 , 获取 RAID组中各硬盘所包含的碟片数、各碟片所包含的磁轨数 以及各磁轨所包含的扇区个数。  Step 301: Obtain the number of disks included in each hard disk in the RAID group, the number of tracks included in each disk, and the number of sectors included in each track.
在本实施例中, 一个 RAID组由多个硬盘组成, 一个硬盘由多个碟片组成, 一个碟片由多个磁轨组成,每个磁轨包含多个扇区。本步骤可以为通过模式页 ( Mode Page )或规格说明书查出一个硬盘所包含的碟片数、 磁头数, 每个碟 片所包含的磁轨数, 一个磁轨所包含的扇区数, 并可以得到硬盘本身预留的原 始预留区域, 此处假设一个硬盘中本身预留的原始预留区域中包含 G个扇区, 即预留有 G个 LBA。 现在已知的硬盘中单个碟片包含 100K-200K个磁轨, 每个 磁轨包含 2K-3K个扇区, 硬盘本身预留的原始预留区域包含 2048-8192个扇区, 每个扇区对应一个 LBA, 即原始预留区域包含 2048-8192个 LBA。 In this embodiment, a RAID group is composed of a plurality of hard disks, one hard disk is composed of a plurality of disks, and one disk is composed of a plurality of magnetic tracks, each of which includes a plurality of sectors. In this step, the number of disks included in a hard disk, the number of magnetic heads, the number of tracks included in each disk, the number of sectors included in one track, and the number of sectors included in one track can be found by using a mode page or a specification sheet. The original reserved area reserved by the hard disk itself can be obtained. It is assumed that the original reserved area reserved by itself in one hard disk contains G sectors, that is, G LBAs are reserved. A single disc in the known hard disk currently contains 100K-200K tracks, each track contains 2K-3K sectors, and the original reserved area reserved by the hard disk itself contains 2048-8192 sectors. Each sector corresponds to one LBA, that is, the original reserved area contains 2048-8192 LBAs.
步骤 302, 根据各硬盘所包含的碟片数、 各碟片所包含的磁轨数、 各磁轨 所包含的扇区个数以及各磁轨中首尾扇区对应的首尾逻辑地址,生成各磁轨与 所述磁轨中首尾逻辑地址的对应关系。  Step 302: Generate each magnetic wave according to the number of disks included in each hard disk, the number of tracks included in each disk, the number of sectors included in each track, and the first and last logical addresses corresponding to the first and last sectors in each track. The correspondence between the track and the first and last logical addresses in the track.
当获取到各硬盘所包含的碟片数、各碟片所包含的磁轨数、各磁轨所包含 的扇区个数后, 由于磁轨中各扇区的逻辑地址按照顺序排列,根据各硬盘所包 含的碟片数、各碟片所包含的磁轨数、各磁轨所包含的扇区个数便可以计算出 每个磁轨中各首尾扇区对应的首尾逻辑地址,此处的首尾逻辑地址可以为磁轨 中首扇区对应的逻辑地址和尾扇区对应的逻辑地址。在计算出各磁轨中首尾扇 区对应的首尾逻辑地址后 ,便可以生成各磁轨与磁轨中首尾逻辑地址的对应关 系。  After obtaining the number of discs included in each hard disk, the number of tracks included in each disc, and the number of sectors included in each track, the logical addresses of the sectors in the track are arranged in order, according to each The number of disks included in the hard disk, the number of tracks included in each disk, and the number of sectors included in each track can calculate the first and last logical addresses corresponding to the first and last sectors in each track. The first and last logical addresses may be a logical address corresponding to the first sector in the track and a logical address corresponding to the tail sector. After calculating the first and last logical addresses corresponding to the first and last sectors in each track, the corresponding relationship between each track and the first and last logical addresses in the track can be generated.
步骤 303 , 在创建所述 RAID组时, 在所述 RAID组中预设所述新增预留区 域, 所述新增预留区域均勾分布在所述 RAID组中的各碟片上。  Step 303: When the RAID group is created, the newly added reserved area is preset in the RAID group, and the newly added reserved area is hooked on each disk in the RAID group.
在创建阵列产品的 RAID组时,存储空间按照条带化分布在 RAID组中的各 硬盘中, 在该 RAID组中自定义一个新增预留区域。 在本实施例中, 新增预留 区域均勾分布在 RAID组中的各碟片上, 使得各碟片上一定数量的磁轨之间共 用新增预留区域中的一些预留扇区。在本实施例中,新增预留区域与原始预留 区域的位置不同,各碟片中的新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心圓组成的区域, 即该新增预留区域为由多个同心圓组成的一 个条带区域, 其中最小半径为 R/N, 最大半径为 R/M, M和 N均为预设的大于 1 且小于 2的实数, 例如 N可以取值为 1.6, M可以取值为 2,。 可见, 本实施例将新 增预留区域设置在碟片的中心区域,从而相比于现有技术中位于内道的预留区 域, 减小了各磁轨与预留区域之间的距离。本实施例中的新增预留区域中的逻 辑地址总数为所述原始预留区域中的逻辑地址总数的 n倍, 假设一个硬盘中包 含 A块碟片, 则每个碟片中的新增预留区域中可以包含 nG/A个逻辑地址, n为 预设的大于 1的正整数。  When creating a RAID group of an array product, the storage space is striped across the hard disks in the RAID group, and a new reserved area is customized in the RAID group. In this embodiment, the newly added reserved areas are all distributed on the discs in the RAID group, so that some reserved sectors in the reserved area are shared by a certain number of tracks on each disc. In this embodiment, the newly added reserved area is different from the original reserved area, and the newly added reserved areas in each disc are respectively distributed in the discs with a radius of [R/N, R/M The area consisting of concentric circles, that is, the newly added reserved area is a strip area composed of a plurality of concentric circles, wherein the minimum radius is R/N, the maximum radius is R/M, and M and N are presets. A real number greater than 1 and less than 2, for example, N can take a value of 1.6 and M can take a value of 2. It can be seen that this embodiment sets the newly added reserved area in the central area of the disc, thereby reducing the distance between each track and the reserved area compared to the reserved area located in the inner track in the prior art. The total number of logical addresses in the newly added reserved area in this embodiment is n times the total number of logical addresses in the original reserved area. If a hard disk contains A blocks, the new one is added to each disk. The reserved area may contain nG/A logical addresses, and n is a preset positive integer greater than 1.
步骤 304, 当读取到 RAID组中各碟片上的坏道扇区时,根据所述坏道扇区 的逻辑地址获取所述坏道扇区的位置。  Step 304: When reading the bad sectors on each disc in the RAID group, obtain the location of the bad sectors according to the logical address of the bad sectors.
在本实施例中, 当首次读取 RAID组中的数据时, 可以在读取到 RAID组中 的坏道扇区时, 先降低完成 10操作, 并记录坏道扇区的逻辑地址。 然后釆用 RAID组校验算法进行数据重构, 若通过数据重构无法修复该坏道扇区, 则可 以先根据坏道扇区的逻辑地址获取该坏道扇区的位置,即获取该坏道扇区位于 哪个磁轨上。 可以根据上述步骤 302生成的各磁轨与磁轨中首尾逻辑地址的对 应关系来获取坏道扇区的位置,即判断该坏道扇区的逻辑地址位于那组首尾逻 辑地址构成的地址区间内,则表明该坏道扇区位于该首尾逻辑地址对应的磁轨 上。 In this embodiment, when the data in the RAID group is read for the first time, when the bad sectors in the RAID group are read, the completion 10 operation is first lowered, and the logical address of the bad sectors is recorded. Then use The RAID group verification algorithm performs data reconstruction. If the bad sector sector cannot be repaired by data reconstruction, the location of the bad sector sector may be obtained according to the logical address of the bad sector sector, that is, the bad sector is obtained. Which track is located on which track. The position of the bad sectors can be obtained according to the correspondence between the tracks generated in the above step 302 and the first and last logical addresses in the track, that is, the logical address of the bad sectors is determined to be located in the address range formed by the first and last logical addresses of the group. , indicating that the bad sector is located on the track corresponding to the first and last logical addresses.
步骤 305 , 根据坏道扇区的位置判断坏道扇区是否位于内道区域中, 如果 是, 则执行步骤 306, 否则执行步骤 307。  Step 305: Determine whether the bad sectors are located in the inner track area according to the position of the bad sectors. If yes, go to step 306, otherwise go to step 307.
在获取到坏道扇区的位置, 即获取到坏道扇区所处的磁轨后,根据坏道扇 区的位置判断坏道扇区是否位于内道区域中,可以根据磁轨所在的同心圓的半 径来判断坏道扇区是否位于内道区域中, 如果是, 则执行步骤 306 , 否则执行 步骤 307。本实施例中的内道区域可以为碟片中以 R/P为半径的同心圓对应的磁 轨以内的区域, 其中, R为碟片的半径, P为预设的大于 1且小于 R的实数; 非 内道区域为碟片上除内道区域外的区域。  After acquiring the track of the bad track sector, that is, after acquiring the track where the bad track sector is located, determining whether the bad track sector is located in the inner track area according to the position of the bad track sector may be based on the concentricity of the track The radius of the circle is used to determine whether the bad sectors are located in the inner track area. If yes, step 306 is performed; otherwise, step 307 is performed. The inner channel region in this embodiment may be an area within the disc corresponding to a concentric circle having a radius of R/P, wherein R is a radius of the disc, and P is a preset larger than 1 and smaller than R. Real number; the non-inner area is the area on the disc except the inner track area.
步骤 306, 将所述坏道扇区中的数据迁移到原始预留区域中, 并将坏道扇 区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物 理地址。  Step 306: The data in the bad sector is migrated into the original reserved area, and the physical address corresponding to the logical address of the bad sector is redirected to the physical after migration of the data in the bad sector. address.
当坏道扇区的逻辑地址位于内道区域中时,将所述坏道扇区中的数据迁移 到原始预留区域中,并将坏道扇区的逻辑地址对应的物理地址重新指向到所述 坏道扇区中的数据迁移后的物理地址, 即釆用硬盘自带的重映射机制, 将坏道 扇区的逻辑地址对应的物理地址重新指向到原始预留区域中。此处的原始预留 区域为硬盘自带的预留区域, 通常位于碟片的内道中。  When the logical address of the bad sector is located in the inner track area, the data in the bad track sector is migrated into the original reserved area, and the physical address corresponding to the logical address of the bad track sector is redirected to the location The physical address after the data migration in the bad sector is the remapping mechanism of the hard disk, and the physical address corresponding to the logical address of the bad sector is redirected to the original reserved area. The original reserved area here is the reserved area of the hard disk, usually located in the inner track of the disc.
步骤 307 , 判断该坏道扇区所在坏道区域是否满足预设的区域映射条件, 如果是, 则执行步骤 308 , 否则执行步骤 309。  Step 307: Determine whether the bad track area where the bad sector is located meets the preset area mapping condition. If yes, go to step 308; otherwise, go to step 309.
当坏道扇区的逻辑地址位于非内道区域中时,继续判断该坏道扇区所在坏 道区域是否满足预设的区域映射条件, 如果是, 则执行步骤 308 , 否则执行步 骤 309。 本步骤可以为对坏道扇区所在坏道区域进行扫描, 判断该坏道区域中 是否存在其他坏道扇区,此处的坏道区域只是为了定义坏道扇区附近的区域而 命名的,并不代表其他含义,如并非坏道区域中所有扇区均为坏道扇区。其中, X为所述坏道扇区的物理地址, Q为预设的正整数。 即本步骤通过对物理地址 X周围的扇区进行扫描, 以判断其周围是否存在与其相近的其他坏道扇区。 此 处的相近可以是指扇区在物理位置上的相近。 本实施例可以通过设定参数 Q, 来决定所要迁移的区域大小。 When the logical address of the bad sector is located in the non-inner track area, it is determined whether the bad track area of the bad track sector satisfies the preset area mapping condition. If yes, step 308 is performed; otherwise, step 309 is performed. In this step, the bad track area where the bad sectors are located may be scanned to determine whether there are other bad sectors in the bad track area, and the bad track area is named only for defining the area near the bad sectors. It does not mean other meanings, such as not all sectors in the bad track area are bad sectors. among them, X is the physical address of the bad sector, and Q is a preset positive integer. That is, this step scans the sector around the physical address X to determine whether there are other bad sectors adjacent to it. Similar here may refer to the similarity of sectors in physical locations. In this embodiment, the size of the area to be migrated can be determined by setting the parameter Q.
步骤 308, 将坏道区域中的数据迁移到预设的新增预留区域中, 并将所述 域中的数据迁移后的物理地址。  Step 308: The data in the bad track area is migrated to the preset new reserved area, and the physical address after the data in the domain is migrated.
如果坏道扇区所在坏道区域满足预设的区域映射条件,即该坏道区域中存 在至少两个坏道扇区, 这两个坏道扇区可能相近但不连续, 本实施例将该坏道 区域中的数据整体迁移到预设的新增预留区域中,并将坏道区域中数据的逻辑 地址对应的物理地址分别重新指向到所述坏道区域中的数据迁移后的物理地 道扇区时, 本实施例不仅将至少两个坏道扇区的数据迁移到新增预留区域,还 将坏道扇区周围的其他良好扇区的数据也一起迁移到新增预留区域,从而当需 要读取物理地址为 [X-Q,X+Q]的扇区中的数据时, 不会因其中数据不在同一区 域而使得磁头来回摆动。  If the bad track area of the bad track sector satisfies the preset area mapping condition, that is, there are at least two bad track sectors in the bad track area, the two bad track sectors may be similar but not continuous, and this embodiment will The data in the bad track area is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad track area is redirected to the physical tunnel after the data migration in the bad track area. In the case of a sector, this embodiment not only migrates data of at least two bad sectors to a newly reserved area, but also migrates data of other good sectors around the bad sectors to the newly reserved area. Therefore, when it is necessary to read data in a sector whose physical address is [XQ, X+Q], the head does not swing back and forth because the data is not in the same area.
步骤 309, 将坏道扇区中的数据迁移到新增预留区域中, 并将坏道扇区中 的数据的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后 的物理地址。  Step 309: The data in the bad sector is migrated to the newly added reserved area, and the physical address corresponding to the logical address of the data in the bad track is redirected to the data in the bad sector. Physical address.
如果坏道扇区所在坏道区域不满足预设的区域映射条件,即该坏道区域中 只存在一个坏道扇区, 则无需对该坏道区域中的数据进行整体迁移, 而只将坏 道扇区中的数据迁移到新增预留区域中,并将该坏道扇区中的数据的逻辑地址 对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物理地址,从而可 以降低新增预留区域的负担。  If the bad track area of the bad sector does not satisfy the preset area mapping condition, that is, only one bad track sector exists in the bad track area, there is no need to perform overall migration of the data in the bad track area, but only the bad The data in the track sector is migrated to the newly added reserved area, and the physical address corresponding to the logical address of the data in the bad track sector is redirected to the physical address after the data migration in the bad track sector. This can reduce the burden of adding new reserved areas.
步骤 310, 根据数据的逻辑地址从逻辑地址对应的扇区读取数据。  Step 310: Read data from a sector corresponding to the logical address according to the logical address of the data.
在完成数据的迁移和逻辑地址的重新指向后, 当后续再对该 RAID组中的 数据进行 10操作时,则根据重新指向后的逻辑地址来从逻辑地址对应的区域中 读取数据。 在读取 RAID组中的数据时, 良好扇区中数据的逻辑地址未被重映 射, 则仍从良好扇区中读取数据。 出现坏道扇区的扇区中的数据的逻辑地址被 重新指向,对于内道区域中的数据, 则从原始预留区域中读取重新指向后的逻 辑地址对应的数据; 对于非内道区域中的数据,如果一个逻辑地址周围的区域 中的逻辑地址被整体重新指向, 则直接访问新增预留区域中,如果一个逻辑地 址被单个重新指向, 则从新增预留区域中读取数据。 After the data migration and the logical address redirection are completed, when the data in the RAID group is subsequently 10, the data is read from the area corresponding to the logical address according to the redirected logical address. When reading data in a RAID group, the logical address of the data in the good sector is not remapped, and the data is still read from the good sector. The logical address of the data in the sector in which the bad sector is present is redirected. For the data in the inner area, the reoriented logic is read from the original reserved area. For the data in the non-inner track area, if the logical address in the area around a logical address is redirected as a whole, the new reserved area is directly accessed. If a logical address is redirected individually, The data is read from the newly added reserved area.
本实施例提供了一种磁盘重映射方法, 通过对坏道扇区的位置进行区分, 向到原始预留区域中数据迁移后的物理地址,将非内道区域中的坏道扇区的逻 辑地址对应的物理地址重新指向到新增预留区域中数据迁移后的物理地址;通 过将满足预设的区域映射条件的坏道区域中的数据整体迁移到新增预留区域 中,使得当读取到该坏道区域中的数据时, 直接从新增预留区域中进行整体读 取,避免了由于某个区域中存在多个相近但不连续的坏道扇区导致磁头反复摆 动, 从而大大减少了因磁头反复摆动带来的延时。  This embodiment provides a disk remapping method. By distinguishing the location of bad sectors, the physical address of the data after migration to the original reserved area, the logic of the bad sectors in the non-inner area The physical address corresponding to the address is redirected to the physical address after the data migration in the newly added reserved area. The data in the bad track area that meets the preset area mapping condition is migrated to the newly added reserved area, so that the current reading is performed. When the data in the bad track area is obtained, the overall reading is directly performed from the newly added reserved area, thereby avoiding the repeated swing of the magnetic head due to the presence of a plurality of similar but discontinuous bad sectors in a certain area, thereby greatly The delay due to repeated head swings is reduced.
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取 存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步骤; 而前述的 存储介质包括: ROM, RAM,磁碟或者光盘等各种可以存储程序代码的介质。  One of ordinary skill in the art will appreciate that all or a portion of the steps to implement the various method embodiments described above can be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
图 4为本发明磁盘重映射装置实施例一的结构示意图,如图 4所示, 本实施 例提供了一种磁盘重映射装置, 可以执行上述方法实施例一中的各个步骤, 此 处不再赘述。 本实施例提供的磁盘重映射装置可以包括第一获取单元 401、 第 一迁移单元 402、 第二迁移单元 403和读取单元 404。 其中, 第一获取单元 401 用于当读取到各碟片上的坏道扇区时,根据所述坏道扇区的逻辑地址获取所述 坏道扇区的位置。第一迁移单元 402用于若第一获取单元 401获取到的所述坏道 扇区位于内道区域中, 则将所述坏道扇区中的数据迁移到原始预留区域中, 并 将所述坏道扇区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数 据迁移后的物理地址。第二迁移单元 403用于若第一获取单元 401获取到的所述 坏道扇区位于非内道区域中,则将满足预设的区域映射条件的坏道扇区所在坏 道区域中的数据迁移到预设的新增预留区域中,并将所述坏道区域中数据的逻 辑地址对应的物理地址分别重新指向到所述坏道区域中的数据迁移后的物理 地址。 读取单元 404用于根据第一迁移单元 402和第二迁移单元 403重新指向的 域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区域, 其中, R为所述碟 片的半径, P为预设的大于 1且小于 R的实数; 所述非内道区域为所述碟片上除 所述内道区域外的区域。 4 is a schematic structural diagram of Embodiment 1 of a disk remapping apparatus according to the present invention. As shown in FIG. 4, this embodiment provides a disk remapping apparatus, which can perform various steps in Embodiment 1 of the foregoing method, where Narration. The disk remapping apparatus provided in this embodiment may include a first obtaining unit 401, a first migrating unit 402, a second migrating unit 403, and a reading unit 404. The first obtaining unit 401 is configured to acquire the location of the bad sectors according to the logical address of the bad sectors when the bad sectors on each disc are read. The first migration unit 402 is configured to migrate the data in the bad track sector to the original reserved area if the bad sector sector acquired by the first obtaining unit 401 is located in the inner channel area, and The physical address corresponding to the logical address of the bad sector is redirected to the physical address after the data migration in the bad sector. The second migration unit 403 is configured to: if the bad sector sector acquired by the first obtaining unit 401 is located in the non-inner track area, the data in the bad track area where the bad track sector meets the preset area mapping condition The data is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad track area is redirected to the physical address after the data migration in the bad track area. The reading unit 404 is configured to re-point the domain according to the first migration unit 402 and the second migration unit 403 to a region within the disc corresponding to a concentric circle having a radius of R/P, wherein R is the disc The radius of the slice, P is a preset real number greater than 1 and less than R; the non-inner track region is an area on the disc other than the inner track region.
图 5为本发明磁盘重映射装置实施例二的结构示意图,如图 5所示, 本实施 例提供了一种磁盘重映射装置, 可以执行上述方法实施例二中的各个步骤, 此 处不再赘述。 本实施例提供的磁盘重映射装置在上述图 4所示的基础之上, 第 二迁移单元 403可以包括扫描子单元 413和迁移子单元 423。 其中, 扫描子单元 413用于若第一获取单元 401获取到的所述坏道扇区位于非内道区域中,则对所 述坏道扇区所在坏道区域进行扫描,所述坏道扇区所在坏道区域为由物理地址 为 [X-Q,X+Q]的扇区构成的区域, 其中, X为所述坏道扇区的物理地址, Q为 预设的正整数。迁移子单元 423用于当扫描子单元 413扫描的结果为所述坏道区 域中存在其他坏道扇区时, 所述坏道区域满足预设的区域映射条件,将所述坏 道区域中的数据迁移到预设的新增预留区域中,并将所述坏道区域中数据的逻 辑地址对应的物理地址分别重新指向到所述坏道区域中的数据迁移后的物理 地址。  FIG. 5 is a schematic structural diagram of Embodiment 2 of a disk remapping apparatus according to the present invention. As shown in FIG. 5, this embodiment provides a disk remapping apparatus, which can perform various steps in Embodiment 2 of the foregoing method, where Narration. The disk remapping apparatus provided in this embodiment is based on the foregoing FIG. 4, and the second migration unit 403 may include a scanning subunit 413 and a migration subunit 423. The scan sub-unit 413 is configured to scan the bad track area where the bad track sector is located, if the bad track sector acquired by the first obtaining unit 401 is located in the non-inner track area, the bad track fan The bad track area where the area is located is an area composed of sectors having a physical address of [XQ, X+Q], where X is the physical address of the bad sector, and Q is a preset positive integer. The migration sub-unit 423 is configured to: when the scan sub-unit 413 scans that there are other bad sectors in the bad track area, the bad track area satisfies a preset area mapping condition, where the bad track area The data is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad track area is redirected to the physical address after the data migration in the bad track area.
进一步地, 本实施例提供的磁盘重映射装置还可以包括处理单元 501。 处 理单元 501用于当扫描子单元 413扫描的结果为所述坏道区域中不存在其他坏 道扇区时, 所述坏道区域不满足预设的区域映射条件,将所述坏道扇区的逻辑 地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物理地址。  Further, the disk remapping apparatus provided in this embodiment may further include a processing unit 501. The processing unit 501 is configured to: when the scan sub-unit 413 scans that there is no other bad track sector in the bad track area, the bad track area does not satisfy the preset area mapping condition, and the bad track sector is The physical address corresponding to the logical address is redirected to the physical address after the data migration in the bad sector.
进一步地, 本实施例提供的磁盘重映射装置还可以包括预配置单元 502 , 预配置单元 502用于在第一获取单元 401获取所述坏道扇区的位置之前,预配置 所述新增预留区域, 所述新增预留区域均勾分布在各碟片上, 所述各碟片中的 新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心圓组成的区 域,所述新增预留区域中的逻辑地址总数为所述原始预留区域中的逻辑地址总 数的 n倍, M和 N为预设的大于 1且小于 2的实数, M<N, n为预设的大于 1的正 整数。  Further, the disk remapping apparatus provided in this embodiment may further include a pre-configuration unit 502, configured to pre-configure the new pre-preparation before the first acquiring unit 401 acquires the location of the bad sector sector. In the remaining area, the newly added reserved area is hooked on each of the discs, and the newly added reserved areas in the discs are respectively distributed in the discs with a radius of [R/N, R/ An area composed of concentric circles of M], the total number of logical addresses in the newly added reserved area is n times the total number of logical addresses in the original reserved area, and M and N are preset values greater than 1 and less than 2 Real number, M<N, n is a preset positive integer greater than 1.
进一步地, 本实施例提供的磁盘重映射装置还可以包括第二获取单元 503 和生成单元 504。 其中, 第二获取单元 503用于在第一获取单元 401获取所述坏 道扇区的位置之前, 获取各硬盘所包含的碟片数、各碟片所包含的磁轨数以及 各磁轨所包含的扇区个数。生成单元 504用于根据第二获取单元 503获取的所述 各硬盘所包含的碟片数、各碟片所包含的磁轨数、各磁轨所包含的扇区个数以 及各磁轨中首尾扇区对应的首尾逻辑地址,生成各磁轨与所述磁轨中首尾逻辑 地址的对应关系。 Further, the disk remapping apparatus provided in this embodiment may further include a second obtaining unit 503 and a generating unit 504. The second obtaining unit 503 is configured to obtain the number of disks included in each hard disk, the number of magnetic tracks included in each disk, and each track before the first acquiring unit 401 acquires the position of the bad sectors. The number of sectors included. The generating unit 504 is configured to use, according to the number of disks included in each hard disk acquired by the second obtaining unit 503, the number of tracks included in each disk, and the number of sectors included in each track. And the first and last logical addresses corresponding to the first and last sectors in each track, and the correspondence between each track and the first and last logical addresses in the track is generated.
本实施例提供了一种磁盘重映射装置, 通过对坏道扇区的位置进行区分, 向到原始预留区域中数据迁移后的物理地址,将非内道区域中的坏道扇区的逻 辑地址对应的物理地址重新指向到新增预留区域中数据迁移后的物理地址;通 过将满足预设的区域映射条件的坏道区域中的数据整体迁移到新增预留区域 中,使得当读取到该坏道区域中的数据时, 直接从新增预留区域中进行整体读 取,避免了由于某个区域中存在多个相近但不连续的坏道扇区导致磁头反复摆 动, 从而大大减少了因磁头反复摆动带来的延时。  This embodiment provides a disk remapping device. The logic of the bad sectors in the non-inner track area is determined by distinguishing the location of the bad sectors from the physical address to the original reserved area. The physical address corresponding to the address is redirected to the physical address after the data migration in the newly added reserved area. The data in the bad track area that meets the preset area mapping condition is migrated to the newly added reserved area, so that the current reading is performed. When the data in the bad track area is obtained, the overall reading is directly performed from the newly added reserved area, thereby avoiding the repeated swing of the magnetic head due to the presence of a plurality of similar but discontinuous bad sectors in a certain area, thereby greatly The delay due to repeated head swings is reduced.
本发明实施例还提供了一种机器可读介质, 其上存储有指令集合, 当该指 令集合被执行时,使得该机器可执行上述方法实施例一或方法实施例二所述的 磁盘重映射方法。  The embodiment of the present invention further provides a machine readable medium, where a set of instructions is stored, and when the set of instructions is executed, the machine can perform the disk remapping described in Embodiment 1 or Method Embodiment 2 of the foregoing method. method.
图 6为本发明磁盘重映射装置实施例三的结构示意图,如图 6所示, 本发 明实施例还提供了一种磁盘重映射装置, 该磁盘重映射装置可以包括存储器 601和处理器 602。 其中, 存储器 601用于存储指令。 处理器 602与所述存储 器 601耦合, 该处理器 602被配置为执行存储在所述存储器 601中的指令。其 中, 处理器 602被配置为用于: 当读取到各碟片上的坏道扇区时, 根据所述坏 道扇区的逻辑地址获取所述坏道扇区的位置; 若所述坏道扇区位于内道区域 中, 则将所述坏道扇区中的数据迁移到原始预留区域中, 并将所述坏道扇区的 逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物理地 址; 若所述坏道扇区位于非内道区域中, 则将满足预设的区域映射条件的坏道 扇区所在坏道区域中的数据迁移到预设的新增预留区域中,并将所述坏道区域 中数据的逻辑地址对应的物理地址分别重新指向到所述坏道区域中的数据迁 据; 其中, 所述内道区域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区 域, 其中, R为所述碟片的半径, P为预设的大于 1且小于 R的实数; 所述非 内道区域为所述碟片上除所述内道区域外的区域。  FIG. 6 is a schematic structural diagram of Embodiment 3 of a disk remapping apparatus according to the present invention. As shown in FIG. 6, the embodiment of the present invention further provides a disk remapping apparatus, which may include a memory 601 and a processor 602. Among them, the memory 601 is used to store instructions. Processor 602 is coupled to said memory 601, which is configured to execute instructions stored in said memory 601. The processor 602 is configured to: when reading a bad track sector on each disc, acquire a location of the bad track sector according to a logical address of the bad track sector; The track sector is located in the inner track area, and the data in the bad track sector is migrated into the original reserved area, and the physical address corresponding to the logical address of the bad track sector is redirected to the bad track a physical address after the data migration in the sector; if the bad sector is located in the non-inner area, the data in the bad track area of the bad sector that satisfies the preset area mapping condition is migrated to the preset In the new reserved area, the physical address corresponding to the logical address of the data in the bad track area is redirected to the data migration in the bad track area respectively; wherein the inner track area is in the disc a region within a track corresponding to a concentric circle having a radius of R/P, where R is a radius of the disc, P is a preset real number greater than 1 and less than R; the non-inner track region is An area on the disc other than the inner track area.
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者 对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并不使相 应技术方案的本质脱离本发明各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting thereof; although the present invention has been described in detail with reference to the foregoing embodiments, It should be understood that: the technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the essence of the corresponding technical solutions. The scope of the technical solutions of the embodiments.

Claims

权 利 要 求 Rights request
1、 一种磁盘重映射方法, 其特征在于, 包括: 1. A disk remapping method, characterized by including:
当读取到各碟片上的坏道扇区时,根据所述坏道扇区的逻辑地址获取所述 坏道扇区的位置; When the bad sector sectors on each disc are read, the location of the bad sector sector is obtained according to the logical address of the bad sector sector;
若所述坏道扇区位于内道区域中,则将所述坏道扇区中的数据迁移到原始 预留区域中,并将所述坏道扇区的逻辑地址对应的物理地址重新指向到所述坏 道扇区中的数据迁移后的物理地址; If the bad sector sector is located in the inner track area, the data in the bad sector sector is migrated to the original reserved area, and the physical address corresponding to the logical address of the bad sector sector is redirected to The physical address of the data in the bad sector after migration;
若所述坏道扇区位于非内道区域中,则将满足预设的区域映射条件的坏道 扇区所在坏道区域中的数据迁移到预设的新增预留区域中,并将所述坏道区域 中数据的逻辑地址对应的物理地址分别重新指向到所述坏道区域中的数据迁 移后的物理地址; 其中, 所述内道区域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区 域, 其中, R为所述碟片的半径, P为预设的大于 1且小于 R的实数; 所述非内 道区域为所述碟片上除所述内道区域外的区域。 If the bad sector sector is located in a non-inner track area, then the data in the bad sector area where the bad sector sector satisfies the preset area mapping conditions is migrated to the preset new reserved area, and all The physical addresses corresponding to the logical addresses of the data in the bad sector area are respectively redirected to the physical addresses of the data in the bad sector area after migration; wherein, the inner track area is a concentric area on the disc with R/P as the radius. The area within the magnetic track corresponding to the circle, where R is the radius of the disc, and P is a preset real number greater than 1 and less than R; the non-inner track area is the area on the disc except the inner track Area outside the area.
2、 根据权利要求 1所述的方法, 其特征在于, 所述将满足预设的区域映射 条件的坏道扇区所在坏道区域中的数据迁移到预设的新增预留区域中包括: 对所述坏道扇区所在坏道区域进行扫描,所述坏道扇区所在坏道区域为由 物理地址为 [X-Q,X+Q]的扇区构成的区域, 其中, X为所述坏道扇区的物理地 址, Q为预设的正整数; 2. The method according to claim 1, characterized in that, migrating data in the bad sector area where the bad sector sectors that meet the preset area mapping conditions are located into the preset new reserved area includes: Scan the bad sector area where the bad sector sector is located. The bad sector area where the bad sector sector is located is an area composed of sectors with physical addresses [X-Q, X+Q], where X is the bad sector area. The physical address of the track sector, Q is a preset positive integer;
当所述坏道区域中存在其他坏道扇区时,则所述坏道区域满足预设的区域 映射条件, 将所述坏道区域中的数据迁移到预设的新增预留区域中。 When there are other bad sector sectors in the bad sector area, the bad sector area meets the preset area mapping conditions, and the data in the bad sector area is migrated to the preset new reserved area.
3、 根据权利要求 2所述的方法, 其特征在于, 还包括: 3. The method according to claim 2, further comprising:
当所述坏道区域中不存在其他坏道扇区时,则所述坏道区域不满足预设的 区域映射条件,将所述坏道扇区中的数据迁移到预设的新增预留区域中, 并将 所述坏道扇区中的数据的逻辑地址对应的物理地址重新指向到所述坏道扇区 中的数据迁移后的物理地址。 When there are no other bad sector sectors in the bad sector area, the bad sector area does not meet the preset area mapping conditions, and the data in the bad sector sector is migrated to the preset new reservation. area, and redirect the physical address corresponding to the logical address of the data in the bad sector sector to the physical address after migration of the data in the bad sector sector.
4、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括: 4. The method according to claim 1 or 2, further comprising:
预配置所述新增预留区域, 所述新增预留区域均勾分布在各碟片上, 所述 各碟片中的新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心 圓组成的区域,所述新增预留区域中的逻辑地址总数为所述原始预留区域中的 逻辑地址总数的 n倍, M和 N为预设的大于 1且小于 2的实数, M<N, n为预设的 大于 1的正整数。 The newly added reserved areas are pre-configured, and the newly added reserved areas are evenly distributed on each disc. The newly added reserved areas in each disc are respectively distributed in the area composed of concentric circles with a radius of [R/N, R/M] in each disc. The total number of logical addresses in the newly added reserved areas is is n times the total number of logical addresses in the original reserved area, M and N are preset real numbers greater than 1 and less than 2, M<N, and n is a preset positive integer greater than 1.
5、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括: 5. The method according to claim 1 or 2, further comprising:
获取各硬盘所包含的碟片数、各碟片所包含的磁轨数以及各磁轨所包含的 扇区个数; Get the number of discs contained in each hard disk, the number of tracks contained in each disc, and the number of sectors contained in each track;
根据所述各硬盘所包含的碟片数、各碟片所包含的磁轨数、各磁轨所包含 的扇区个数以及各磁轨中首尾扇区对应的首尾逻辑地址,生成各磁轨与所述磁 轨中首尾逻辑地址的对应关系。 Each track is generated based on the number of disks contained in each hard disk, the number of magnetic tracks contained in each disk, the number of sectors contained in each magnetic track, and the first and last logical addresses corresponding to the first and last sectors in each magnetic track. The corresponding relationship with the first and last logical addresses in the track.
6、 一种磁盘重映射装置, 其特征在于, 包括: 6. A disk remapping device, characterized by including:
第一获取单元, 用于当读取到各碟片上的坏道扇区时,根据所述坏道扇区 的逻辑地址获取所述坏道扇区的位置; The first acquisition unit is used to obtain the location of the bad sector sector according to the logical address of the bad sector sector when reading the bad sector sector on each disc;
第一迁移单元,用于若所述第一获取单元获取到的所述坏道扇区位于内道 区域中, 则将所述坏道扇区中的数据迁移到原始预留区域中, 并将所述坏道扇 区的逻辑地址对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物 理地址; The first migration unit is configured to migrate the data in the bad sector sector to the original reserved area if the bad sector sector acquired by the first acquisition unit is located in the inner track area, and The physical address corresponding to the logical address of the bad sector sector is redirected to the physical address after data migration in the bad sector sector;
第二迁移单元,用于若所述第一获取单元获取到的所述坏道扇区位于非内 移到预设的新增预留区域中 ,并将所述坏道区域中数据的逻辑地址对应的物理 地址分别重新指向到所述坏道区域中的数据迁移后的物理地址; The second migration unit is used to move the bad sector sector acquired by the first acquisition unit to a preset new reserved area, and transfer the logical address of the data in the bad sector area to the non-internal location. The corresponding physical addresses are respectively redirected to the physical addresses after data migration in the bad sector area;
读取单元,用于根据所述第一迁移单元和所述第二迁移单元重新指向的数 其中, 所述内道区域为碟片中以 R/P为半径的同心圓对应的磁轨以内的区 域, 其中, R为所述碟片的半径, P为预设的大于 1且小于 R的实数; 所述非内 道区域为所述碟片上除所述内道区域外的区域。 The reading unit is used to re-point according to the number of the first migration unit and the second migration unit, wherein the inner track area is within the magnetic track corresponding to the concentric circle with R/P as the radius in the disc. area, where R is the radius of the disc, P is a preset real number greater than 1 and less than R; the non-inner track area is the area on the disc except the inner track area.
7、 根据权利要求 6所述的装置, 其特征在于, 所述第二迁移单元包括: 扫描子单元,用于若所述第一获取单元获取到的所述坏道扇区位于非内道 区域中, 则对所述坏道扇区所在坏道区域进行扫描, 所述坏道扇区所在坏道区 域为由物理地址为 [X-Q,X+Q]的扇区构成的区域, 其中, X为所述坏道扇区的 物理地址, Q为预设的正整数; 7. The device according to claim 6, characterized in that the second migration unit includes: a scanning subunit, configured to detect if the bad sector acquired by the first acquisition unit is located in a non-inner track area , then the bad sector area where the bad sector sector is located is scanned, and the bad sector area where the bad sector sector is located is an area composed of sectors with physical addresses [XQ,X+Q], where X is The bad sector sectors Physical address, Q is a preset positive integer;
迁移子单元,用于当所述扫描子单元扫描的结果为所述坏道区域中存在其 他坏道扇区时, 所述坏道区域满足预设的区域映射条件, 将所述坏道区域中的 数据迁移到预设的新增预留区域中,并将所述坏道区域中数据的逻辑地址对应 的物理地址分别重新指向到所述坏道区域中的数据迁移后的物理地址。 The migration subunit is used to, when the scan result of the scanning subunit is that there are other bad sector sectors in the bad sector area and the bad sector area satisfies the preset area mapping conditions, move the bad sector area into the bad sector area. The data is migrated to a preset new reserved area, and the physical address corresponding to the logical address of the data in the bad sector area is redirected to the physical address after migration of the data in the bad sector area.
8、 根据权利要求 7所述的装置, 其特征在于, 还包括: 8. The device according to claim 7, further comprising:
处理单元,用于当所述扫描子单元扫描的结果为所述坏道区域中不存在其 他坏道扇区时, 所述坏道区域不满足预设的区域映射条件,将所述坏道扇区中 的数据迁移到预设的新增预留区域中,并将所述坏道扇区中的数据的逻辑地址 对应的物理地址重新指向到所述坏道扇区中的数据迁移后的物理地址。 A processing unit configured to, when the scan result of the scanning subunit is that there are no other bad sector sectors in the bad sector area and the bad sector area does not meet the preset area mapping conditions, the bad sector sector The data in the area is migrated to the preset new reserved area, and the physical address corresponding to the logical address of the data in the bad sector sector is redirected to the physical address of the data in the bad sector sector after migration. address.
9、 根据权利要求 6或 7所述的装置, 其特征在于, 还包括: 9. The device according to claim 6 or 7, further comprising:
预配置单元, 用于在所述第一获取单元获取所述坏道扇区的位置之前,预 配置所述新增预留区域, 所述新增预留区域均勾分布在各碟片上, 所述各碟片 中的新增预留区域分别分布在所述各碟片中由半径为 [R/N,R/M]的同心圓组成 的区域,所述新增预留区域中的逻辑地址总数为所述原始预留区域中的逻辑地 址总数的 n倍, M和 N为预设的大于 1且小于 2的实数, M<N, n为预设的大于 1 的正整数。 A preconfiguration unit configured to preconfigure the newly added reserved area before the first acquisition unit obtains the location of the bad sector sector, and the newly added reserved area is evenly distributed on each disc, The newly added reserved areas in each of the discs are respectively distributed in areas composed of concentric circles with a radius of [R/N, R/M] in each of the discs. The logic in the newly added reserved areas is The total number of addresses is n times the total number of logical addresses in the original reserved area. M and N are preset real numbers greater than 1 and less than 2. M<N, n is a preset positive integer greater than 1.
10、 根据权利要求 6或 7所述的装置, 其特征在于, 还包括: 10. The device according to claim 6 or 7, further comprising:
第二获取单元, 用于在所述第一获取单元获取所述坏道扇区的位置之前, 获取各硬盘所包含的碟片数、各碟片所包含的磁轨数以及各磁轨所包含的扇区 个数; The second acquisition unit is configured to acquire the number of disks contained in each hard disk, the number of magnetic tracks contained in each disk, and the number of magnetic tracks contained in each magnetic track before the first obtaining unit obtains the location of the bad sector. The number of sectors;
生成单元, 用于根据所述第二获取单元获取的所述各硬盘所包含的碟片 数、各碟片所包含的磁轨数、各磁轨所包含的扇区个数以及各磁轨中首尾扇区 对应的首尾逻辑地址, 生成各磁轨与所述磁轨中首尾逻辑地址的对应关系。 A generating unit configured to obtain the number of discs contained in each hard disk, the number of magnetic tracks contained in each disc, the number of sectors contained in each magnetic track and the number of sectors contained in each magnetic track obtained by the second acquisition unit. The first and last logical addresses corresponding to the first and last sectors generate the corresponding relationship between each magnetic track and the first and last logical addresses in the magnetic track.
11、 一种磁盘重映射装置, 其特征在于, 包括: 存储器和处理器, 所述存 储器用于存储指令, 所述处理器用于执行存储在所述存储器重的指令,执行权 利要求 1-5的方法。 11. A disk remapping device, characterized in that it includes: a memory and a processor, the memory is used to store instructions, the processor is used to execute instructions stored in the memory, and performs claims 1-5 method.
PCT/CN2013/072036 2012-07-31 2013-03-01 Method and device for remapping a disk WO2014019360A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210268767.3A CN103577114B (en) 2012-07-31 2012-07-31 Disk remaps method and apparatus
CN201210268767.3 2012-07-31

Publications (1)

Publication Number Publication Date
WO2014019360A1 true WO2014019360A1 (en) 2014-02-06

Family

ID=50027190

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/072036 WO2014019360A1 (en) 2012-07-31 2013-03-01 Method and device for remapping a disk

Country Status (2)

Country Link
CN (1) CN103577114B (en)
WO (1) WO2014019360A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105320467B (en) * 2014-08-05 2018-11-06 株式会社东芝 The data of disk device and disk device read method
CN104794011B (en) * 2015-02-04 2017-12-12 深圳神州数码云科数据技术有限公司 Bad block reorientation method and device based on virtual disk
CN108762685B (en) * 2018-06-04 2021-06-22 平安科技(深圳)有限公司 IO hang-up recognition method and device, computer device and storage medium
CN112558859A (en) * 2019-09-26 2021-03-26 杭州海康威视数字技术股份有限公司 Hard disk, storage system and hard disk capacity marking method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1117637A (en) * 1993-12-23 1996-02-28 国际商业机器公司 Sector architecture for fixed block disk drive
US5822142A (en) * 1996-07-26 1998-10-13 Western Digital Corporation Method of mapping logical sectors to physical sectors in a disk drive sparing partition
CN102306128A (en) * 2011-09-16 2012-01-04 北京星网锐捷网络技术有限公司 Disk management method and device and network equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581167B1 (en) * 1999-02-01 2003-06-17 Matsushita Electric Industrial Co., Ltd. Information recording medium, information recording method and information recording/reproduction system
EP1761927A1 (en) * 2004-06-21 2007-03-14 Koninklijke Philips Electronics N.V. Defect management for real-time information
CN102222033B (en) * 2011-06-20 2017-07-11 中兴通讯股份有限公司 A kind of method and device for preserving small computer system interface access error
CN102508724B (en) * 2011-10-25 2013-12-18 北京同有飞骥科技股份有限公司 Disk bad block processing method based on soft RAID (redundant array of independent disks)

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1117637A (en) * 1993-12-23 1996-02-28 国际商业机器公司 Sector architecture for fixed block disk drive
US5822142A (en) * 1996-07-26 1998-10-13 Western Digital Corporation Method of mapping logical sectors to physical sectors in a disk drive sparing partition
CN102306128A (en) * 2011-09-16 2012-01-04 北京星网锐捷网络技术有限公司 Disk management method and device and network equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, YE ET AL.: "The disk failure management stragety of SATA Host Controller based on the whole hardware structure", 28 December 2011 (2011-12-28), pages 4 - 7, Retrieved from the Internet <URL:http://www.paper.edu.cn/releasepaper/content/201112-798> [retrieved on 20130521] *

Also Published As

Publication number Publication date
CN103577114B (en) 2016-08-10
CN103577114A (en) 2014-02-12

Similar Documents

Publication Publication Date Title
US9805762B2 (en) Band rewrite optimization
KR101086857B1 (en) Control Method of Solid State Storage System for Data Merging
US9720860B2 (en) System and method for efficient processing of queued read commands in a memory system
JP4219602B2 (en) Storage control device and control method of storage control device
US9317436B2 (en) Cache node processing
JP5786611B2 (en) Storage device and storage system
TWI531963B (en) Data storage systems and their specific instruction enforcement methods
CN105280197A (en) Data management for a data storage device with zone relocation
US20050210214A1 (en) Fragmentation executing method and storage device
WO2014019360A1 (en) Method and device for remapping a disk
US10346051B2 (en) Storage media performance management
JP6089844B2 (en) Control device, storage device, and control program
KR20160055886A (en) Dynamic band boundaries
JP6065695B2 (en) Storage control method, storage system, and storage control program
JP2020004186A (en) Information processing system, management device and control method
US10268394B2 (en) Data storage device performance optimization method and apparatus
US11682428B2 (en) Hard disk format conversion method and apparatus, and storage device
US7200771B2 (en) Relocation batch processing for disk drives
JP7404988B2 (en) Storage control device, storage system and storage control program
KR101117390B1 (en) Method for accessing data in non-volatile memory storage and recorded medium storing program for performing the same
JP6003364B2 (en) Control device, storage device, control method, and control program
JP3190546B2 (en) Block address conversion method, rotation type storage subsystem control method, and disk subsystem
US7669007B2 (en) Mirrored redundant array of independent disks (RAID) random access performance enhancement
JP6427913B2 (en) Storage system, control device, storage device, input / output control method, and program
US11609707B1 (en) Multi-actuator storage device access using logical addresses

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: 13825677

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: 13825677

Country of ref document: EP

Kind code of ref document: A1