CN107704347A - A kind of automatic method for carrying out hard disc data uniformity test - Google Patents

A kind of automatic method for carrying out hard disc data uniformity test Download PDF

Info

Publication number
CN107704347A
CN107704347A CN201710851506.7A CN201710851506A CN107704347A CN 107704347 A CN107704347 A CN 107704347A CN 201710851506 A CN201710851506 A CN 201710851506A CN 107704347 A CN107704347 A CN 107704347A
Authority
CN
China
Prior art keywords
file
test
random
disk
hard disk
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
CN201710851506.7A
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.)
Zhengzhou Yunhai Information 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 CN201710851506.7A priority Critical patent/CN107704347A/en
Publication of CN107704347A publication Critical patent/CN107704347A/en
Pending legal-status Critical Current

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/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware

Landscapes

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

Abstract

The invention discloses a kind of automatic method for carrying out hard disc data uniformity test, automatized script is write with reference to various algorithms using Shell scripts, comprised the following steps:1) automatically by formatting hard disk to be measured, then it is mounted to the file directory of system;2) several different size of random files are generated at random;3) the MD5 values of each random file are recorded;4) each random file is individually copied in hard disk to be measured, the MD5 values of copied files are obtained after the completion of copy, by the MD5 values of copied files compared with the MD5 values of random file, set number, tested with some pieces of hard disks, be mounted to/home/disk [x] file manually in order respectively.Present invention librarian use simple to operate, easy to operation, compared with manual operation, operation the spent time is greatly reduced, the operation degree of accuracy is significantly improved, improves test job efficiency and the degree of accuracy.

Description

