CN107402720A - A kind of processing method of hard disk, device and terminal - Google Patents

A kind of processing method of hard disk, device and terminal Download PDF

Info

Publication number
CN107402720A
CN107402720A CN201710522438.XA CN201710522438A CN107402720A CN 107402720 A CN107402720 A CN 107402720A CN 201710522438 A CN201710522438 A CN 201710522438A CN 107402720 A CN107402720 A CN 107402720A
Authority
CN
China
Prior art keywords
hard disk
identifier
backboard
establishing
product data
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.)
Granted
Application number
CN201710522438.XA
Other languages
Chinese (zh)
Other versions
CN107402720B (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710522438.XA priority Critical patent/CN107402720B/en
Publication of CN107402720A publication Critical patent/CN107402720A/en
Application granted granted Critical
Publication of CN107402720B publication Critical patent/CN107402720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides a kind of processing method of hard disk, device and terminal, and by obtaining the identification information for all hard disks that each backboard is connected in storage system, the identification information comprises at least backboard mark and hard disk mark;Establish the corresponding relation of the backboard mark and hard disk mark;According to the corresponding relation, the corresponding all hard disks mark of each backboard mark is extracted respectively, establishes the hard disk set corresponding to every piece of backboard;The hard disk set is handled respectively.The embodiment of the present invention is by way of retrieving and matching, establish the corresponding relation of hard disk mark and backboard mark, and and then establish hard disk set corresponding to every piece of backboard, so as to which corresponding hard disk set is handled, the accurate configuration of all hard disks has been effectively ensured, especially in the case of a large amount of hard disks, hard disk set can prevent hard disk from omitting, and improve the processing quality of hard disk.

Description

Hard disk processing method and device and terminal
Technical Field
The present invention relates to the field of computer storage technologies, and in particular, to a method and an apparatus for processing a hard disk, and a terminal.
Background
Storage systems typically include a large number of hard disks. Since the hard disk bears a large amount of user data and is an important component of the storage system, the key for ensuring the normal operation of the storage system when the hard disk is tested is provided.
At present, before a hard disk test is performed, configuration processing such as formatting and the like needs to be performed on a hard disk. However, through research, the inventor finds that the number of hard disks in a storage system is large, and particularly for a storage array, tens of or even hundreds of hard disks may be included, which easily causes omission and poor hard disk processing quality during the configuration processing of the hard disks, thereby affecting the accuracy of the test of the whole storage system.
Therefore, how to improve the processing quality of the hard disk is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method, an apparatus and a terminal for processing a hard disk, which are used to solve the problem of poor quality of hard disk processing in the prior art.
To achieve the above and other related objects, according to a first aspect of the present invention, an embodiment of the present invention provides a method for processing a hard disk, including:
acquiring identification information of all hard disks connected to each backboard in a storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
establishing a corresponding relation between the backboard identifier and the hard disk identifier;
according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established;
and respectively processing the hard disk sets.
Optionally, the establishing a corresponding relationship between the backplane identifier and the hard disk identifier includes:
when the identification information comprises important product data and a serial number, establishing a first mapping between the hard disk identification and the serial number;
establishing a second mapping of the backplane identifier and the important product data;
and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
Optionally, before establishing the second mapping between the backplane identifier and the important product data, the method further includes:
verifying the important product data;
establishing a second mapping between the backboard identifier and the important product data comprises establishing a second mapping between the important product data which is verified successfully and the backboard identifier;
the establishing of the corresponding relationship between the backplane identifier and the hard disk identifier according to the third mapping of the important product data and the serial number includes establishing the corresponding relationship between the backplane identifier corresponding to the important product data successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping.
Optionally, the respectively processing the hard disk sets includes:
determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as first parameters;
establishing RAID for the hard disk set according to the first parameter;
or,
determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of a hard disk set to be processed as second parameters;
and establishing RAID for the hard disk set according to the second parameter.
According to a second aspect of the present invention, an embodiment of the present invention further provides a processing apparatus for a hard disk, where the apparatus includes:
the acquisition module is used for acquiring identification information of all hard disks connected to each backboard in the storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
the mapping module is used for establishing the corresponding relation between the backboard identifier and the hard disk identifier;
the set module is used for respectively extracting all hard disk identifications corresponding to each backboard identification according to the corresponding relation and establishing a hard disk set corresponding to each backboard;
and the processing module is used for respectively processing the hard disk sets.
Optionally, the mapping module is configured to,
when the identification information comprises important product data and a serial number, establishing a first mapping between the hard disk identification and the serial number;
establishing a second mapping of the backplane identifier and the important product data;
and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
Optionally, the mapping module is configured to,
verifying the important product data;
establishing a second mapping between the important product data which is successfully verified and the backboard identifier;
and establishing a corresponding relation between the backboard identifier corresponding to the important product data successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping.
Optionally, the processing module is configured to,
determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as first parameters;
establishing RAID for the hard disk set according to the first parameter;
or,
determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of a hard disk set to be processed as second parameters;
and establishing RAID for the hard disk set according to the second parameter.
According to a third aspect of the present invention, an embodiment of the present invention further provides a processing terminal for a hard disk, where the processing terminal includes the processing apparatus described in the foregoing embodiment.
According to a fourth aspect of the present invention, an embodiment of the present invention further provides a processing terminal for a hard disk, where the processing terminal includes at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the one processor to cause the at least one processor to:
acquiring identification information of all hard disks connected to each backboard in a storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
establishing a corresponding relation between the backboard identifier and the hard disk identifier;
according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established;
and respectively processing the hard disk sets.
As described above, the method, the device and the terminal for processing a hard disk provided in the embodiments of the present invention have the following beneficial effects: acquiring identification information of all hard disks connected to each backboard in a storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications; establishing a corresponding relation between the backboard identifier and the hard disk identifier; according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established; and respectively processing the hard disk sets. According to the embodiment of the invention, the corresponding relation between the hard disk identification and the backboard identification is established in a retrieval and matching mode, and the hard disk set corresponding to each backboard is further established, so that the corresponding hard disk set is processed, the accurate configuration of all hard disks is effectively ensured, especially under the condition of a large number of hard disks, the hard disk set can prevent the omission of the hard disks, and the processing quality of the hard disks is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a hard disk processing method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for establishing a correspondence relationship according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another method for establishing a correspondence relationship according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a verification method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for establishing a hard disk RAID according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of another method for establishing a hard disk RAID according to the present invention;
fig. 7 is a schematic structural diagram of a processing apparatus for a hard disk according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a hard disk processing terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Please refer to fig. 1 to 8. It should be noted that the drawings provided in the present embodiment are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than being drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In order to clearly and accurately describe the processing method of the hard disk according to the embodiment of the present invention, first, the architecture of the storage system is described: in a general storage system architecture, a plurality of hard disk backplanes are generally included, and a plurality of hard disk drive slots are provided on each hard disk backplane; the hard disks can be inserted into the hard disk back plate through the hard disk drive grooves, and therefore each hard disk back plate can be connected with a plurality of hard disks to form a hard disk array. The controller in the storage system can access the hard disk array through the hard disk backboard. Of course, it should be noted that the architecture of the storage system is only an exemplary embodiment, and other architectural ways may exist in the storage system when the storage system is implemented.
Fig. 1 is a schematic flow chart of a hard disk processing method according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S101: and acquiring identification information of all hard disks connected to each backboard in the storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications.
In a specific implementation, identification information may be obtained by using a RAID (Redundant array of independent Disks) card management tool, where the identification information may include a backplane identifier of each backplane and all hard disk identifiers of hard Disks connected to each backplane. In an exemplary embodiment, the RAID card management tool may be "sas 3 ircu", "sas 2 ircu", and the like, and is not limited in the embodiment of the present invention. By calling the RAID card management tool, the back plate identification of each back plate, the hard disk drive slot information on each back plate and the important Product Data (English: virtual Product Data, abbreviated as VPD) of each hard disk can be obtained; the backplane identifier may be an "Enclosure #" number, which is used to identify each backplane differently, for example, the backplane identifier may be "2", etc., which represents a second backplane; the information of the hard disk drive Slot can be a Slot # number and is used for identifying the drive Slot to which the hard disk is inserted, and the information of the hard disk drive Slot flowing into can be 0 and the like, and identifying a first drive Slot and an identifier; the important product data, which typically has a fixed length, is used to identify the hard disk hardware, for example, the important product data may be "2 PD9 HKST", which has 8 characters, and also has a length of 8.
The hard disk identifier may identify different hard disks differently, and in specific implementation, the hard disk identifier may be a name of a hard disk, such as "sda", "sdb", or the like. In an embodiment, in order to obtain the hard disk identifier, all hard disk identifiers may be obtained by using an "lsscsi" command and a search keyword "disk", and of course, in a specific implementation, the obtaining manner of the hard disk identifier is only an exemplary embodiment, and the hard disk identifier may also be obtained by any other manner, which is not described in detail in the embodiment of the present invention.
In addition, the identification information may further include a serial number of the hard disk. In an exemplary embodiment, the Serial Number of the hard disk, which may be, for example, "8 JM3 UVAZ", may be obtained by calling a "smartctl" command and retrieving the key "Serial Number". Of course, in the embodiment of the present invention, the serial number of the hard disk may also be obtained in any other manner, which is not described herein again. Usually, the serial number of the hard disk and the important product data of the hard disk have a mapping relation; in the first implementation case, the serial number of the hard disk may be different from the important product data, but the serial number of the hard disk corresponds to the important product data one by one, that is, the corresponding important product data can be determined by the serial number of the hard disk, or the corresponding serial number can also be determined by the important product data of the hard disk; in a second implementation, the serial number of the hard disk may be the same as the important product data, e.g., both the serial number and the important product data are "2 PD9 HKST" or the like.
Step S102: and establishing a corresponding relation between the backboard identifier and the hard disk identifier.
And establishing a corresponding relation between the backboard identifier and the hard disk identifier, so that the hard disk information connected to each backboard can be determined through the corresponding relation.
Fig. 2 is a schematic flow chart of a method for establishing a correspondence relationship according to the embodiment of the present invention. As shown in fig. 2, the method comprises the steps of:
step S1021: when the identification information includes important product data and a serial number, a first mapping of hard disk identification and serial number is established.
Referring to the description of step S101 above, when the identification information includes important product data and a serial number, a first mapping of the hard disk identification and the serial number is first established.
After all hard disk identifications are obtained, according to the hard disk identifications, the smartcll-a hard disk identifications are respectively called, the serial number corresponding to each hard disk identification can be obtained, and therefore a first mapping between the hard disk identifications and the serial numbers is established. In this way, the corresponding serial number can be determined by the hard disk identifier, or the corresponding hard disk identifier can be determined by the serial number.
Step S1022: a second mapping of the backplane identification to the vital product data is established.
Through the backboard identification and the important product data obtained in the step S101, a backboard identification table arranged in sequence and an important product data table arranged in sequence can be obtained through keyword extraction; in an exemplary embodiment, the backplane identifier table may be arranged in rows, each row including a backplane identifier, the important product data table also includes rows, each row including an important product data; the back plate identification table and the important product data table are in one-to-one correspondence, so that the back plate identification of the first row corresponds to the important product data of the first row, the back plate identification of the second row corresponds to the important product data of the second row, and finally, a second mapping between the back plate identification and the important product data can be obtained.
Step S1023: and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
Also referring to the description of step S101, since the important product data and the serial number themselves have a mapping relationship, i.e. a third mapping, through the third mapping, the corresponding relationship between the backplane identifier and the hard disk identifier can be established. In an exemplary embodiment, the corresponding hard disk identifier can be determined through the serial number, the corresponding backplane identifier can be determined through the important product data, and further, the corresponding relationship between the hard disk identifier and the backplane identifier can be established through the mapping relationship between the serial number and the important product data. For example, the serial number corresponding to the hard disk identifier "sda" is determined to be "2 PD9 HKST" through the first mapping obtained in step S1021, and the important product data corresponding to the backplane identifier "2" is determined to be "2 PD9 HKST" through the second mapping obtained in step S1022, so that the hard disk identifier "sda" can be determined to correspond to the backplane identifier "2" through the third mapping of the serial number and the important product data.
In order to eliminate a hard disk with a firmware problem and ensure the test accuracy of the storage system, reference is made to fig. 3, which is a schematic flow chart of another method for establishing a correspondence relationship according to an embodiment of the present invention. As shown in fig. 3, on the basis of the method shown in fig. 3, the embodiment of the present invention shows a process of verifying a hard disk:
step S201: when the identification information includes important product data and a serial number, a first mapping of the hard disk identification and the serial number is established.
Step S202: and verifying the important product data.
Fig. 4 is a schematic flow chart of a verification method according to an embodiment of the present invention. As shown in fig. 4, the method comprises the steps of:
step S2021: and calculating the data length of the important product data.
The data length of the vital product data is calculated, and in an exemplary embodiment, the data length of the vital product data "2 PD9 HKST" is 8. In specific implementation, the data length of the important product data can be obtained by calling an "echo" command and the like, which is not described in detail in the embodiment of the present invention.
Step S2022: and when the data length is not equal to the verification length, determining that the important product data fails to verify.
The check length may be a preset length, for example, the check length may be set to 8. When the data length obtained in step S2021 is 9 and the data length is not equal to the verification length 8, it is determined that the verification of the important product data fails.
Step S2023: and when the data length is equal to the verification length, determining that the important product data is verified successfully.
When the data length is 8, which is equal to the verification length in step S2022, it may be determined that the verification of the important product data is successful.
Step S203: and establishing a second mapping of the backboard identification and the important product data successfully verified.
For the important product data which is successfully verified, establishing a second mapping between the important product data and the corresponding backboard identifier; in specific implementation, according to the description of step S1022, the important product data failing to be verified and the corresponding backplane identifier may be deleted from the second mapping established in the foregoing manner, so as to obtain an updated second mapping, where the updated second mapping includes the important product data successfully verified and the corresponding backplane identifier.
Step S204: and establishing a corresponding relation between the backboard identifier corresponding to the important product data which is successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping of the important product data and the serial number.
The corresponding backboard identification can be determined according to the second mapping through the successfully verified important product data; according to the third mapping, the corresponding serial number can also be determined through the successfully verified important product data, and further, according to the first mapping, the hard disk identification corresponding to the corresponding serial number can be determined, so that the corresponding relation between the successfully verified important product data and the hard disk identification is established.
In the embodiment of the invention, the hard disks are verified according to the length of the important product data, and because the calculated amount of the length is small, under the condition that a large number of hard disks exist, the verification speed can be effectively improved, the hard disks with firmware problems can be quickly eliminated, the screened hard disks are processed, the processing efficiency is improved, and the test precision is further ensured. The embodiments of the present invention are similar to the above embodiments, and reference may be made to the description of the above embodiments, which are not repeated herein.
Step S103: and according to the corresponding relation, respectively extracting all hard disk identifications corresponding to each backboard identification, and establishing a hard disk set corresponding to each backboard.
Through the corresponding relationship established in step S102, all hard disk identifiers corresponding to each backplane identifier can be extracted, so that a corresponding hard disk set is established for each backplane. In an exemplary embodiment, the hard disk identifiers "sdb", "scdc", "sdg" and "sdh" corresponding to the backplane identifier "2" indicate that 4 hard disks represented by "sdb", "scdc", "sdg" and "sdh" are plugged into the backplane having the backplane identifier "2", and further, the hard disk sets { "sdb", "scdc", "sdg" and "sdh" may be established corresponding to the backplane identifier "2".
Step S104: and respectively processing the hard disk sets.
And respectively processing each hard disk set, thereby establishing a corresponding RAID corresponding to the hard disk set of each hard disk backboard. In particular implementations, different types of disk arrays such as RAID0, RAID1, RAID2, and the like may be established. In the embodiment of the invention, a disk array is selected to be established for the hard disk set in a RAID5 mode.
In a first implementation situation, referring to fig. 5, a flowchart of a method for establishing a hard disk RAID according to an embodiment of the present invention is shown. As shown in fig. 5, the method comprises the steps of:
step S1041: determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as a first parameter.
According to the hard disk set determined in step S103, the backplane of the hard disk set is identified as "2", the number of hard disks is 4, and the hard disks are identified as "sdb", "scdc", "sdg", and "sdh", so that the above information is organized into the first parameter. In an exemplary embodiment, the first parameter may be organized in the form of "/dev/md $ enc-l 5-n $ num/dev/{ sdb, scdc, sdg, sdh }", where enc is a variable representing the retrieved backplane identifier 2, num is also a variable representing the retrieved number of hard disks 4, and where-l 5 identifies the establishment of RAID 5.
Step S1042: and establishing RAID for the hard disk set according to the first parameter.
And according to the first parameter determined in the step S1041, establishing a disk array for the hard disk set in a RAID5 manner. In specific implementation, the establishment of the disk array may use an "mdadm" tool, which is not described in detail in this embodiment of the present invention.
In a second implementation case, the hot spare disk may be customized in the process of establishing the disk array, and refer to fig. 6, which is a flowchart illustrating another method for establishing a hard disk RAID according to the implementation of the present invention. As shown in fig. 6, the method comprises the steps of:
step S1043: and determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of the hard disk set to be processed as second parameters.
Also, according to the hard disk set determined in step S103, in an exemplary embodiment, the backplane identifier may be "2", the number of hot spare hard disks may be set to 1, the number of active hard disks may be set to 3, the sum of the number of hot spare hard disks and the number of active hard disks is equal to the total number of hard disks in the hard disk set, and the hard disks are identified as "sdb", "scdc", "sdg", and "sdh". Thus, the second parameter may be organized in the form of "/dev/md $ enc-l 5-raid-devices = $ { raid _ num } -spare-devices = 1/dev/{" sdb "," scdc "," sdg ", and" sdh "}, where raid _ num is the number of active hard disks, and spare-devices are used to set the number of spare hard disks, and the number is equal to 1.
Step S1044: establishing RAID for the hard disk set according to the second parameter; and the sum of the number of the active hard disks and the number of the hot standby hard disks is equal to the total number of the hard disks in the hard disk set.
As can be seen from the description of the foregoing embodiment, in the hard disk processing method provided in the embodiment of the present invention, identification information of all hard disks connected to each backplane in a storage system is obtained, where the identification information at least includes a backplane identifier and a hard disk identifier; establishing a corresponding relation between the backboard identifier and the hard disk identifier; according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established; and respectively processing the hard disk sets. According to the embodiment of the invention, the corresponding relation between the hard disk identification and the backboard identification is established in a retrieval and matching mode, and the hard disk set corresponding to each backboard is further established, so that the corresponding hard disk set is processed, the accurate configuration of all hard disks is effectively ensured, especially under the condition of a large number of hard disks, the hard disk set can prevent the omission of the hard disks, and the processing quality of the hard disks is improved.
Through the above description of the method embodiments, those skilled in the art can clearly understand that the present invention can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as Read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and so on.
Corresponding to the embodiment of the processing method of the hard disk provided by the invention, the invention also provides a processing device of the hard disk.
Fig. 7 is a schematic structural diagram of a processing apparatus for a hard disk according to an embodiment of the present invention. As shown in fig. 7, the apparatus includes:
the acquisition module 11 is configured to acquire identification information of all hard disks connected to each backplane in the storage system, where the identification information at least includes backplane identifiers and hard disk identifiers;
the mapping module 12 is configured to establish a corresponding relationship between the backplane identifier and the hard disk identifier;
the set module 13 is configured to extract all hard disk identifiers corresponding to each backplane identifier according to the corresponding relationship, and establish a hard disk set corresponding to each backplane;
and the processing module 14 is configured to process the hard disk sets respectively.
In order to effectively establish the correspondence between the hard disk identifier and the serial number, in an exemplary embodiment, the mapping module 12 is configured to,
when the identification information comprises important product data and a serial number, establishing a first mapping between the hard disk identification and the serial number;
establishing a second mapping of the backplane identifier and the important product data;
and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
In order to eliminate hard disks with problems in the firmware itself, and improve the processing quality and efficiency of the hard disks, the mapping module 12 may also be used to,
verifying the important product data;
establishing a second mapping between the important product data which is successfully verified and the backboard identifier;
and establishing a corresponding relation between the backboard identifier corresponding to the important product data successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping.
In order to implement the verification of the hard disk, in the embodiment of the present invention, the mapping module 12 may also be configured to,
calculating to obtain the data length of the important product data;
when the data length is not equal to the verification length, determining that the important product data fails to be verified; or,
and when the data length is equal to the verification length, determining that the important product data is verified successfully.
In the first implementation case, the processing module 14 is also configured to,
determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as first parameters;
and establishing RAID for the hard disk set according to the first parameter.
In a second implementation case, the processing module 14 is also configured to,
determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of a hard disk set to be processed as second parameters;
establishing RAID for the hard disk set according to the second parameter;
and the sum of the number of the active hard disks and the number of the hot standby hard disks is equal to the total number of the hard disks in the hard disk set.
Each module in the hard disk processing apparatus provided in the embodiment of the present invention may be respectively configured to execute corresponding steps in the foregoing hard disk processing method embodiment, and reference may be made to the description of the foregoing method embodiment for the same points in the embodiment of the present invention as in the foregoing method embodiment, and details are not repeated here.
An embodiment of the present invention further provides a hard disk processing terminal, and referring to fig. 8, the hard disk processing terminal is a schematic structural diagram according to the embodiment of the present invention. As shown in fig. 8, the terminal includes:
one or more processors 810 and a memory 820, with one processor 810 being an example in FIG. 8.
The apparatus for performing the processing method of the hard disk may further include: an input device 830 and an output device 840.
The processor 810, the memory 820, the input device 830, and the output device 840 may be connected by a bus or other means, such as the bus connection in fig. 8.
The memory 820 is a non-volatile computer-readable storage medium and can be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the processing method of the hard disk in the embodiment of the present application (for example, the obtaining module 11, the mapping module 12, the collecting module 13, and the processing module 14 shown in fig. 7). The processor 810 executes various functional applications of the server and data processing, i.e., a processing method of the hard disk of the above-described method embodiment, by executing the nonvolatile software program, instructions, and modules stored in the memory 820.
The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of a processing device of the hard disk, and the like. Further, the memory 820 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 820 optionally includes memory located remotely from processor 810, which may be connected to the processing device of the column hard disk via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the processing device of the hard disk. The output device 840 may include a display device such as a display screen.
The one or more modules are stored in the memory 820, and when executed by the one or more processors 810, perform the processing method of the hard disk in any of the above-described method embodiments.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
The terminal of the embodiments of the present invention exists in various forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include PDA, MID, and UMPC devices, such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic devices with data interaction functions.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for apparatus or system embodiments, since they are substantially similar to method embodiments, they are described in relative terms, as long as they are described in partial descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A processing method of a hard disk is characterized by comprising the following steps:
acquiring identification information of all hard disks connected to each backboard in a storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
establishing a corresponding relation between the backboard identifier and the hard disk identifier;
according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established;
and respectively processing the hard disk sets.
2. The method for processing the hard disk according to claim 1, wherein the establishing the corresponding relationship between the backplane identifier and the hard disk identifier comprises:
when the identification information comprises important product data and a serial number, establishing a first mapping between the hard disk identification and the serial number;
establishing a second mapping of the backplane identifier and the important product data;
and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
3. The method for processing the hard disk according to claim 2, before establishing the second mapping between the backplane identifier and the important product data, further comprising:
verifying the important product data;
establishing a second mapping between the backboard identifier and the important product data comprises establishing a second mapping between the important product data which is verified successfully and the backboard identifier;
the establishing of the corresponding relationship between the backplane identifier and the hard disk identifier according to the third mapping of the important product data and the serial number includes establishing the corresponding relationship between the backplane identifier corresponding to the important product data successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping.
4. The hard disk processing method according to claim 3, wherein the verifying the important product data comprises:
calculating to obtain the data length of the important product data;
when the data length is not equal to the verification length, determining that the important product data fails to be verified; or,
and when the data length is equal to the verification length, determining that the important product data is verified successfully.
5. The method for processing the hard disk of claim 1, wherein the separately processing the hard disk sets comprises:
determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as first parameters;
establishing RAID for the hard disk set according to the first parameter;
or,
determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of a hard disk set to be processed as second parameters;
establishing RAID for the hard disk set according to the second parameter;
and the sum of the number of the active hard disks and the number of the hot standby hard disks is equal to the total number of the hard disks in the hard disk set.
6. A processing apparatus of a hard disk, comprising:
the acquisition module is used for acquiring identification information of all hard disks connected to each backboard in the storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
the mapping module is used for establishing the corresponding relation between the backboard identifier and the hard disk identifier;
the set module is used for respectively extracting all hard disk identifications corresponding to each backboard identification according to the corresponding relation and establishing a hard disk set corresponding to each backboard;
and the processing module is used for respectively processing the hard disk sets.
7. The hard disk processing device of claim 6, wherein the mapping module is configured to,
when the identification information comprises important product data and a serial number, establishing a first mapping between the hard disk identification and the serial number;
establishing a second mapping of the backplane identifier and the important product data;
and establishing a corresponding relation between the backboard identifier and the hard disk identifier according to the third mapping of the important product data and the serial number.
8. The hard disk processing device of claim 6, wherein the mapping module is configured to,
verifying the important product data;
establishing a second mapping between the important product data which is successfully verified and the backboard identifier;
and establishing a corresponding relation between the backboard identifier corresponding to the important product data successfully verified and the hard disk identifier corresponding to the corresponding serial number according to the third mapping.
9. The hard disk processing device of claim 6, wherein the processing module is configured to,
determining a backboard identifier, the number of hard disks and a hard disk identifier of a hard disk set to be processed as first parameters;
establishing RAID for the hard disk set according to the first parameter;
or,
determining a backboard identifier, the number of active hard disks, the number of hot standby hard disks and a hard disk identifier of a hard disk set to be processed as second parameters;
establishing RAID for the hard disk set according to the second parameter;
and the sum of the number of the active hard disks and the number of the hot standby hard disks is equal to the total number of the hard disks in the hard disk set.
10. A processing terminal of a hard disk is characterized in that the processing terminal comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the one processor to cause the at least one processor to:
acquiring identification information of all hard disks connected to each backboard in a storage system, wherein the identification information at least comprises backboard identifications and hard disk identifications;
establishing a corresponding relation between the backboard identifier and the hard disk identifier;
according to the corresponding relation, all hard disk identifications corresponding to each backboard identification are respectively extracted, and a hard disk set corresponding to each backboard is established;
and respectively processing the hard disk sets.
CN201710522438.XA 2017-06-30 2017-06-30 Hard disk processing method and device and terminal Active CN107402720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710522438.XA CN107402720B (en) 2017-06-30 2017-06-30 Hard disk processing method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710522438.XA CN107402720B (en) 2017-06-30 2017-06-30 Hard disk processing method and device and terminal

Publications (2)

Publication Number Publication Date
CN107402720A true CN107402720A (en) 2017-11-28
CN107402720B CN107402720B (en) 2020-06-16

Family

ID=60404563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710522438.XA Active CN107402720B (en) 2017-06-30 2017-06-30 Hard disk processing method and device and terminal

Country Status (1)

Country Link
CN (1) CN107402720B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542708A (en) * 2018-12-04 2019-03-29 浪潮电子信息产业股份有限公司 Method for recording corresponding relation between physical slot position of back plate and system drive letter
CN109582238A (en) * 2018-12-03 2019-04-05 郑州云海信息技术有限公司 A kind of hard disk binding, matching process, system and electronic equipment and storage medium
CN110704334A (en) * 2019-09-25 2020-01-17 苏州浪潮智能科技有限公司 Method, system and equipment for important product data management
CN115102843A (en) * 2022-05-26 2022-09-23 苏州浪潮智能科技有限公司 Server serial number obtaining method and device and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6178520B1 (en) * 1997-07-31 2001-01-23 Lsi Logic Corporation Software recognition of drive removal or insertion in a storage system
US20090172234A1 (en) * 2007-12-28 2009-07-02 Inventec Corporation Apparatus and method for identifying system style
CN104503701A (en) * 2014-12-01 2015-04-08 北京同有飞骥科技股份有限公司 Magnetic disk naming method and device suitable for multi-stage expansion cabinet
CN105242875A (en) * 2015-09-17 2016-01-13 浪潮集团有限公司 Server raid batch configuration method
CN106875980A (en) * 2017-02-17 2017-06-20 紫光华山信息技术有限公司 Method for testing hard disk and device
US20170185355A1 (en) * 2015-12-23 2017-06-29 Mitac Computing Technology Corporation Method of determining a physical location of a hard drive in a cluster storage system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6178520B1 (en) * 1997-07-31 2001-01-23 Lsi Logic Corporation Software recognition of drive removal or insertion in a storage system
US20090172234A1 (en) * 2007-12-28 2009-07-02 Inventec Corporation Apparatus and method for identifying system style
CN104503701A (en) * 2014-12-01 2015-04-08 北京同有飞骥科技股份有限公司 Magnetic disk naming method and device suitable for multi-stage expansion cabinet
CN105242875A (en) * 2015-09-17 2016-01-13 浪潮集团有限公司 Server raid batch configuration method
US20170185355A1 (en) * 2015-12-23 2017-06-29 Mitac Computing Technology Corporation Method of determining a physical location of a hard drive in a cluster storage system
CN106875980A (en) * 2017-02-17 2017-06-20 紫光华山信息技术有限公司 Method for testing hard disk and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582238A (en) * 2018-12-03 2019-04-05 郑州云海信息技术有限公司 A kind of hard disk binding, matching process, system and electronic equipment and storage medium
CN109582238B (en) * 2018-12-03 2022-02-18 郑州云海信息技术有限公司 Hard disk binding and matching method and system, electronic equipment and storage medium
CN109542708A (en) * 2018-12-04 2019-03-29 浪潮电子信息产业股份有限公司 Method for recording corresponding relation between physical slot position of back plate and system drive letter
CN109542708B (en) * 2018-12-04 2022-08-02 浪潮电子信息产业股份有限公司 Method and assembly for recording corresponding relation between physical slot position of backboard and system drive letter
CN110704334A (en) * 2019-09-25 2020-01-17 苏州浪潮智能科技有限公司 Method, system and equipment for important product data management
CN115102843A (en) * 2022-05-26 2022-09-23 苏州浪潮智能科技有限公司 Server serial number obtaining method and device and computer equipment
CN115102843B (en) * 2022-05-26 2023-07-14 苏州浪潮智能科技有限公司 Method and device for obtaining server serial number and computer equipment

Also Published As

Publication number Publication date
CN107402720B (en) 2020-06-16

Similar Documents

Publication Publication Date Title
CN107402720B (en) Hard disk processing method and device and terminal
CN107391325B (en) Hard disk test method and device and terminal
CN107402855A (en) A kind of detection method of hard disk, device and server
WO2018120721A1 (en) Method and system for testing user interface, electronic device, and computer readable storage medium
WO2018000607A1 (en) Method and electronic apparatus for identifying test case failure causes
CN109741755B (en) Voice awakening word threshold management device and method for managing voice awakening word threshold
CN111209151A (en) Linux-based NVME SSD hot plug test method, system, terminal and storage medium
CN108491326B (en) Test behavior a recombination process apparatus and storage medium
CN108763084A (en) A kind of generation method of test case, device and electronic equipment
CN111767241A (en) PCIe fault injection test method, device and storage medium
CN111414739B (en) Excel data entry component, entry method and device
CN108875046A (en) A kind of storage system access method, device and electronic equipment
CN109840210A (en) A kind of test method, device and electronic equipment
CN107204899A (en) A kind of method of testing of network interface card, device and terminal
CN107402753B (en) Method and device for refreshing hard disk firmware
US20140164845A1 (en) Host computer and method for testing sas expanders
US11366800B2 (en) System and method to automate validating media redirection in testing process
CN111638439B (en) Communication module testing method, device, computer equipment and storage medium
CN105472418A (en) Abnormal state recovery method of set-top box system and set-top box
CN112506786A (en) Regression testing method and regression testing device
CN113272785B (en) Method for mounting file system, terminal equipment and storage medium
CN109840182A (en) A kind of resource monitoring method, device and electronic equipment
CN116401120A (en) Cable connection verification method, device, equipment and machine-readable storage medium
CN113703753B (en) Method and device for product development and product development system
CN102567151A (en) SAS (serial attached SCSI (small computer system interface)) hard disc test system and method under EFI (extensible firmware interface) environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TA01 Transfer of patent application right

Effective date of registration: 20200527

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right