[go: up one dir, main page]

CN101281452A - Automatic hard disk reconstruction method - Google Patents

Automatic hard disk reconstruction method Download PDF

Info

Publication number
CN101281452A
CN101281452A CNA2007100968671A CN200710096867A CN101281452A CN 101281452 A CN101281452 A CN 101281452A CN A2007100968671 A CNA2007100968671 A CN A2007100968671A CN 200710096867 A CN200710096867 A CN 200710096867A CN 101281452 A CN101281452 A CN 101281452A
Authority
CN
China
Prior art keywords
hard disk
hard
data
disk
rebuilding
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CNA2007100968671A
Other languages
Chinese (zh)
Inventor
吴明城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inventec Corp
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to CNA2007100968671A priority Critical patent/CN101281452A/en
Publication of CN101281452A publication Critical patent/CN101281452A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an automatic hard disk reconstruction method which is suitable for a host adopting a disk array, wherein the disk array comprises a plurality of first hard disks. Each first hard disk is connected to a hard disk slot of the host through a small computer system interface. The method comprises the following steps: the first hard disks are initialized first, and data configuration information of the first hard disks is recorded. Then, the pins configured on each hard disk slot are used for detecting whether a hard disk is inserted into or pulled out of one of the hard disk slots. And when the second hard disk is detected to be inserted, searching data configuration information according to the plugging data, wherein the data configuration information corresponds to the hard disk slot into which the second hard disk is inserted. And then, according to the data configuration information, the backup data stored in other first hard disks are used for reconstructing a second hard disk.

Description

硬盘自动重建方法 Hard Disk Automatic Rebuild Method

技术领域 technical field

本发明是有关于一种硬盘重建方法,且特别是有关于一种硬盘自动重建方法。The present invention relates to a method for rebuilding a hard disk, and in particular relates to a method for automatically rebuilding a hard disk.

背景技术 Background technique

现今网络技术趋于成熟,不论是在企业或是学校里,依赖网络来进行信息的传递与交换的比重越来越高,做为信息交换平台的服务器的可靠度也越来越重要。因此,当服务器的硬件出现问题时,往往需要在不停机的情形下完成部份硬件的更换,以确保信息的交流不受中断。此外,服务器也需要具有数据容错的功能,以让数据有毁损的状况时能及时地复原。Nowadays, network technology is becoming more and more mature. Whether it is in enterprises or schools, the proportion of information transmission and exchange relying on the network is getting higher and higher, and the reliability of the server as an information exchange platform is also becoming more and more important. Therefore, when there is a problem with the hardware of the server, it is often necessary to replace part of the hardware without stopping the server, so as to ensure that the communication of information is not interrupted. In addition, the server also needs to have the function of data fault tolerance, so that the data can be restored in time when the data is damaged.

为了要能在不停机的状态下进行部份硬件的更换,服务器需提供能让硬件热插拔(hot pluggable)的功能,使得插拔硬件过后,系统能不受影响地运行。此外,冗余式磁盘阵列(Redundant Array of Independent Disks,RAID)则可提供服务器中存储装置的容错(fault tolerant)功能,使得服务器中存储的数据在部分毁损时得以恢复。In order to replace part of the hardware without stopping the server, the server needs to provide the function of hot pluggable hardware, so that the system can run without being affected after the hardware is plugged and unplugged. In addition, Redundant Array of Independent Disks (RAID) can provide the fault tolerant function of the storage device in the server, so that the data stored in the server can be restored when it is partially damaged.

冗余式磁盘阵列是将多个磁盘通过硬件或软件的控制器组成虚拟的群组,其特色在于:能够自动检测故障硬盘、重建硬盘坏轨的数据、支持不需停机的硬盘备份、支持不需停机的硬盘替换以及扩充硬盘容量等等。冗余式磁盘阵列可依不同的磁盘阵列等级而采取不同的政策来进行磁盘群组的管理。以等级0为例,每笔数据会被分割并分散存储到不同的磁盘。当取得一笔数据时,主机可从不同的磁盘平行读取分割后的数据,因此读取数据的速度会比从单一颗磁盘读取数据的速度加快许多。此外,再以等级1为例,数据会同时存放在不同的磁盘,也就是不同的磁盘将会分别保有相同数据的副本。因此,当其中一颗磁盘损坏时,仍可由其他的磁盘有效地读取到数据。所以,在更换损坏的磁盘后,冗余式磁盘阵列即可利用其他磁盘内的数据进行更换后硬盘的数据的重建。Redundant disk array is a virtual group composed of multiple disks through hardware or software controllers. Replacement of hard disks that need to be shut down and expansion of hard disk capacity, etc. Redundant disk arrays can adopt different policies to manage disk groups according to different disk array levels. Taking level 0 as an example, each data will be divided and stored in different disks. When obtaining a piece of data, the host can read the divided data from different disks in parallel, so the speed of reading data will be much faster than reading data from a single disk. In addition, taking Level 1 as an example, data will be stored on different disks at the same time, that is, different disks will keep copies of the same data. Therefore, when one of the disks is damaged, data can still be effectively read by other disks. Therefore, after the damaged disk is replaced, the redundant disk array can use the data in other disks to reconstruct the data of the replaced hard disk.