A kind of automatic method for carrying out hard disc data uniformity test
Technical field
The present invention relates to server test technical field, more particularly to a kind of automatic hard disc data uniformity test that carries out Method.
Background technology
When using hard disk on the server, data transfer, such as Backup Data, hard disc data dump are often done.On hard disk Data be it is most important, data shift during hard disk keep data uniformity it is particularly important.Line number is entered to hard disk According to uniformity test, it is ensured that the stabilization of hard disk data on the server.In the hard disk test standard of Tengxun, there is hard disk number According to uniformity test.In the exploitation test of some types, Tengxun also has the test of the type for the test of NVME hard disks.The survey The content of examination is to write the file generated at random in the hard disk to be tested, and compares copy preceding document and copy by MD5 values The uniformity of file afterwards, this process can circulate certain number.The side that file is verified using MD5 newly proposed for Tengxun Formula, go to perform such test currently without special script, construct this script in the case.Existing technical scheme is Voluntarily prepare file to be measured, then copy A disks to, B disks ... are copied to again by that analogy after verification, after being recycled to certain number Stop.Prior art has the drawback that:The script of prior art is to verify file by diff orders in Linux system , the order can only be gone to contrast content of text in a manner of line by line, and the requirement with being verified file using MD5 is not inconsistent, and be needed certainly Oneself goes to prepare file to be copied, and file to be copied may not have randomness.But also there is test job complex operation, Testing time is long, efficiency is low, the problem of operating poor accuracy.
The content of the invention
The present invention is aiming at deficiencies of the prior art, there is provided a kind of automatic progress hard disc data uniformity survey The method of examination;Present invention librarian use simple to operate, easy to operation, compared with manual operation, greatly reduce operation and spent Time, significantly improve the operation degree of accuracy, improve test job efficiency and the degree of accuracy.The present invention is simple to operate to be easy to grasp Make librarian use, greatly reduce the time that manual operation is spent, the time spent in time compared to manual operation. The present invention can be by changing a small amount of code with the hard disk of the various models of adaptive testing or quantity, and such as M.2 hard disk, NVME are hard Disk, versatility are good.
The present invention solve technical problem technical scheme be:
A kind of automatic method for carrying out hard disc data uniformity test, compiled using Shell scripts with reference to various algorithms Automatized script is write, is comprised the following steps:
1) automatically by formatting hard disk to be measured, then it is mounted to the file directory of system;
2) several different size of random files are generated at random;
3) the MD5 values of each random file are recorded;
4) each random file is individually copied in hard disk to be measured, the MD5 (messages of copied files is obtained after the completion of copy Digest algorithm, English Message-Digest Algorithm 5) value, by the MD5 values of copied files and the MD5 values of random file It is compared, sets number, tested with some pieces of hard disks, has been mounted to/home/disk [x] texts manually in order respectively Part presss from both sides.
Sda-sdg disks in system are formatted the step 1) and carry, and hard disk form is turned into EXT4 the (the 4th Generation extension file system, English Fourth extended filesystem abbreviation) form.
Automatized script code is repaiied according to the title that the quantity of the hard disk to be tested and hard disk are shown under system Change, to adapt to various test configurations.
The step 2) generates each different size of random file using dd orders, and random bytes flow data is pressed respectively Size is written in the random file under current path.
Test result is stored in log by success or failure, the file in hard disk to be measured is deleted after the completion of checking, is used for The test of circulation next time.
All hard disks are traveled through test by the step 4) in order, and are recycled to the number specified, by hard disk to be tested / home/disk [x] catalogue is mounted under system in order, and which block disk x represents;The log of generation is separated by test result, is surveyed Try successful daily record to be stored in PASS.log, the daily record of test crash is saved in FAIL.log.
Beneficial effects of the present invention:
1. present invention use simple to operate, easy to operation, compared with manual operation, greatly reduce operation it is spent when Between, detection randomness is good, significantly improves the operation degree of accuracy, also improves test job efficiency and the degree of accuracy.Solve existing Have that technical testing operation is complicated, the testing time is long, efficiency is low, the problem of operating poor accuracy.
2. this of the invention method of testing is in a unlimited number to the hard disk of test, all hard disks are traveled through into survey in order during test Examination, and the number specified is recycled to, hard disk to be tested is mounted under system/home/disk [x] catalogue, x in order Which block disk is represented, the log of generation is separated by test result, and the daily record being successfully tested is stored in PASS.log, test The daily record of failure is saved in FAIL.log, and use range is wide, and testing efficiency is high, easy to operation, preservation and management.
Brief description of the drawings
Fig. 1 is the flow chart of the present invention.
Embodiment
For a better understanding of the present invention, embodiments of the present invention are explained in detail below in conjunction with the accompanying drawings.
With reference to Fig. 1, a kind of automatic method for carrying out hard disc data uniformity test, combined using Shell scripts each Kind algorithm writes automatized script, realizes formatting hard disk to be measured automatically, is then mounted to the file directory of system, random raw Into different size of test file, test file is individually copied in hard disk to be measured, file to be measured is verified using MD5 values, Result is stored in log by success or failure, the test file in hard disk to be measured is deleted after the completion of verification, this process can circulate It is automatically stopped after to the number specified.Log can be checked to check the test knot of data coherence tester after the completion of script operation Fruit.Comprise the following steps:
1) by formatting hard disk to be measured and it is mounted under system directory;
2) several different size of random files are generated using dd orders;
3) the MD5 values of each random file are recorded;
4) each random file is individually copied in hard disk to be measured, the MD5 values of copied files is obtained after the completion of copy, will The MD5 values of copied files set number, tested with some pieces of hard disks, pressed respectively compared with the MD5 values of random file Sequential manual has been mounted to/home/disk [x] file.
Sda-sdg disks in system are formatted the step 1) and carry, and hard disk form is turned into EXT4 forms, Automatized script code can be modified according to the title shown under the hard disk quantity and system to be tested, to adapt to various surveys Trial is put.
The step 2) generates each different size of random file using dd orders, and random bytes flow data is pressed respectively Size is written in the random file under current path.
Test result is stored in log by success or failure, the file in hard disk to be measured is deleted after the completion of checking, is used for The test of circulation next time.
All hard disks are traveled through test by the step 4) in order, and are recycled to the number specified, by hard disk to be tested / home/disk [x] catalogue is mounted under system in order, and which block disk x represents;The log of generation is separated by test result , the daily record being successfully tested is stored in PASS.log, and the daily record of test crash is saved in FAIL.log.
The testing procedure is described in detail with reference to specific procedure:
(1) by formatting hard disk to be measured and it is mounted under system directory;Can be according under the hard disk quantity and system to be tested The title of display is modified to automatized script code, to adapt to various test configurations.
M=1
Sda-sdg disks in system are formatted # and carry
for i in{a..g}
do
Hard disk form is turned to EXT4 forms by #, is tested under linux when testing no particular/special requirement typically with this file Form.
mkfs-t ext4/dev/sd$i
Hard disk is mounted to by #/home/disk [x] catalogue under
mount/dev/sd$i/home/disk$m
let"m++"
Done
(2) using dd orders generation 1KB, the random file of 1MB and 1GB sizes:
/ dev/urandom is the random pseudo-device provided in linux system, the task of the two equipment, is to provide never For the random bytes data flow of sky, random bytes flow data is written under current path by size respectively using dd orders In 1kfile, 1mfile, 1gfile file
Dd if=/dev/urandom of=1kfile bs=1K count=1
Dd if=/dev/urandom of=1mfile bs=1M count=1
Dd if=/dev/urandom of=1gfile bs=1G count=1
(3) the MD5 values of these three files are recorded
On linux or Unix, MD5sum is the implementing procedure for calculating and verifying file message digest.It is general next Say, after being mounted with Linux, just have this instrument of MD5sum.The MD5 values for obtaining respective file are saved in currently by code herein In the variable of program.
MD51k=`MD5sum 1kfile | awk'{ print $ 1 } ' `
MD51m=`MD5sum 1mfile | awk'{ print $ 1 } ' `
MD51g=`MD5sum 1gfile | awk'{ print $ 1 } ' `
(4) these three files are individually copied in the hard disk to be tested, and be compared, it is (logical as 100 times to set number Cross for i in { 1..100 } settings), tested here with 7 pieces of hard disks, be mounted to/home/ manually in order respectively Disk [x] file:
for i in{1..100}
do
echo"loop$i"|tee times.log
# copies the random file of generation in hard disk to be measured to
for a in{1..7}
do
cp/root/percopy/*/home/disk$a
echo"loop$i copy over"
done
The MD5 values of file after copying are obtained after the completion of # copies.
echo"begin check"
# travels through 7 pieces of disks, is provided with the hard disk number of traversal, the 1st piece of disk to the 7th piece of disk herein
for a in{1..7}
do
# obtains the MD5 values of each file respectively, stores in coMD51k, coMD51m, coMD51g variable.
CoMD51k=`MD5sum/home/disk $ a/1kfile | awk'{ print $ 1 } ' `
CoMD51m=`MD5sum/home/disk $ a/1mfile | awk'{ print $ 1 } ' `
CoMD51g=`MD5sum/home/disk $ a/1gfile | awk'{ print $ 1 } ' `
# compares the MD5 values of 1k files.By the MD5 fi of 1kfile after the MD5 and copy of the 1kfile files obtained before Judge that sentence is compared, output journal is into PASS.log files when identical, and output journal is to FAIL.log files when different In.Journal format is " loop $ i disk $ a 1k PASS ", wherein loop $ i represent the number of previous cycle, disk $ a are represented It is which block hard disk, [PASS/FAIL] represents whether file MD5 values are identical, are all mutually PASS, are not all FAIL.Compare below During the file of 1M, 1G size, process is identical.
If [$ MD51k=$ coMD51k]
then
echo"loop$i disk$a 1k PASS"|tee PASS.log
else
echo"loop$i disk$a 1k FAIL"|tee FAIL.log
#echo$MD51k
#echo$coMD51k
fi
# compares the MD5 values of 1m files
If [$ MD51m=$ coMD51m]
then
echo"loop$i disk$a 1m PASS"|tee PASS.log
else
echo"loop$i disk$a 1m FAIL"|tee FAIL.log
fi
# compares the MD5 values of 1g files
If [$ MD51g=$ coMD51g]
then
echo"loop$i disk$a 1g PASS"|tee PASS.log
else
echo"loop$i disk$a 1g FAIL"|tee FAIL.log
fi
The file in hard disk to be measured, the test for circulation next time are deleted after the completion of # checkings.
rm-rf/home/disk$a/*
done
echo"loop$i over"
sleep 2
done
This method of testing is in a unlimited number to the hard disk of test, all hard disks is traveled through into test in order during test, and circulate To the number specified, hard disk to be tested is mounted under system/home/disk [x] catalogue in order, which x represents Block disk.The log of generation is separated by test result, and the daily record being successfully tested is stored in PASS.log, the day of test crash Will is saved in FAIL.log.
Although the present invention has shown that and described the present invention and applies example, for one of ordinary skill in the art, Ke Yili Solution can apply example to these in the case where not departing from the principle of the present invention and spirit and carry out a variety of change, modification, replacement and modification, all belong to In stating within claims for this present invention.

Claims (6)

1. a kind of automatic method for carrying out hard disc data uniformity test, it is characterized in that, combined using Shell scripts various Algorithm writes automatized script, comprises the following steps:
1) automatically by formatting hard disk to be measured, then it is mounted to the file directory of system;
2) several different size of random files are generated at random;
3) the MD5 values of each random file are recorded;
4) each random file is individually copied in hard disk to be measured, the MD5 values of copied files is obtained after the completion of copy, will be copied The MD5 values of file set number, tested with some pieces of hard disks, respectively in order compared with the MD5 values of random file / home/disk [x] file has been mounted to manually.
2. a kind of automatic method for carrying out hard disc data uniformity test as claimed in claim 1, it is characterized in that, the step 1) simultaneously carry is formatted to the sda-sdg disks in system, hard disk form is turned into EXT4 forms.
3. a kind of automatic method for carrying out hard disc data uniformity test as claimed in claim 2, it is characterized in that, according to surveying The title shown under the hard disk quantity and system of examination is modified to automatized script code, to adapt to various test configurations.
4. a kind of automatic method for carrying out hard disc data uniformity test as claimed in claim 1, it is characterized in that, the step 2) each different size of random file is generated using dd orders, random bytes flow data is written to current road by size respectively In random file under footpath.
5. a kind of automatic method for carrying out hard disc data uniformity test as claimed in claim 1, it is characterized in that, the step 4) all hard disks are traveled through into test in order, and is recycled to the number specified, hard disk to be tested is mounted to system in order Under/home/disk [x] catalogue, which block disk x represent;The log of generation is separated by test result, and the daily record being successfully tested preserves In PASS.log, the daily record of test crash is saved in FAIL.log.
6. a kind of automatic method for carrying out hard disc data uniformity test as claimed in claim 1, it is characterized in that, test is tied Fruit is stored in log by success or failure, and the file in hard disk to be measured is deleted after the completion of checking, the test for circulation next time.
CN201710851506.7A 2017-09-19 2017-09-19 A kind of automatic method for carrying out hard disc data uniformity test Pending CN107704347A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710851506.7A CN107704347A (en) 2017-09-19 2017-09-19 A kind of automatic method for carrying out hard disc data uniformity test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710851506.7A CN107704347A (en) 2017-09-19 2017-09-19 A kind of automatic method for carrying out hard disc data uniformity test

Publications (1)

Publication Number Publication Date
CN107704347A true CN107704347A (en) 2018-02-16

Family

ID=61173108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710851506.7A Pending CN107704347A (en) 2017-09-19 2017-09-19 A kind of automatic method for carrying out hard disc data uniformity test

Country Status (1)

Country Link
CN (1) CN107704347A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733525A (en) * 2018-06-07 2018-11-02 郑州云海信息技术有限公司 A kind of memory module tests and verifies the method and system of correctness automatically
CN109885432A (en) * 2018-11-28 2019-06-14 深圳忆联信息系统有限公司 NVMe head end test method, apparatus, computer equipment and storage medium
CN110504002A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disc data conformance test method and device
CN110825569A (en) * 2019-10-13 2020-02-21 苏州浪潮智能科技有限公司 Hard disk stability test method and test system
CN110992992A (en) * 2019-10-31 2020-04-10 苏州浪潮智能科技有限公司 Hard disk test method, device and storage medium
CN113452507A (en) * 2021-08-27 2021-09-28 创新科技术有限公司 Data consistency test method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536860A (en) * 2015-01-16 2015-04-22 浪潮电子信息产业股份有限公司 Hard disk sequence marshalling method based on real-time JBOD monitoring mode
CN106610877A (en) * 2016-12-19 2017-05-03 郑州云海信息技术有限公司 Method for testing hard disk data consistency

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536860A (en) * 2015-01-16 2015-04-22 浪潮电子信息产业股份有限公司 Hard disk sequence marshalling method based on real-time JBOD monitoring mode
CN106610877A (en) * 2016-12-19 2017-05-03 郑州云海信息技术有限公司 Method for testing hard disk data consistency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LTX06: "MD5校验两个文件是否一样", 《HTTPS://BLOG.CSDN.NET/LTX06/ARTICLE/DETAILS/70162107》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733525A (en) * 2018-06-07 2018-11-02 郑州云海信息技术有限公司 A kind of memory module tests and verifies the method and system of correctness automatically
CN109885432A (en) * 2018-11-28 2019-06-14 深圳忆联信息系统有限公司 NVMe head end test method, apparatus, computer equipment and storage medium
CN109885432B (en) * 2018-11-28 2022-06-03 深圳忆联信息系统有限公司 NVMe front-end testing method and device, computer equipment and storage medium
CN110504002A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disc data conformance test method and device
CN110825569A (en) * 2019-10-13 2020-02-21 苏州浪潮智能科技有限公司 Hard disk stability test method and test system
CN110825569B (en) * 2019-10-13 2022-07-19 苏州浪潮智能科技有限公司 Hard disk stability test method and test system
CN110992992A (en) * 2019-10-31 2020-04-10 苏州浪潮智能科技有限公司 Hard disk test method, device and storage medium
CN113452507A (en) * 2021-08-27 2021-09-28 创新科技术有限公司 Data consistency test method and device

Similar Documents

Publication Publication Date Title
CN107704347A (en) A kind of automatic method for carrying out hard disc data uniformity test
US10872033B2 (en) System and method for determining test coverage
US11176090B2 (en) Verification of the integrity of data files stored in copy-on-write (CoW) based file system snapshots
US8762337B2 (en) Storage replication systems and methods
CN104199750B (en) A kind of file access pattern method and device of Linux system
CN104407951A (en) Method for automatically testing server
CN103473158A (en) Disk pressure testing method for Linux server
US9804957B1 (en) Block tracking data validation backup model
US20140019929A1 (en) Partial Instruction-by-instruction checking on acceleration platforms
CN104778123A (en) Method and device for detecting system performance
CN107391333A (en) A kind of OSD disk failures method of testing and system
CN107797889A (en) A kind of method and apparatus of checking system file backup integrity
CN109002472A (en) A kind of recognition methods of database difference and device
CN107169000A (en) Static resource dissemination method and device
CN107391307A (en) The method of testing and device of storage area network storage device snapshot functions
Mohan et al. Crashmonkey and ACE: Systematically testing file-system crash consistency
CN108733525A (en) A kind of memory module tests and verifies the method and system of correctness automatically
CN104375905A (en) Incremental backing up method and system based on data block
CN103279408B (en) The method of testing of raid-array RAID performance
CN108182366A (en) A kind of method, apparatus and equipment of the file for measuring virtual machine
CN113190448B (en) Test code updating method and device, electronic equipment and storage medium
US10599880B1 (en) Systems and methods for simulating real-world IO workloads in a parallel and distributed storage system
US9946853B1 (en) Techniques for application code obfuscation
US8856070B2 (en) Consistent replication of transactional updates
US8601418B1 (en) Instruction-by-instruction checking on acceleration platforms

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180216