CN106909484B - System and method for simulating bad disk test in storage environment - Google Patents

System and method for simulating bad disk test in storage environment Download PDF

Info

Publication number
CN106909484B
CN106909484B CN201710128628.3A CN201710128628A CN106909484B CN 106909484 B CN106909484 B CN 106909484B CN 201710128628 A CN201710128628 A CN 201710128628A CN 106909484 B CN106909484 B CN 106909484B
Authority
CN
China
Prior art keywords
file
read
disk
write
test
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.)
Active
Application number
CN201710128628.3A
Other languages
Chinese (zh)
Other versions
CN106909484A (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 Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent 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 Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201710128628.3A priority Critical patent/CN106909484B/en
Publication of CN106909484A publication Critical patent/CN106909484A/en
Application granted granted Critical
Publication of CN106909484B publication Critical patent/CN106909484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/26Functional testing
    • G06F11/261Functional testing by simulating additional hardware, e.g. fault simulation

Abstract

The invention provides a system and a method for simulating a bad disk test in a storage environment, which can simulate various hard disk fault conditions in the test process by the scheme of the invention, thereby solving the problem that the situation that various problems encountered in the actual use of a user cannot be comprehensively reproduced by pulling out a hard disk alone.

Description

system and method for simulating bad disk test in storage environment
Technical Field
the invention relates to the field of storage, in particular to a system and a method for simulating bad disk test in a storage environment.
background
The field of computing in the information age has changed greatly, and in any case, the importance of computer processing and data generation has not changed, and once data is lost, all computing power becomes worthless. We must see that data is gradually becoming an entity that has its own storage, not belonging to any particular system, like capital or intellectual property, and also a kind of commonly available wealth, which needs to be stored and protected.
the storage of information is an important aspect of information systems, and if the information is not stored, the collected and processed information cannot be fully utilized, and meanwhile, the information is collected and processed again by consuming resources, people and objects. With the information storage, the user can be ensured to take at any time, and conditions are created for the multifunctional utilization of unit information, thereby greatly reducing the cost.
the storage of information has finally been preserved in the hard disk, after these hard disks have run thousands of hours, many physical parameters all can change, the damage of hard disk has very big probability to damage, and the user probably appears a large amount of magnetic disk reading and writing errors in using, it can not reproduce the problem that the user meets in the use to rely on only plugging the hard disk, thereby simulate the magnetic disk and damage the performance of phenomenon test magnetic disk, in order to ensure that the data storage can not appear the mistake under this kind of environment just become the problem that needs to solve urgently.
Disclosure of Invention
in order to solve the technical problems, the technical scheme of the invention is as follows:
the invention provides a method for simulating a bad disk test in a storage environment, which comprises the following steps:
SS1, establishing a disk array and initializing a logical volume;
SS2, generating a large-capacity file to ensure that the file is not completely cached in the memory;
SS3, injecting bad blocks;
SS4, abnormal reconstruction and output of test results.
further, step SS1 includes:
SS11, constructing a disk array environment;
SS12, injecting bad blocks and adding io pressure, wherein the io pressure is simulated by simultaneously using one dd read thread and one dd write thread;
SS13, view disk array and hot spare status.
further, the read-write areas of the dd read thread and the dd write thread in step SS12 are within the range of the set bad block.
Further, step SS4 includes:
SS41, changing the data source of dd write thread into large-capacity file;
SS42, through calculation of the capacity and the reconstruction progress of the disk array, reading the written test file through dd before, after and at three time points when the reconstruction of the disk array is completed;
SS43, comparing whether md5 value of written and read file changes;
SS44, and outputting the test result.
further, dd write operations are performed by the following commands: dd if/mnt/bkos/bsfi/sde/test. file of ═ dev/vg- $ RAID _ NAME/lv- $ RAID _ NAME bs ═ 64k count ═ 100000 &.
Further, dd read operations are performed by the following commands: ddif ═ dev/vg- $ RAID _ NAME/lv- $ RAID _ NAME of ═ mnt/bkos/bsfi/sde/test, readbs ═ 64k count &.
further, the large-capacity file in step SS2 is a file with a size of 7G.
In addition, the invention provides a system for simulating bad disk test in storage environment, which comprises a central control module, a random file generation module, a bad block injection module, a read/write control module and a test result output module, wherein the random file generation module, the bad block injection module, the read/write control module and the test result output module are respectively connected with the central control module, the central control module is used for controlling the work of each function module connected with the central control module, and simultaneously comparing the written files and reading the md5 value of the written test files through dd at three time points before, after and after the disk array reconstructs a large-capacity file; the random file generation module is used for generating a large-capacity file so as to ensure that the file cannot be completely cached in a memory; the bad block injection module is used for injecting bad blocks into the member disk, the range of the bad blocks is 1M-20G of the member disk, the bad blocks are removed at intervals of one second and are reset, so that the phenomenon that the disk is unstable or abnormal in reaction is simulated; the read/write control module is used for simulating field io pressure by using a dd read thread and a dd write thread while injecting a bad block and changing a data source of the dd write thread into a fixed large-capacity file in an abnormal reconstruction stage in the initialization process of establishing the disk array and the logical volume, and after the file is written, reading the written test file by dd at three time points before, after and completely reconstructing a large-capacity space of the disk array through calculation of the capacity and the reconstruction progress of the disk array; and the test result output module is used for outputting a test result according to the md5 value compared by the central control module.
Further, the large-capacity file is a file of size 7G.
Further, the read-write areas of the dd read thread and the dd write thread are within the range of the set bad block.
the scheme of the invention can simulate various hard disk failure conditions in the test, so that the situation that various problems encountered in the actual use of a user cannot be comprehensively reproduced by pulling the hard disk alone is solved, the test method can simulate the environment that the hard disk has read-write errors in the use of the user, and the storage product can be more comprehensively tested.
Drawings
FIG. 1 is a flow chart of a method for simulating bad disk testing in a storage environment according to the present invention.
FIG. 2 is a block diagram of a system for simulating bad disk test in a storage environment according to the present invention.
Detailed Description
The technical scheme of the invention is further explained by combining the drawings and the specific embodiments in the specification. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
FIG. 1 is a flow chart of a method for simulating bad disk testing in a storage environment according to an embodiment of the present invention.
The invention provides a method for simulating a bad disk test in a storage environment, which comprises the following steps:
SS1, establishing a disk array and initializing a logical volume;
SS2, generating a file with enough capacity to ensure that the file is not completely cached in the memory;
SS3, injecting bad blocks;
SS4, abnormal reconstruction and output of test results.
wherein the step 1 specifically comprises the following steps:
SS11, constructing a disk array environment;
SS12, injecting bad blocks and adding io pressure, wherein the io pressure is simulated by simultaneously using one dd read thread and one dd write thread;
SS13, view disk array and hot spare status.
wherein the file with sufficient capacity in step 2 is preferably a file with a size of 7G.
Wherein the step 4 specifically comprises the following steps:
SS41, changing the data source of dd write thread into fixed large-capacity data file;
SS42, through raid capacity and reconstruction progress calculation, reading out the written test file through dd before, after and at three time points when raid reconstruction 7G space is completed;
SS43, comparing whether md5 value of written and read file changes;
SS44, and outputting the test result.
the specific implementation process is as follows:
constructing a raid environment: and establishing raid (disk array) of 3 member disks and 1 hot standby disk, establishing a logical volume on the raid, and waiting for raid synchronization completion.
Inject bad block and add io pressure: bad blocks are injected into one of the vdisk member disks through the bsfi module, the range of the bad blocks is 1M-20G of the vdisk disk, the bad blocks are removed at intervals of one second and reset (the phenomenon that the disk is unstable or the reaction is abnormal is simulated). And simultaneously, simulating the field io pressure by using one dd reading thread and one dd writing thread, and ensuring that the reading and writing area is in the range of the set bad block.
the code is as follows:
And checking results: after waiting for dd to execute for about 5 seconds,
checking the log: the bytes of wamning, error, fail, etc. do not appear.
The raid state is a reconstruction state, and the original hot spare disk is displayed as a replacement state.
On this basis, the data source of the dd write thread is changed into a fixed data file with a file size of 7G (a file large enough to ensure that the file is not completely cached in the memory). Waiting for the file write to complete.
Through raid capacity and reconstruction progress calculation, the written test file is read out by dd before, after, and at three time points when complete reconstruction of the raid reconstruction 7G space is completed.
comparing md5 values of written and read files, if they are consistent, the abnormal reconstruction will not result in loss of file data.
A system for simulating bad disc testing in a storage environment according to the present invention is described with reference to the description accompanying fig. 2.
FIG. 2 is a block diagram of a system for simulating bad disk testing in a storage environment according to an embodiment of the present invention.
as shown in fig. 2, the system for simulating a bad disk test in a storage environment according to an embodiment of the present invention includes a central control module, and a random file generation module, a bad block injection module, a read/write control module, and a test result output module, which are respectively connected to the central control module.
Specifically, the central control module is used for controlling the work of each function module connected with the central control module, and simultaneously comparing the written file and reading the md5 value of the written test file through dd at three time points before, after and after the raid reconstruction of the 7G space is completed.
the random file generation module is used for generating a file with a capacity large enough to ensure that the file is not completely cached in the memory, and the generated file size is preferably 7G.
The bad block injection module is used for injecting bad blocks into the vdisk member disk, the bad blocks range is 1M-20G of the vdisk disk, the bad blocks are removed at intervals of one second and are reset, and therefore the phenomenon that the disk is unstable or abnormal in reaction is simulated.
The read/write control module is used for simulating field io pressure by using one dd read thread and one dd write thread while injecting the bad blocks in the process of establishing the disk array and the initialization of the logical volume, and ensuring that a read-write area is in the range of the set bad blocks.
And the read/write control module is also used for changing a data source of the dd write thread into a fixed data file with the file size of 7G in the abnormal reconstruction stage, waiting for the completion of the writing of the file, and reading the written test file through dd at three time points before, after and after the raid reconstruction of the 7G space through raid capacity and reconstruction progress calculation.
And the test result output module is used for outputting a test result according to the written files compared by the central control module and the md5 values of the written test files read out by dd at three time points before, after and after the raid reconstruction of the 7G space, and the complete reconstruction is completed, and if the test results are consistent, the abnormal reconstruction does not cause file data loss, and the test passes.
in one embodiment of the invention, the central control module adopts an Intel 7 th generation Kaby Lake processor, so that the processing is quick and efficient.
by the aid of the scheme, various hard disk fault conditions can be simulated in testing, so that the problem that various problems in practical use of a user cannot be comprehensively reproduced by pulling out the hard disk alone is solved, the testing method can simulate the environment that the hard disk is wrongly read and written in use of the user, and storage products can be more comprehensively tested.
although some aspects have been described in the context of an apparatus, it is clear that these aspects also represent a description of the corresponding method, where a block or device corresponds to a method step or a feature of a method step. Similarly, aspects described in the context of a method step also represent a description of a corresponding block or item or a feature of a corresponding apparatus. Some or all of the method steps may be performed by (or using) hardware means, such as a microprocessor, programmable computer, or electronic circuitry. One or more of the most important method steps may be performed by such means.
The implementation can be performed in hardware or in software or using a digital storage medium, e.g. a floppy disk, a DVD, a blu-ray, a CD, a ROM, a PROM, an EPROM, an EEPROM, or a flash memory, having electronically readable control signals stored thereon, which cooperate (or are capable of cooperating) with a programmable computer system such that the respective method is performed. A data carrier may be provided with electronically readable control signals capable of cooperating with a programmable computer system such that the method described herein is performed.
the described implementations may also take the form of a computer program product with program code means for performing the method when the computer program product runs on a computer. The program code may be stored on a machine readable carrier.
The foregoing description is illustrative only, and it is to be understood that modifications and variations in the arrangements and details described herein will be apparent to those skilled in the art. It is therefore intended that the scope of the appended claims be limited only by the specific details presented by way of the foregoing description and explanation.

Claims (7)

1. A method for simulating bad disk testing in a storage environment, comprising the steps of:
SS1, establishing a disk array and initializing a logical volume;
SS2, generating a large-capacity file to ensure that the file is not completely cached in the memory;
SS3, injecting bad blocks;
SS4, abnormal reconstruction and output of test results;
Step SS1 includes:
SS11, constructing a disk array environment;
SS12, injecting bad blocks and adding io pressure, wherein the io pressure is simulated by simultaneously using one dd read thread and one dd write thread;
SS13, checking the disk array and the hot spare disk state;
The read-write areas of the dd read thread and the dd write thread in the step SS12 are in the range of the set bad block;
Step SS4 includes:
SS41, changing the data source of dd write thread into large-capacity file;
SS42, through calculation of the capacity and the reconstruction progress of the disk array, reading the written test file through dd before, after and at three time points when the reconstruction of the disk array is completed;
SS43, comparing whether md5 value of written and read file changes;
SS44, and outputting the test result.
2. the method of claim 1, wherein dd write operations are performed by: dd if/mnt/bkos/bsfi/sde/test. file of ═ dev/vg- $ RAID _ NAME/lv- $ RAID _ NAME bs ═ 64kcount &.
3. The method of claim 1, wherein dd read operations are performed by: dd if ═ dev/vg- $ RAID _ NAME/lv- $ RAID _ NAME of ═ mnt/bkos/bsfi/sde/test, read bs ═ 64kcount & $ 100000.
4. The method according to claim 1, wherein the large capacity file in step SS2 is a file with a size of 7G.
5. A system for simulating bad disk test in storage environment is characterized by comprising a central control module, a random file generation module, a bad block injection module, a read/write control module and a test result output module, wherein the random file generation module, the bad block injection module, the read/write control module and the test result output module are respectively connected with the central control module, the central control module is used for controlling the work of each function module connected with the central control module, and simultaneously comparing a written file with the written file and reading the md5 value of the written test file through dd at three time points before, after and after a disk array reconstructs a large-capacity file; the random file generation module is used for generating a large-capacity file so as to ensure that the file cannot be completely cached in a memory; the bad block injection module is used for injecting bad blocks into the member disk, the range of the bad blocks is 1M-20G of the member disk, the bad blocks are removed at intervals of one second and are reset, so that the phenomenon that the disk is unstable or abnormal in reaction is simulated; the read/write control module is used for simulating field io pressure by using a dd read thread and a dd write thread while injecting a bad block and changing a data source of the dd write thread into a fixed large-capacity file in an abnormal reconstruction stage in the initialization process of establishing the disk array and the logical volume, and after the file is written, reading the written test file by dd at three time points before, after and completely reconstructing a large-capacity space of the disk array through calculation of the capacity and the reconstruction progress of the disk array; and the test result output module is used for outputting a test result according to the md5 value compared by the central control module.
6. The system of claim 5, wherein the large-capacity file is a file having a size of 7G.
7. the system of claim 5, wherein the read and write areas of the dd read thread and the dd write thread are within the set bad block.
CN201710128628.3A 2017-03-06 2017-03-06 System and method for simulating bad disk test in storage environment Active CN106909484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710128628.3A CN106909484B (en) 2017-03-06 2017-03-06 System and method for simulating bad disk test in storage environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710128628.3A CN106909484B (en) 2017-03-06 2017-03-06 System and method for simulating bad disk test in storage environment

Publications (2)

Publication Number Publication Date
CN106909484A CN106909484A (en) 2017-06-30
CN106909484B true CN106909484B (en) 2019-12-17

Family

ID=59186203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710128628.3A Active CN106909484B (en) 2017-03-06 2017-03-06 System and method for simulating bad disk test in storage environment

Country Status (1)

Country Link
CN (1) CN106909484B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356679B (en) * 2022-03-18 2022-06-07 北京得瑞领新科技有限公司 Method and device for setting bad block, storage medium and electronic equipment
CN116701088B (en) * 2023-06-28 2024-02-27 成都电科星拓科技有限公司 Simulation method and system for EEPROM space content loss

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595537A (en) * 2004-07-13 2005-03-16 海信集团有限公司 A system for simulating physical damage of NAND flash memory and method thereof
CN101833493A (en) * 2010-03-24 2010-09-15 浪潮电子信息产业股份有限公司 Method for testing stability and reliability of server based on linux system
CN102044278A (en) * 2009-10-12 2011-05-04 英业达股份有限公司 Method and device for simulating logic hard disk test by using bad sector log sheet
CN104199748A (en) * 2014-08-25 2014-12-10 浪潮电子信息产业股份有限公司 Method for testing capacity of memory system in tolerating bad sector based on fault injection
CN104360919A (en) * 2014-10-24 2015-02-18 浪潮电子信息产业股份有限公司 Method for automatically testing performance, function and stability of SSD (solid state drive)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595537A (en) * 2004-07-13 2005-03-16 海信集团有限公司 A system for simulating physical damage of NAND flash memory and method thereof
CN102044278A (en) * 2009-10-12 2011-05-04 英业达股份有限公司 Method and device for simulating logic hard disk test by using bad sector log sheet
CN101833493A (en) * 2010-03-24 2010-09-15 浪潮电子信息产业股份有限公司 Method for testing stability and reliability of server based on linux system
CN104199748A (en) * 2014-08-25 2014-12-10 浪潮电子信息产业股份有限公司 Method for testing capacity of memory system in tolerating bad sector based on fault injection
CN104360919A (en) * 2014-10-24 2015-02-18 浪潮电子信息产业股份有限公司 Method for automatically testing performance, function and stability of SSD (solid state drive)

Also Published As

Publication number Publication date
CN106909484A (en) 2017-06-30

Similar Documents

Publication Publication Date Title
TWI479309B (en) Apparatus and method for controlling a solid state disk
US20160320451A1 (en) Simulation verification method for fpga function modules and system thereof
TW201933110A (en) Method and system for testing firmware of solid-state storage device, and electronic apparatus
JP2017011677A (en) Method and device for holding high density high power io digital holding
US20060224874A1 (en) Method for updating system management basic input output system (SMBIOS) data
US8572436B2 (en) Computing device and method for managing motherboard test
CN109684150B (en) Performance test system, test method and simulation platform of storage particle controller
CN106909484B (en) System and method for simulating bad disk test in storage environment
CN104021058A (en) Method for quickly starting test board card
JP2005528692A (en) System and method for testing responses to asynchronous system errors
CN104598328A (en) File system repair method, device and system
CN104978241B (en) A kind of data reconstruction method and device of COW type file systems
CN109445982A (en) Realize the data storage device of data reliable read write
CN105630523A (en) Computer BIOS data recovery system and method
CN111367710A (en) eMMC problem reduction method and device
CN106611138B (en) GHOST file security check method and device
CN104572350B (en) A kind of metadata processing method and device
CN113470723A (en) Read retry test method and device, readable storage medium and electronic equipment
CN110688071A (en) Data synchronization method and system for reducing data synchronization quantity
US9990382B1 (en) Secure erasure and repair of non-mechanical storage media
CN109584943B (en) Method and device for evaluating storage medium
CN105893394B (en) Large file simulation method and device
TWI401566B (en) Raid information update method
CN112162699A (en) Data reading and writing method, device and equipment and computer readable storage medium
US20120210061A1 (en) Computer and method for testing redundant array of independent disks of the computer

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20191113

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

Applicant after: Suzhou Wave Intelligent Technology Co., Ltd.

Address before: 450000 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.

GR01 Patent grant
GR01 Patent grant