在现今的服务器的环境中,以小电脑系统接口(Small Computer SystemInterface,SCSI)与主机做连接的硬盘仍不在少数。然而,小电脑系统接口并没有提供热插拔与数据自动重建的功能。所以,现有是需要利用一额外的控制芯片来对小电脑系统接口下达指令,才能达到磁盘热插拔与数据自动重建的功能,例如利用一GEN318的芯片。然而,采用增加硬件以提供上述功能的方式,生产成本势必得跟着增加。相对地,贩售的价格也会随之上扬,使得产品的竞争力容易受到价格因素而有所削减。In today's server environment, there are not a few hard disks connected to the host computer via Small Computer System Interface (SCSI). However, the small computer system interface does not provide the functions of hot plugging and automatic data reconstruction. Therefore, at present, it is necessary to use an additional control chip to issue commands to the small computer system interface, so as to achieve the functions of disk hot swap and automatic data reconstruction, such as using a GEN318 chip. However, by adding hardware to provide the above-mentioned functions, the production cost must increase accordingly. Correspondingly, the selling price will also rise accordingly, making the competitiveness of the product vulnerable to being reduced by the price factor.

发明内容 Contents of the invention

本发明提供一种硬盘自动重建方法,通过记录硬盘的插拔数据,提供热插拔以及硬盘自动重建的功能,省去购置硬件设备的成本。The invention provides a method for automatically rebuilding a hard disk, which provides functions of hot plugging and automatic rebuilding of the hard disk by recording the insertion and removal data of the hard disk, and saves the cost of purchasing hardware equipment.

本发明提出一种硬盘自动重建方法,适用于采用磁盘阵列的主机,其中磁盘阵列包括多个第一硬盘。各个第一硬盘是通过小电脑系统接口(Small ComputerSystem Interface,SCSI)连接至主机的硬盘插槽。此方法包括下列步骤:首先初始化这些第一硬盘,并记录这些第一硬盘的数据配置信息。接着通过配置于各个硬盘插槽上的针脚(pin),检测是否有硬盘插入这些硬盘插槽或从这些硬盘插槽拔出。当检测到有第二硬盘插入时,根据插拔数据搜寻对应于第二硬盘所插入的硬盘插槽的数据配置信息。然后根据数据配置信息,利用存放在其他第一硬盘的备份数据重建第二硬盘。The invention proposes a method for automatically rebuilding a hard disk, which is suitable for a host using a disk array, wherein the disk array includes a plurality of first hard disks. Each first hard disk is connected to the hard disk slot of the host through a Small Computer System Interface (SCSI). The method includes the following steps: first, initialize the first hard disks, and record the data configuration information of the first hard disks. Then, through the pins (pins) arranged on each hard disk slot, it is detected whether a hard disk is inserted into or pulled out from these hard disk slots. When it is detected that a second hard disk is inserted, the data configuration information corresponding to the hard disk slot into which the second hard disk is inserted is searched according to the insertion and removal data. Then, according to the data configuration information, the second hard disk is rebuilt using the backup data stored in other first hard disks.

在本发明一实施例中,上述检测是否有硬盘插入或拔出硬盘插槽的步骤包括:在有硬盘插入或拔出这些硬盘插槽时,通过配置在硬盘插槽上的一个针脚产生中断信号(interrupt),当接收到中断信号时,即扫描所有硬盘插槽,以找出哪一个硬盘插槽有硬盘插入或拔出。In an embodiment of the present invention, the above-mentioned step of detecting whether a hard disk is inserted into or pulled out of the hard disk slot includes: when a hard disk is inserted into or pulled out of these hard disk slots, an interrupt signal is generated through a pin configured on the hard disk slot (interrupt), when an interrupt signal is received, it scans all hard disk slots to find out which hard disk slot has a hard disk inserted or pulled out.

