CN106610877A - Method for testing hard disk data consistency - Google Patents

Method for testing hard disk data consistency Download PDF

Info

Publication number
CN106610877A
CN106610877A CN201611177290.2A CN201611177290A CN106610877A CN 106610877 A CN106610877 A CN 106610877A CN 201611177290 A CN201611177290 A CN 201611177290A CN 106610877 A CN106610877 A CN 106610877A
Authority
CN
China
Prior art keywords
hard disk
data
file
difference
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.)
Pending
Application number
CN201611177290.2A
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 CN201611177290.2A priority Critical patent/CN106610877A/en
Publication of CN106610877A publication Critical patent/CN106610877A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1479Generic software techniques for error detection or fault masking

Abstract

The invention provides a method for testing hard disk data consistency and belongs to the field of hard disk data testing. The method comprises the following steps of mounting a partition of a hard disk into a file system after hard disk partition and partition formatting, viewing whether data is consistent through copying and comparing data in the file system mounted by the hard disk, and if the data is inconsistent, recording differences; circulating the copy and the comparison between the hard disks for more than once, simulating a long-time operation process of customer business, recording the differences and viewing the differences of the data; and viewing a result to see whether data inconsistency condition is produced in a copy process. According to the method, the operations can simplified and the manpower and the time can be saved.

Description