在本发明一实施例中,上述在检测是否有硬盘插入或拔出硬盘插槽的步骤之后,还可包括当检测到第一硬盘自硬盘插槽拔出时,记录插拔数据。In an embodiment of the present invention, after the above step of detecting whether a hard disk is inserted into or removed from the hard disk slot, it may further include recording insertion and removal data when it is detected that the first hard disk is pulled out from the hard disk slot.

在本发明一实施例中,上述在重建第二硬盘的步骤之前,还包括设定第二硬盘的状态为热备份(hot spare)、清除第二硬盘中所有的数据,以及检查第二硬盘是否有损坏的磁区等步骤。In an embodiment of the present invention, before the step of rebuilding the second hard disk, it also includes setting the state of the second hard disk as hot spare (hot spare), clearing all data in the second hard disk, and checking whether the second hard disk is There are steps such as damaged magnetic sectors.

在本发明一实施例中,上述数据配置信息包括各个第一硬盘所属的磁盘阵列等级与所属的磁盘阵列群组,而插拔数据则包括硬盘插入、拔出的记录以及对应的硬盘插槽编号。In one embodiment of the present invention, the above data configuration information includes the disk array level and the disk array group to which each first hard disk belongs, and the plug-in data includes hard disk insertion and removal records and corresponding hard disk slot numbers .

在本发明一实施例中,上述磁盘阵列可为冗余式磁盘阵列(Redundant Arrayof Independent Disks,RAID),而此冗余式磁盘阵列的等级可包括1,5与10其中之一。此外,上述针脚可为通用输入输出(General Purpose Input/Output,GPIO)针脚。In an embodiment of the present invention, the above disk array may be a redundant array of independent disks (Redundant Array of Independent Disks, RAID), and the level of the redundant array of independent disks may include one of 1, 5 and 10. In addition, the above pins may be general purpose input/output (GPIO) pins.

本发明在各个硬盘插槽上配置一个针脚,通过插拔硬盘时针脚所产生的中断信号而可自动检测硬盘插拔,并记录为插拔数据,此插拔数据则用来判断硬盘是否需要自动重建,当判定需要自动重建时则进行自动重建。更进一步来说,当插拔数据中记录有硬盘自其中一个硬盘插槽拔出后,接着若再有硬盘插入此硬盘插槽的记录,本发明便判断此插入的硬盘是用来替换原来的硬盘,即自动地通过其他硬盘的备份数据来重建数据。另外,本发明因采用成本低廉的针脚即可达到热插拔与数据自动重建的功能,因此不会对整体的生产成本造成负担。The present invention configures a pin on each hard disk slot, and can automatically detect hard disk plugging and unplugging through the interrupt signal generated by the pin when plugging and unplugging the hard disk, and record it as plugging data, and the plugging data is used to judge whether the hard disk needs automatic Rebuild, when it is determined that automatic rebuilding is required, automatic rebuilding will be performed. Furthermore, when the plug-in data records that the hard disk is pulled out from one of the hard disk slots, and then if there is a record that a hard disk is inserted into the hard disk slot, the present invention judges that the inserted hard disk is used to replace the original hard disk. Hard disk, that is, to automatically rebuild data from the backup data of other hard disks. In addition, the present invention can achieve the functions of hot plugging and automatic data reconstruction by using low-cost pins, so the overall production cost will not be burdened.

为让本发明的上述特征和优点能更明显易懂,下文特举多个实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, a number of embodiments are exemplified below and described in detail with accompanying drawings.

附图说明 Description of drawings

图1为本发明第一实施例的硬盘自动重建方法的流程图。FIG. 1 is a flowchart of a method for automatically rebuilding a hard disk according to a first embodiment of the present invention.

图2为本发明第二实施例的硬盘自动重建方法的流程图。FIG. 2 is a flowchart of a method for automatically rebuilding a hard disk according to a second embodiment of the present invention.

具体实施方式 Detailed ways

以下各个实施例的硬盘自动重建方法,适用于采用磁盘阵列的主机。其中,磁盘阵列包括多个第一硬盘,而各个第一硬盘是通过小电脑系统接口连接至主机的硬盘插槽。其中,磁盘阵列例如为冗余式磁盘阵列。此外,为了以较低的成本来达到热插拔与自动重建的功能,以下各个实施例可通过配置于各个硬盘插槽上的针脚来即时地检测硬盘插拔的状况,并在有需要时自动完成硬盘重建的工作。详细的过程请参照以下各实施例的说明。The methods for automatically rebuilding hard disks in the following embodiments are applicable to hosts using disk arrays. Wherein, the disk array includes a plurality of first hard disks, and each first hard disk is connected to the hard disk slot of the host through the small computer system interface. Wherein, the disk array is, for example, a redundant disk array. In addition, in order to achieve hot-swapping and automatic rebuilding functions at a lower cost, the following embodiments can detect the status of hard disk insertion and removal in real time through the pins configured on each hard disk slot, and automatically reset the hard disk when necessary. Complete the HDD reconstruction work. For the detailed process, please refer to the descriptions of the following embodiments.

[第一实施例][first embodiment]

图1为本发明第一实施例的硬盘自动重建方法的流程图。请参照图1,首先,在系统建立初期进行步骤S110,初始化这些第一硬盘,并且对这些第一硬盘的数据配置信息进行记录及保存。由于这些第一硬盘在系统规划时,可依需求而分属不同的磁盘阵列群组。其中,这些不同的磁盘阵列群组可在主机上同时提供不同磁盘阵列等级的服务。FIG. 1 is a flowchart of a method for automatically rebuilding a hard disk according to a first embodiment of the present invention. Please refer to FIG. 1 , first, step S110 is performed at the initial stage of system establishment to initialize the first hard disks, and record and save the data configuration information of the first hard disks. Because these first hard disks can belong to different disk array groups according to requirements during system planning. Wherein, these different disk array groups can simultaneously provide services of different disk array levels on the host.

举例来说,主机当中会有部份群组负责提供等级0的服务,以加快读取的速度,而由另外一部份的群组提供等级1或等级5的容错及备份服务。因此,在初始化这些第一硬盘后,需要将对应各个第一硬盘所属的磁盘阵列等级与所属的磁盘阵列群组的数据配置信息保存下来。在日后有硬盘更换时,数据配置信息可做比对之用,以判断更换的硬盘所应提供的服务,而能快速地恢复原来服务的状态。由于本实施例可提供自动重建硬盘的功能,而重建的前提是在磁盘阵列中需要有备份的数据,所以磁盘阵列的等级可包括1,5与10其中之一,以提供备份的数据来达到容错与重建的功能。For example, some groups in the host are responsible for providing level 0 services to speed up the reading speed, while another part of the groups provide level 1 or level 5 fault tolerance and backup services. Therefore, after initializing the first hard disks, it is necessary to save the data configuration information corresponding to the disk array level and the disk array group to which each first hard disk belongs. When the hard disk is replaced in the future, the data configuration information can be used for comparison to determine the service that the replaced hard disk should provide, and the original service status can be quickly restored. Since this embodiment can provide the function of automatically rebuilding the hard disk, and the premise of rebuilding is that there needs to be backup data in the disk array, so the level of the disk array can include one of 1, 5 and 10 to provide the backup data to achieve Fault tolerance and reconstruction capabilities.

接着,进行步骤S120,通过配置于各个硬盘插槽上的针脚,检测是否有硬盘插入这些硬盘插槽或是有硬盘拔出。一般服务器上的硬盘插槽大多会设置于背板,以方便硬盘的抽换,所以用来检测硬盘插拔的针脚可便利地在配置在背板上,也不用像配置芯片需要复杂的布线工作,所以可避免对生产成本产生冲击。其中,此针脚例如为一通用输入输出针脚。Next, proceed to step S120, and detect whether a hard disk is inserted into the hard disk slot or whether a hard disk is pulled out through the pins arranged on each hard disk slot. Most of the hard disk slots on the server are installed on the backplane to facilitate the replacement of the hard disk, so the pins used to detect the insertion and removal of the hard disk can be conveniently configured on the backplane, and there is no need for complicated wiring work like configuring chips , so the impact on production cost can be avoided. Wherein, the pin is, for example, a general input and output pin.

再来,进行步骤S130,当检测到有第二硬盘插入硬盘插槽时,则根据插拔数据来进行数据配置信息的搜寻,以搜寻出对应此硬盘插槽的数据配置信息。上述插拔数据可包括硬盘插入、拔出的记录以及对应的硬盘插槽编号。详细来说,若在插拔数据中,在第二硬盘插入硬盘插槽之前,有第一硬盘自此硬盘插槽拔出的记录,则可判定此第二硬盘是用来替换拔出的第一硬盘。因此,可通过对应此硬盘插槽的信息来查询数据配置信息,找出从此硬盘插槽拔出的第一硬盘原本所配置的磁盘阵列群组以及对应的磁盘阵列等级。Next, proceed to step S130, when it is detected that a second hard disk is inserted into the hard disk slot, search for the data configuration information according to the insertion and removal data, so as to search for the data configuration information corresponding to the hard disk slot. The above insertion and removal data may include hard disk insertion and removal records and corresponding hard disk slot numbers. Specifically, if there is a record of the first hard disk being pulled out of the hard disk slot before the second hard disk is inserted into the hard disk slot in the data of plugging and unplugging, it can be determined that the second hard disk is used to replace the pulled out first hard disk. a hard drive. Therefore, the data configuration information can be queried through the information corresponding to the hard disk slot, and the disk array group and the corresponding disk array level originally configured by the first hard disk pulled out from the hard disk slot can be found out.