A kind of method of testing hard disk data consistency
Technical field
The present invention relates to hard disc data measuring technology, more particularly to a kind of method of testing hard disk data consistency.
Background technology
With the continuous development and growth of tide server industry, as the server provider of largest domestic, server Every field has been included in market, especially the main flow field such as finance, internet, the high speed development of internet, the Gao An of information The high reliability of full property and system increasingly becomes company and enterprise, the thing that government pays close attention to the most, and hard disk is used as data storage Main carriers, its stability and reliability be also increasingly taken seriously, thus for hard disk use on our servers when Often there are backup and the dump of hard disc data to occur, during hard disc data is shifted, the data consistency between hard disk It is critically important.Based on requirements above, a kind of method testing hard disk data consistency under system is needed in test process.
The content of the invention
In order to solve problem above, the present invention proposes a kind of method of testing hard disk data consistency.Can apply to The conforming test of hard disc data under various configurations, realizes quick, efficient, accurate, automation the contrast for carrying out difference, and And the result of contrast is simple and clear, the quality to improving server product provides reliable guarantee.
The present invention is easy to the mistake occurred during finding copying and dump.The replicate data on fdisk, By duplication and contrast to data etc. operate, afterwards with initial data contrast come complete pressure test discover whether have number According to uniformity.
The technical scheme is that:
A kind of method of testing hard disk data consistency,
By by fdisk again by partition format after, the subregion of hard disk is mounted in file system, by data(Text Part)Replicate and compare in the file system of hard disk institute carry, check whether that data are consistent and difference is recorded if inconsistent; More than circulation primary replicate and compare between multiple hard disks, the prolonged running of simulation client traffic, record difference is looked into See the otherness of data.Result is then looked at, sees the inconsistent situation of data whether is generated during duplication.
Idiographic flow is:
1)Linux system is installed and obtains root authority,
2)For hard disk or logic magnetic disc subregion and format;
3)The fdisk of formatting is mounted under file system;
4)File is copied to into another file from a file;
5)Relatively the difference of two folder contents, checks whether consistent;
6)If consistent, continue to replicate, then check difference;
If inconsistent, record difference and continue to replicate, then check difference.
Preparation
Need that hard disk to be measured is linked in system, Linux system is installed, Src files are created under/root, non-two are entered In file copy to Src files processed.
Specifically testing procedure is:
1)Subregion is carried out to the hard disk in server system;
2)Fdisk is formatted into into the form of EXT4;
3)Set up equal with hard disk quantity under/opt, and the corresponding file of title;
4)Fdisk is mounted under corresponding file;
5)Recursive copying and the deletion in the subregion of hard disk by the All Files in Src files;
6)The difference for relatively replicating every time;
7)Difference is recorded, test result is returned.
The invention has the beneficial effects as follows
The complexity of manual test when reducing test in the past by the method for automatic running, it is possible to reduce simplify operation, Save manpower and time.
Description of the drawings
Fig. 1 is testing process schematic diagram.
Specific embodiment
Below more detailed elaboration is carried out to present disclosure:
The present invention verification step be:
Hard disk to be measured is linked in system, Linux system is installed, Src files are created under/root, by nonbinary text In part copy to Src files.
When the 1st, running copy and compare, copy number is shown;
2nd, when operation is completed, there are " Test finished1000times!”
3rd, test.log is checked, the number of times being successfully, reproduced can be checked and whether passed through.
Attached script and explanation
Script deal_disk is the script to fdisk and formatting, wherein being 40G to the size of hard disk distribution, is formatted Pattern is the form of ext4.
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
for i in {b..d};
do
fdisk /dev/sd$i <<ESXU
n
p
1
+40G
w
ESXU
sleep 3s
mkfs.ext4 /dev/sd"$i"1
done
Script mount_disk is establishment file folder and fdisk to be mounted to into the script of corresponding document folder under/root
#/bin/bash
for i in {b..d};
do
umount /root/test/$i
done
rm -rf /root/test
mkdir /root/test
for i in {b..d};
do
mkdir /root/test/$i
done
for i in {b..d};
do
mount /dev/sd"$i"1 /root/test/$i
done
Script copy_and_compare is by the file under the nonbinary file copy in Src to/opt, and at each The script of multiple copy and compare is constantly carried out in file, cp orders used in script are replicated using diff orders Carry out contrasting verification and comparing result being recorded in diffsrc.txt and diff.txt, while can also will appear from the ground of difference Side also records, and is checked after the completion of convenient test, and copy number and result are put into into test.log and Success.log In.
#!/bin/bash
TestCount=1000
rm diff.txt
rm diffsrc.txt
rm SuccessCount.log
rm test.log
for i in {b..d};
do
rm -rvf /root/test/$i/*
done
cp -a /root/Src/* /root/test/b
diff /root/Src /root/test/b |tee -a diffsrc.txt
diffsrc=$(cat diffsrc.txt | wc -l)
if [ "$diffsrc" != "0" ]; then
echo "Compare with the source files fail !!!"
exit 1
fi
count=0
###copy from disk to disk###
while (true);do
######copy from b to c
cp -a /root/test/b/* /root/test/c
count=$(($count + 1))
diff /root/test/b /root/test/c |tee -a diff.txt
diffnum=$(cat diff.txt |wc -l)
if [ "$diffnum" != "0" ];then
echo "failed at "$count "times test" | tee -a diff.txt
echo "failed at when copy from sdb to sdc"|tee -a diff.txt
cat SuccessCount.log >>test.log
break
fi
echo "Successfully copy files "$count"times !" |tee -a SuccessCount.log
rm -rvf /root/test/b/*
if [ -n "${TestCount}" ];then
if [ "$count" == "$TestCount" ];then
echo "Test finished"$count"times!"
cat SuccessCount.log>> test.log
echo "PASS !!!">> test.log
exit
fi
fi
######copy from c to d
cp -a /root/test/c/* /root/test/d
count=$(($count + 1))
diff /root/test/c /root/test/d |tee -a diff.txt
diffnum=$(cat diff.txt |wc -l)
if [ "$diffnum" != "0" ];then
echo "failed at "$count "times test" | tee -a diff.txt
echo "failed at when copy from sdc to sdd"|tee -a diff.txt
cat SuccessCount.log >>test.log
break
fi
echo "Successfully copy files "$count"times !" |tee -a SuccessCount.log
rm -rvf /root/test/c/*
if [ -n "${TestCount}" ];then
if [ "$count" == "$TestCount" ];then
echo "Test finished"$count"times!"
cat SuccessCount.log>> test.log
echo "PASS !!!">> test.log
exit
fi
fi
######copy from d to b
cp -a /root/test/d/* /root/test/b
count=$(($count + 1))
diff /root/test/d /root/test/b |tee -a diff.txt
diffnum=$(cat diff.txt |wc -l)
if [ "$diffnum" != "0" ];then
echo "failed at "$count "times test" | tee -a diff.txt
echo "failed at when copy from sdd to sdb"|tee -a diff.txt
cat SuccessCount.log >>test.log
break
fi
echo "Successfully copy files "$count"times !" |tee -a SuccessCount.log
rm -rvf /root/test/d/*
if [ -n "${TestCount}" ];then
if [ "$count" == "$TestCount" ];then
echo "Test finished"$count"times!"
cat SuccessCount.log>> test.log
echo "PASS !!!">> test.log
exit
fi
fi
done。
This method can apply to the conforming test of hard disc data under various configurations, realize it is quick, efficiently, accurately, The contrast for carrying out difference of automation, and the result for contrasting is simple and clear, and the quality to improving server product is provided can The guarantee leaned on.

Claims (4)

1. a kind of method of testing hard disk data consistency, it is characterised in that
By by fdisk again by partition format after, the subregion of hard disk is mounted in file system, by existing to data Replicate and compare in the file system of hard disk institute carry, check whether that data are consistent and difference is recorded if inconsistent;
More than circulation primary replicate and compare between multiple hard disks, the prolonged running of simulation client traffic, it is poor to record The different otherness for checking data;
Result is then looked at, sees the inconsistent situation of data whether is generated during duplication.
2. method according to claim 1, it is characterised in that
Idiographic flow is:
1)Linux system is installed and obtains root authority,
2)For hard disk or logic magnetic disc subregion and format;
3)The fdisk of formatting is mounted under file system;
4)File is copied to into another file from a file;
5)Relatively the difference of two folder contents, checks whether consistent;
6)If consistent, continue to replicate, then check difference;
If inconsistent, record difference and continue to replicate, then check difference.
3. method according to claim 2, it is characterised in that
Before test, need that hard disk to be measured is linked in system, Linux system be installed, and Src files are created under/root, By in nonbinary file copy to Src files.
4. method according to claim 3, it is characterised in that
Testing procedure is:
1)Subregion is carried out to the hard disk in server system;
2)Fdisk is formatted into into the form of EXT4;
3)Set up equal with hard disk quantity under/opt, and the corresponding file of title;
4)Fdisk is mounted under corresponding file;
5)Recursive copying and the deletion in the subregion of hard disk by the All Files in Src files;
6)The difference for relatively replicating every time;
7)Difference is recorded, test result is returned.
CN201611177290.2A 2016-12-19 2016-12-19 Method for testing hard disk data consistency Pending CN106610877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611177290.2A CN106610877A (en) 2016-12-19 2016-12-19 Method for testing hard disk data consistency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611177290.2A CN106610877A (en) 2016-12-19 2016-12-19 Method for testing hard disk data consistency

Publications (1)

Publication Number Publication Date
CN106610877A true CN106610877A (en) 2017-05-03

Family

ID=58636125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611177290.2A Pending CN106610877A (en) 2016-12-19 2016-12-19 Method for testing hard disk data consistency

Country Status (1)

Country Link
CN (1) CN106610877A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704347A (en) * 2017-09-19 2018-02-16 郑州云海信息技术有限公司 A kind of automatic method for carrying out hard disc data uniformity test
CN107908515A (en) * 2017-11-16 2018-04-13 郑州云海信息技术有限公司 A kind of system and method for test server hard disk large data files transmittability

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1519731A (en) * 2003-01-23 2004-08-11 周煜盛 Equipment and method for copying and comparing recorded media
US20040230863A1 (en) * 2001-06-19 2004-11-18 Christoffer Buchhorn Copying procedures including verification in data networks
US20050278591A1 (en) * 2004-06-14 2005-12-15 Research In Motion Limited System and method for testing a data storage device without revealing memory content
CN101377748A (en) * 2007-08-29 2009-03-04 英业达股份有限公司 Method for checking reading and writing functions of memory device
US20100011181A1 (en) * 2003-08-01 2010-01-14 Wai Lam Methods for synchronizing storage system data
CN102496379A (en) * 2011-12-30 2012-06-13 曙光信息产业股份有限公司 Method for testing compact disc read-only memory (CD-ROM)
CN106201795A (en) * 2016-07-07 2016-12-07 浪潮电子信息产业股份有限公司 A kind of method of quick detection data storage link stability

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040230863A1 (en) * 2001-06-19 2004-11-18 Christoffer Buchhorn Copying procedures including verification in data networks
CN1519731A (en) * 2003-01-23 2004-08-11 周煜盛 Equipment and method for copying and comparing recorded media
US20100011181A1 (en) * 2003-08-01 2010-01-14 Wai Lam Methods for synchronizing storage system data
US20050278591A1 (en) * 2004-06-14 2005-12-15 Research In Motion Limited System and method for testing a data storage device without revealing memory content
CN101377748A (en) * 2007-08-29 2009-03-04 英业达股份有限公司 Method for checking reading and writing functions of memory device
CN102496379A (en) * 2011-12-30 2012-06-13 曙光信息产业股份有限公司 Method for testing compact disc read-only memory (CD-ROM)
CN106201795A (en) * 2016-07-07 2016-12-07 浪潮电子信息产业股份有限公司 A kind of method of quick detection data storage link stability

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704347A (en) * 2017-09-19 2018-02-16 郑州云海信息技术有限公司 A kind of automatic method for carrying out hard disc data uniformity test
CN107908515A (en) * 2017-11-16 2018-04-13 郑州云海信息技术有限公司 A kind of system and method for test server hard disk large data files transmittability

Similar Documents

Publication Publication Date Title
US10162714B2 (en) Methods and systems for restoring data containers in a storage system
US8495019B2 (en) System and method for providing assured recovery and replication
US9645892B1 (en) Recording file events in change logs while incrementally backing up file systems
US9703648B2 (en) Logically partitioning remote virtual library extensions for use in disaster recovery of production data
US8234475B2 (en) Save set bundling for staging
US8762337B2 (en) Storage replication systems and methods
US20110184910A1 (en) Chain-of-Custody for Archived Data
CN102033786B (en) Method for repairing consistency of copies in object storage system
US10204016B1 (en) Incrementally backing up file system hard links based on change logs
US8595566B2 (en) Error tracking method and system
WO2018098972A1 (en) Log recovery method, storage device and storage node
US20140059308A1 (en) Automated migration to a new target volume via merged bitmaps to maintain consistency
CN107704347A (en) A kind of automatic method for carrying out hard disc data uniformity test
CN112269759B (en) Migration method and related device for shared file storage
CN111367994A (en) Method and system for synchronously backing up incremental data of database
US8843450B1 (en) Write capable exchange granular level recoveries
CN114416665B (en) Method, device and medium for detecting and repairing data consistency
CN106610877A (en) Method for testing hard disk data consistency
CN106326041A (en) Second-level recovery method for database
CN104978241B (en) A kind of data reconstruction method and device of COW type file systems
CN107402841B (en) Data restoration method and device for large-scale distributed file system
CN110555682A (en) multi-channel implementation method based on alliance chain
US10168956B2 (en) Correcting overlapping data sets in a volume
CN115658391A (en) Backup recovery method of WAL mechanism based on QianBase MPP database
US8990161B1 (en) System and method for single segment backup

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

Application publication date: 20170503

RJ01 Rejection of invention patent application after publication