最后,进行步骤S140,在根据前述的数据配置信息取得对应的磁盘阵列群组以及磁盘阵列等级等信息之后,配合对应磁盘阵列等级的备份状态,再利用存放在其他第一硬盘之备份数据重建第二硬盘。举例来说,对应磁盘阵列等级1的硬盘会保存相同的数据复本,因此重建时是将群组内硬盘的数据完整对应地写入第二硬盘,而其他等级则有不同的备份状态。Finally, proceed to step S140, after obtaining information such as the corresponding disk array group and disk array level according to the aforementioned data configuration information, cooperate with the backup status of the corresponding disk array level, and then use the backup data stored in other first hard disks to rebuild the first Two hard drives. For example, the hard disks corresponding to disk array level 1 will save the same data copy, so when rebuilding, the data of the hard disks in the group will be completely written to the second hard disk, while other levels have different backup status.

值得注意的是,在硬盘插拔的过程中,使用者不需手动地下达指令告知操作系统要移除或新增硬盘,而是由本方法自动检测,以提供热插拔的功能。此外,在第一硬盘损坏而以第二硬盘更换时,本方法也可自动地通过其他硬盘的备份数据来重建第二硬盘,使用者也不需手动地进行数据重建的工作。也即是说,本实施例的硬盘自动重建方法仅需增加成本低廉的针脚即可达到热插拔与数据自动重建的功能。It is worth noting that during the process of hard disk insertion and removal, the user does not need to manually issue an instruction to inform the operating system to remove or add a new hard disk, but the method automatically detects it to provide the hot-swap function. In addition, when the first hard disk is damaged and replaced with the second hard disk, the method can also automatically rebuild the second hard disk through the backup data of other hard disks, and the user does not need to manually rebuild the data. That is to say, the hard disk automatic rebuilding method of this embodiment only needs to add low-cost pins to achieve the functions of hot swapping and automatic data rebuilding.

[第二实施例][Second embodiment]

图2为本发明第二实施例的硬盘自动重建方法的流程图。本实施例与第一实施例相似,以下将针对差异处来进行说明,且相似的步骤不再详述。请参照图2,在系统建立初期初始化这些第一硬盘,并且对这些第一硬盘的数据配置信息进行记录及保存(步骤S210)。FIG. 2 is a flowchart of a method for automatically rebuilding a hard disk according to a second embodiment of the present invention. This embodiment is similar to the first embodiment, the differences will be described below, and similar steps will not be described in detail. Referring to FIG. 2 , these first hard disks are initialized at the initial stage of system establishment, and the data configuration information of these first hard disks is recorded and saved (step S210 ).

接着,进行步骤S220,通过配置于各个硬盘插槽上的针脚,检测是否有硬盘插入或拔出硬盘插槽。其中,步骤S220包括S222与S224两个子步骤:步骤S222,在有硬盘插入或拔出硬盘插槽时,通过针脚产生中断信号;步骤S224:当接收到中断信号时,即扫描所有硬盘插槽,以找出哪一个硬盘插槽有硬盘插入或拔出。更详细来说,插拔硬盘的动作将会触发硬盘插槽的针脚产生中断信号给操作系统,而在接收到此中断信号时,则通过驱动程序来驱动小电脑系统接口的控制芯片,以对所有硬盘插槽的总线做扫描。Next, proceed to step S220, and detect whether a hard disk is inserted into or pulled out of the hard disk slot through the pins arranged on each hard disk slot. Wherein, step S220 includes two sub-steps of S222 and S224: step S222, when a hard disk is inserted into or pulled out of the hard disk slot, an interrupt signal is generated through a pin; step S224: when the interrupt signal is received, scan all hard disk slots, to find out which hard disk slot has a hard disk inserted or removed. In more detail, the action of plugging and unplugging the hard disk will trigger the pins of the hard disk slot to generate an interrupt signal to the operating system, and when the interrupt signal is received, the driver will drive the control chip of the small computer system interface to Scan the bus of all hard disk slots.

在操作系统接收到中断信号后,进行步骤S230,当检测到有第一硬盘自硬盘插槽拔出时,将会记录一笔插拔数据。此插拔数据可包括此硬盘拔出的记录以及对应的硬盘插槽编号,以提供日后作比对之用。更进一步来说,在之后有若有一个第二硬盘插入此硬盘插槽时,则由于此硬盘插槽有拔出第一硬盘的记录,此时即可判断此第二硬盘是用来替换此第一硬盘。因此,当检测到有第二硬盘插入时,根据上述的插拔数据搜寻对应于第二硬盘所插入的硬盘插槽的数据配置信息(步骤S240),以判断此第二硬盘是否是用来替换损坏的第一硬盘。After the operating system receives the interrupt signal, it proceeds to step S230. When it detects that the first hard disk is pulled out from the hard disk slot, it will record a piece of plugging and unplugging data. The insertion/removal data may include the record of the hard disk being pulled out and the corresponding hard disk slot number, so as to be used for comparison in the future. Furthermore, if there is a second hard disk inserted into this hard disk slot later, because the hard disk slot has a record of pulling out the first hard disk, it can be judged that the second hard disk is used to replace this hard disk. first hard drive. Therefore, when it is detected that a second hard disk is inserted, the data configuration information corresponding to the hard disk slot into which the second hard disk is inserted is searched according to the above-mentioned insertion and removal data (step S240), to determine whether the second hard disk is used for replacement Damaged first hard drive.

接着,进行步骤S250,设定第二硬盘的状态为热备份。在冗余式磁盘阵列中,热备份状态的硬盘平时不会用来存储数据,而是在有硬盘坏掉时直接取代坏掉的硬盘来存储数据,并将原本的数据重建于此硬盘。当有损坏的第一硬盘拔出,而将所插入的第二硬盘设定为热备份后,冗余式磁盘阵列的控制器便会以此第二硬盘取代原来的第一硬盘,并将原本存储在第一硬盘的数据重建于此第二硬盘。Next, proceed to step S250, setting the state of the second hard disk as hot backup. In a redundant disk array, the hard disk in the hot backup state is not usually used to store data, but directly replaces the broken hard disk to store data when a hard disk fails, and rebuilds the original data on this hard disk. When the damaged first hard disk is pulled out and the inserted second hard disk is set as a hot spare, the controller of the redundant disk array will replace the original first hard disk with the second hard disk, and the original Data stored on the first hard drive is recreated on the second hard drive.

数据重建的步骤S260包括S262~S266三个子步骤:S262:清除第二硬盘中所有的数据,例如对第二硬盘进行格式化的动作;S264:检查第二硬盘是否有损坏的磁区,以避免数据在重建或是日后读取和写入数据的过程中,发生数据读取或写入异常的状况;S266,根据数据配置信息中的记录,将此第二硬盘初始化为所对应的磁盘阵列等级,并配合此磁盘阵列等级所对应的备份状态,使得本实施例可利用存放在其他第一硬盘的备份数据重建第二硬盘,而完成数据自动重建的工作。The step S260 of data reconstruction includes three sub-steps of S262~S266: S262: clear all data in the second hard disk, such as formatting the second hard disk; In the process of rebuilding or reading and writing data in the future, abnormal data reading or writing occurs; S266, according to the record in the data configuration information, initialize the second hard disk to the corresponding disk array level, In combination with the backup status corresponding to the level of the disk array, this embodiment can use the backup data stored in other first hard disks to rebuild the second hard disk, thereby completing the work of automatic data reconstruction.

综上所述,本发明在各个硬盘插槽上配置针脚,通过插拔硬盘时针脚所产生的中断信号而可自动检测硬盘插拔,而提供了热插拔的功能,让使用者无需麻烦地手动下指令去检测硬盘插拔。此外,本发明通过硬盘插拔数据的记录来进行判断硬盘是否需要自动重建,当判定需要自动重建时则进行自动重建。因此,使用者也不需在更换硬盘后,费时地由使用者进行数据重建的工作。更进一步来说,当插拔数据中记录有硬盘自其中一个硬盘插槽拔出后,接着若再有硬盘插入此硬盘插槽的记录,本发明便判断此插入的硬盘是用来替换原来的硬盘,即自动地通过其他硬盘的备份数据来重建数据。另外,本发明因采用成本低廉的针脚即可达到前述热插拔与数据自动重建的功能,因此不会对整体的生产成本造成负担。In summary, the present invention configures pins on each hard disk slot, and can automatically detect hard disk plugging and unplugging through the interrupt signal generated by the pins when plugging and unplugging the hard disk, and provides the function of hot swapping, so that users do not need to bother Manually issue commands to detect hard disk insertion and removal. In addition, the present invention judges whether the hard disk needs to be automatically rebuilt through the recording of the hard disk insertion and removal data, and automatically rebuilds when it is determined that automatic rebuilding is required. Therefore, the user does not need to perform the time-consuming task of data reconstruction by the user after replacing the hard disk. Furthermore, when the plug-in data records that the hard disk is pulled out from one of the hard disk slots, and then if there is a record that a hard disk is inserted into the hard disk slot, the present invention judges that the inserted hard disk is used to replace the original hard disk. Hard disk, that is, to automatically rebuild data from the backup data of other hard disks. In addition, the present invention can achieve the aforementioned functions of hot plugging and automatic data reconstruction by using low-cost pins, so the overall production cost will not be burdened.

虽然本发明已以较佳实施例揭示如上,然其并非用以限定本发明,任何所属技术领域中具有通常知识者,在不脱离本发明的精神和范围内,当可作些许更动与润饰,因此本发明的保护范围当以权利要求所界定的为准。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention, and anyone with ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be defined by the claims.

Claims (11)

1. method for automatically rebuilding hard disk, be applicable to a main frame that adopts a disk array, wherein this disk array comprises a plurality of first hard disks, and each those first hard disk is hard disk slots that are connected to this main frame by a small computer system interface, and this method comprises the following steps:
Those first hard disks of initialization, and write down a data configuration information of those first hard disks;
By be disposed at the stitch on each those hard disk slot, detect whether have hard disk to insert or extract those hard disk slots one of them;
When having detected one second hard disk and inserted, this data configuration information of this hard disk slot that is inserted corresponding to this second hard disk according to a plug data search; And
According to this data configuration information, utilize the Backup Data leave other those first hard disk in to rebuild this second hard disk.
2. whether method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, detect to have hard disk to insert or to extract one of them step of those hard disk slots to comprise:
Have hard disk to insert or extract those hard disk slots one of them the time, produce a look-at-me by this stitch; And
When receiving this look-at-me, promptly scan all hard disk slots, there is hard disk to insert or extracts to find out which hard disk slot.
3. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, detect whether have hard disk to insert or extract one of them step of those hard disk slots after, also comprise:
When detect those first hard disks one of them when the hard disk slot is extracted, write down this plug data.
4. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, before the step of rebuilding this second hard disk, also comprises:
The state of setting this second hard disk is a Hot Spare.
5. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, the step of rebuilding this second hard disk comprises:
Remove all data in this second hard disk.
6. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, the step of rebuilding this second hard disk comprises:
Check whether this second hard disk has the magnetic region of damage.
7. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, this data configuration information comprises disk array grade under each those first hard disk and affiliated disk array group.
8. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, these plug data comprise record and the corresponding hard disk slot numbering that hard disk inserts, extracts.
9. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, this disk array is a redundance type magnetic disc array.
10. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, the grade of this redundance type magnetic disc array comprise 1,5 and 10 one of them.
11. method for automatically rebuilding hard disk as claimed in claim 1 is characterized in that, this stitch is a general input and output stitch.
CNA2007100968671A 2007-04-05 2007-04-05 Automatic hard disk reconstruction method Pending CN101281452A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007100968671A CN101281452A (en) 2007-04-05 2007-04-05 Automatic hard disk reconstruction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007100968671A CN101281452A (en) 2007-04-05 2007-04-05 Automatic hard disk reconstruction method

Publications (1)

Publication Number Publication Date
CN101281452A true CN101281452A (en) 2008-10-08

Family

ID=40013944

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007100968671A Pending CN101281452A (en) 2007-04-05 2007-04-05 Automatic hard disk reconstruction method

Country Status (1)

Country Link
CN (1) CN101281452A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135932A (en) * 2011-03-08 2011-07-27 浪潮(北京)电子信息产业有限公司 Monitoring system and monitoring method thereof
CN102326141A (en) * 2011-08-08 2012-01-18 华为技术有限公司 Processing method and apparatus for raid configuration information and raid controller
CN101655812B (en) * 2009-09-15 2012-07-18 中兴通讯股份有限公司 Self-adaptive data backup system and method thereof
CN103189834A (en) * 2012-07-16 2013-07-03 华为技术有限公司 Method, apparatus and system for determining drive
CN105095030A (en) * 2014-05-22 2015-11-25 中兴通讯股份有限公司 Hard disk damage processing method and device based on Hadoop
CN105138280A (en) * 2015-07-31 2015-12-09 成都华为技术有限公司 Data write-in method, apparatus and system
CN103019619B (en) * 2012-11-28 2016-06-08 浙江宇视科技有限公司 A kind of disk plug control method and device
CN107066351A (en) * 2017-02-28 2017-08-18 郑州云海信息技术有限公司 A kind of data of magnetic disk array backup method and device
CN110058965A (en) * 2018-01-18 2019-07-26 伊姆西Ip控股有限责任公司 Data re-establishing method and equipment in storage system
CN111857573A (en) * 2020-06-24 2020-10-30 苏州浪潮智能科技有限公司 A kind of intelligent replacement method and system based on RAID faulty member disk
CN114185721A (en) * 2022-02-17 2022-03-15 浪潮(山东)计算机科技有限公司 Thermal storage backup system and method for server

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655812B (en) * 2009-09-15 2012-07-18 中兴通讯股份有限公司 Self-adaptive data backup system and method thereof
CN102135932A (en) * 2011-03-08 2011-07-27 浪潮(北京)电子信息产业有限公司 Monitoring system and monitoring method thereof
CN102326141A (en) * 2011-08-08 2012-01-18 华为技术有限公司 Processing method and apparatus for raid configuration information and raid controller
WO2012119375A1 (en) * 2011-08-08 2012-09-13 华为技术有限公司 Method and device for processing raid configuration information, and raid controller
CN103189834A (en) * 2012-07-16 2013-07-03 华为技术有限公司 Method, apparatus and system for determining drive
WO2014012203A1 (en) * 2012-07-16 2014-01-23 华为技术有限公司 Method, device and system for determining drive letter
CN103189834B (en) * 2012-07-16 2015-07-08 华为技术有限公司 Method, apparatus and system for determining drive mark
CN103019619B (en) * 2012-11-28 2016-06-08 浙江宇视科技有限公司 A kind of disk plug control method and device
WO2015176455A1 (en) * 2014-05-22 2015-11-26 中兴通讯股份有限公司 Hadoop-based hard disk damage handling method and device
CN105095030A (en) * 2014-05-22 2015-11-25 中兴通讯股份有限公司 Hard disk damage processing method and device based on Hadoop
CN105095030B (en) * 2014-05-22 2019-05-28 中兴通讯股份有限公司 Hard disk corruptions processing method and processing device based on Hadoop
CN105138280A (en) * 2015-07-31 2015-12-09 成都华为技术有限公司 Data write-in method, apparatus and system
CN105138280B (en) * 2015-07-31 2018-10-19 成都华为技术有限公司 Method for writing data, apparatus and system
CN107066351A (en) * 2017-02-28 2017-08-18 郑州云海信息技术有限公司 A kind of data of magnetic disk array backup method and device
CN110058965A (en) * 2018-01-18 2019-07-26 伊姆西Ip控股有限责任公司 Data re-establishing method and equipment in storage system
CN111857573A (en) * 2020-06-24 2020-10-30 苏州浪潮智能科技有限公司 A kind of intelligent replacement method and system based on RAID faulty member disk
CN114185721A (en) * 2022-02-17 2022-03-15 浪潮(山东)计算机科技有限公司 Thermal storage backup system and method for server

Similar Documents

Publication Publication Date Title
CN101281452A (en) Automatic hard disk reconstruction method
US8423818B2 (en) Disk array apparatus and method for controlling the same
JPWO2006123416A1 (en) Disk failure recovery method and disk array device
US6892276B2 (en) Increased data availability in raid arrays using smart drives
US20050251628A1 (en) Method, system, and program for demoting tracks from cache
US20090271659A1 (en) Raid rebuild using file system and block list
US9529674B2 (en) Storage device management of unrecoverable logical block addresses for RAID data regeneration
WO2017190578A1 (en) Hard disk data wiping method, server and system
JP2001337792A (en) Disk array device
US8886993B2 (en) Storage device replacement method, and storage sub-system adopting storage device replacement method
JP2009205316A (en) Disk array device, disk array control method and disk array controller
US8037332B2 (en) Quad-state power-saving virtual storage controller
CN110069436A (en) Hot plug control circuit and associated storage servers system
US7293138B1 (en) Method and apparatus for raid on memory
US8055843B2 (en) Method for configuring RAID
US7653831B2 (en) Storage system and data guarantee method
CN106933707B (en) Data recovery method and system of data storage device based on raid technology
US20190354433A1 (en) Parity log with by-pass
CN102147714B (en) A kind of management method of network store system and device
CN105700976A (en) Detection method and apparatus for exception processing mechanism of diskette array system
CN205563583U (en) System for hard disk data are destroyed in batches, bad way is kept apart and validation data remains
CN112784101B (en) Video data storage method and device and data storage equipment
CN100492306C (en) Data recovery method and system for Redundant Array of Independent Disks (RAID) in damage
JP6957845B2 (en) Storage control device and storage device
CN101739308A (en) Method for generating mapping file and storage system thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20081008