CN107688510A - A kind of method and system of quick clone hard disc data - Google Patents

A kind of method and system of quick clone hard disc data Download PDF

Info

Publication number
CN107688510A
CN107688510A CN201710749163.3A CN201710749163A CN107688510A CN 107688510 A CN107688510 A CN 107688510A CN 201710749163 A CN201710749163 A CN 201710749163A CN 107688510 A CN107688510 A CN 107688510A
Authority
CN
China
Prior art keywords
source tray
thread
file
hard disc
clone
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
CN201710749163.3A
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 CN201710749163.3A priority Critical patent/CN107688510A/en
Publication of CN107688510A publication Critical patent/CN107688510A/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/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • 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/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup
    • 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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space

Abstract

The invention discloses a kind of method and system of quick clone hard disc data.Method includes obtaining the position of source tray and destination disk;Source tray file is segmented;Destination disk is cloned into by every section of source tray file simultaneously.System includes searching modul, document processing module and cloning module, and searching modul is used for the position for obtaining source tray and destination disk, and document processing module is used to source tray file being segmented, and cloning module is used to make every section of source tray file while is cloned into destination disk.The present invention carries out the clone of file using multithreading simultaneously, greatly improves operating efficiency.

Description

A kind of method and system of quick clone hard disc data
Technical field
The present invention relates to field of computer technology, specifically a kind of method and system of quick clone hard disc data.
Background technology
With the popularization of computer and the rapid development of the progress of information technology, particularly computer network, information security Importance become clear day by day.But as information security an important content --- the importance of data backup is but often by people Ignored.As long as generation data transfer, data storage and exchange, it is possible to produce data fault.At this moment, if do not had Data backup and data recovery ways and measure are taken, may result in the loss of data.Sometimes loss caused by is can not be more Mend and appraisal.
Under linux system, we will back up to hard disc data, be adjusted usually using the copy or use of file system Cloned with backup command.The type of data during hard disk is used is limited to using the copy of file system, calls backup command to make It is single thread clone, this method efficiency is low, and as present hard drive space is increasing, clone needs to expend largely Time, can not meet the demand of present business.
The content of the invention
It is an object of the invention to provide a kind of method and system of quick clone hard disc data, for solving existing clone Method efficiency is low, can not meet the problem of business demand.
The technical solution adopted for the present invention to solve the technical problems is:A kind of method of quick clone hard disc data, bag Include following steps:
Obtain the position of source tray and destination disk;
Source tray file is segmented;
Destination disk is cloned into by every section of source tray file simultaneously.
Further, the detailed process that source tray file is segmented is:
Set the size of block;
The number for the block that setting includes per segment file;
By source tray file from the beginning, it is divided into multistage as one section according to the block for setting number.
Further, every section of detailed process for being cloned into destination disk simultaneously by source tray file is:
For every section of source tray file, one thread is set;
Specify the terminal of each thread;
Each thread calls clone's order simultaneously, and source tray file is cloned into destination disk.
Further, it is described specify each thread terminal include specify each thread source tray terminal, specify Terminal of each thread in destination disk.
Further, the process for cloning hard disc data is carried out on backstage.
A kind of system of quick clone hard disc data, including
Searching modul, for obtaining the position of source tray and destination disk;
Document processing module, for source tray file to be segmented;
Cloning module, for making every section of source tray file while being cloned into destination disk.
Further, the document processing module also includes
Block processing module, for setting the size of block, the number for the block that setting includes per segment file;
Segmentation module, for from the beginning, according to the block for setting number as one section, source tray file to be divided into multistage.
Further, the cloning module also includes
Resource configuration module, for making every section of disk file take a thread;
Thread management and control module, for specifying the terminal of each thread;
Command calls module, for calling the clone's order of each thread simultaneously, source tray file is cloned into destination disk.
Further, the thread management and control module also includes
Source tray thread management and control module, for specifying each thread in the terminal of source tray;
Destination disk thread management and control module, for specifying each thread in the terminal of destination disk.
Further, the system also includes operating path module, for providing the clone path of hard disc data, the road Footpath makes the process of clone's hard disc data in running background.
The effect provided in the content of the invention is only the effect of embodiment, rather than whole effects that invention is all, above-mentioned A technical scheme in technical scheme has the following advantages that or beneficial effect:
1st, will be segmented with source tray file, the file after segmentation is cloned into destination disk simultaneously, and multithreading is carried out pair simultaneously The clone of file, greatly improves operating efficiency.
The 2nd, the terminal of each clone's thread is set respectively in source tray and destination disk, avoid multistage while file occurs in clone Transmit process is slipped up or the phenomenon of confusion, ensures the accuracy of file clone.
3rd, number of threads or every section of number for including blocks of files are adjusted according to the size of hard disk, operation is flexible, operator Member can be set according to being actually needed, simple and convenient.
4th, the cloning procedure of DISK to Image data is carried out on backstage, does not influence the operation of other programs on computer.
5th, the clone's order used is the clone based on bottom data block, it is not necessary to the data type on relation hard disk, application It is in extensive range.
Brief description of the drawings
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is the system construction drawing of the present invention.
Embodiment
For the technical characterstic for illustrating this programme can be understood, below by embodiment, and its accompanying drawing is combined, to this hair It is bright to be described in detail.Following disclosure provides many different embodiments or example is used for realizing the different knots of the present invention Structure.In order to simplify disclosure of the invention, hereinafter the part and setting of specific examples are described.In addition, the present invention can be with Repeat reference numerals and/or letter in different examples.This repetition is that for purposes of simplicity and clarity, itself is not indicated Relation between various embodiments are discussed and/or set.It should be noted that part illustrated in the accompanying drawings is not necessarily to scale Draw.Present invention omits the description to known assemblies and treatment technology and process to avoid being unnecessarily limiting the present invention.
The method and system that following examples describe quick clone hard disc data is carried out based on (SuSE) Linux OS.
As shown in figure 1, a kind of method of quick clone hard disc data of the present invention, comprises the following steps:
S1, obtain the position of source tray and destination disk;
S2, source tray file is segmented;
S3, destination disk is cloned into simultaneously by every section of source tray file.
In step S1, the one embodiment for obtaining source tray and destination disk position is:Life is called using hard disk under linux system Make if=/dev/sda and of=/dev/sdb, wherein if=/dev/sda is the source tray device file to be cloned, of=/dev/ Sdb is the destination disk device file of clone.
In step S2, it is by the detailed process that source tray file is segmented:
S21, set the size of block;
S22, set the number of the block included per segment file;
S23, according to the block for setting number as one section, it is divided into multistage by source tray file from the beginning.
In step S21, the big I for setting block is set according to the size of the fixed disk file to be cloned, sets block size One embodiment is bs=1024k, means the block size of clone being set to 1024k.
In step S22, the number of the block included per segment file is set, equally can be according to the size of the fixed disk file to be cloned To set, one embodiment of number of the block included per segment file is set as count=100000,10000 will not had by meaning Individual block is set as one section.
In step S23, source tray file is segmented, according to the number of the every section of block included set in step S22, is Source file from the beginning, every the block number set as one section, is divided into multistage.
In step S3, every section that makes source tray file while the detailed process that is cloned into destination disk are:
S31, it is that every section of source tray file sets a thread;
S32, specify the terminal of each thread;
S33, each thread call clone's order simultaneously, and source tray file is cloned into destination disk.
In step S31, the section that is set by step S2, every section of source tray file is set to take a thread, the behaviour of each thread Make independent progress, be independent of each other.
Specified in step S32 each ready-made terminal include specifying each thread source tray terminal, specify it is each Terminal of the thread in destination disk.After making each section to take a thread, clone's order is called respectively, it is necessary to find rising for task Stop, so that cloning procedure more without any confusion, is accurately carried out.The one embodiment for giving directions each thread is skip= 100000, look like for specify the thread source tray terminal, be specially:Source tray skips 100000 blocks from the outset during clone; Seek=100000, look like for specify each thread destination disk terminal, be specially:Destination disk is skipped from the outset during clone 100000 blocks.
It is illustrated below for the embodiment of the above method:
With under linux system, exemplified by the file clone between two pieces of 600GB hard disks, implementor name is respectively/dev/sda and/ Dev/sda, following several processes are run simultaneously now, hard disk/dev/sda file fragmentation is cloned into hard disk/dev/ simultaneously In sda:
Dd1 if=/dev/sda of=/dev/sdb bs=1024k count=100000&
Dd2 if=/dev/sda of=/dev/sdb bs=1024k skip=100000 seek=100000 Count=100000&
Dd3 if=/dev/sda of=/dev/sdb bs=1024k skip=200000 seek=200000 Count=100000&
Dd4 if=/dev/sda of=/dev/sdb bs=1024k skip=300000 seek=300000 Count=100000&
Dd5 if=/dev/sda of=/dev/sdb bs=1024k skip=400000 seek=400000 Count=100000&
Dd6 if=/dev/sda of=/dev/sdb bs=1024k skip=500000 seek=500000 Count=100000&
Wherein be related in foregoing description as if=/dev/sda, of=/dev/sdb, bs=1024k implication no longer Repeat, order source tray when skip=200000, seek=200000 represent thread clone respectively in dd3 to be skipped from the outset 200000 blocks, destination disk file skip 20000 blocks from the outset, because 10000 blocks before being cloned in dd1 threads, i.e., first Section.Before dd2 threads skip preceding 10000 blocks, rear 10000 blocks are cloned, i.e. second segment, and dd1 and dd2 are responsible for clone 20000 blocks, therefore dd3 threads skip preceding 20000 blocks.By that analogy, the terminal of following thread is set.
In addition, & represents the running background process, the whole process for cloning hard disc data carries out on backstage, does not influence to count Calculation machine other applications or the operation of operation.
By this example above, a disk is divided into 6 sections to be cloned by we, passes through specified each section of clone's Terminal, this 6 sections clones are carried out simultaneously, that is to say, that are 6 threads, compared to conventional cloning methods, the speed of this example carries It is high 6 times.
As shown in Fig. 2 a kind of system of quick clone hard disc data of the present invention, including searching modul 1, file process mould Block 2 and cloning module 3.Wherein searching modul 1 is used for the position for obtaining source tray and destination disk, and document processing module 2 is used for source Disk file is segmented, and cloning module 3 is used to make every section of source tray file while is cloned into destination disk.
Document processing module 2 also includes block processing module 21 and segmentation module 22, and wherein block processing module 21 is used to set The number for the block that the size of block, setting include per segment file, segmentation module 22 are used for source tray file from the beginning, according to setting The block of number is one section, is divided into multistage.
Cloning module 3 also includes resource configuration module 31, thread management and control module 32 and command calls module 33.Wherein resource Configuration module 31 is used to make every section of disk file take a thread, and thread management and control module 32 is used for the start-stop for specifying each thread Point, command calls module 33 are used for the clone's order for calling each thread simultaneously, source tray file are cloned into destination disk.
Thread management and control module 32 also includes source tray thread management and control module 321 and destination disk thread management and control module 322.Source tray line For specifying each thread, in the terminal of source tray, bidding quotation thread management and control module 322 is used to specify each line journey management and control module 321 Terminal of the journey in destination disk.
System also includes operating path module, and for providing the clone path of hard disc data, the path makes clone's hard disk The process of data is in running background.
Simply the preferred embodiment of the present invention described above, for those skilled in the art, Without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications are also regarded as this hair Bright protection domain.

Claims (10)

1. a kind of method of quick clone hard disc data, it is characterized in that:Comprise the following steps:
Obtain the position of source tray and destination disk;
Source tray file is segmented;
Destination disk is cloned into by every section of source tray file simultaneously.
2. a kind of method of quick clone hard disc data according to claim 1, it is characterized in that:It is described to enter source tray file Row segmentation detailed process be:
Set the size of block;
The number for the block that setting includes per segment file;
By source tray file from the beginning, it is divided into multistage as one section according to the block for setting number.
3. a kind of method of quick clone hard disc data according to claim 1, it is characterized in that:It is described by source tray file Every section is cloned into the detailed process of destination disk simultaneously and is:
For every section of source tray file, one thread is set;
Specify the terminal of each thread;
Each thread calls clone's order simultaneously, and source tray file is cloned into destination disk.
4. a kind of method of quick clone hard disc data according to claim 3, it is characterized in that:It is described to specify each thread Terminal include specify each thread source tray terminal, specify each thread destination disk terminal.
5. a kind of method of quick clone hard disc data according to claim any one of 1-4, it is characterized in that:Clone hard disk The process of data is carried out on backstage.
6. a kind of system of quick clone hard disc data, it is characterized in that:Including
Searching modul, for obtaining the position of source tray and destination disk;
Document processing module, for source tray file to be segmented;
Cloning module, for making every section of source tray file while being cloned into destination disk.
7. a kind of system of quick clone hard disc data according to claim 6, it is characterized in that:The document processing module Also include
Block processing module, for setting the size of block, the number for the block that setting includes per segment file;
Segmentation module, for from the beginning, according to the block for setting number as one section, source tray file to be divided into multistage.
8. a kind of system of quick clone hard disc data according to claim 6, it is characterized in that:The cloning module also wraps Include
Resource configuration module, for making every section of disk file take a thread;
Thread management and control module, for specifying the terminal of each thread;
Command calls module, for calling the clone's order of each thread simultaneously, source tray file is cloned into destination disk.
9. a kind of system of quick clone hard disc data according to claim 8, it is characterized in that:The thread management and control module Also include
Source tray thread management and control module, for specifying each thread in the terminal of source tray;
Destination disk thread management and control module, for specifying each thread in the terminal of destination disk.
10. a kind of system of quick clone hard disc data according to claim any one of 6-9, it is characterized in that:The system System also includes operating path module, and for providing the clone path of hard disc data, the path makes the process of clone's hard disc data In running background.
CN201710749163.3A 2017-08-28 2017-08-28 A kind of method and system of quick clone hard disc data Pending CN107688510A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710749163.3A CN107688510A (en) 2017-08-28 2017-08-28 A kind of method and system of quick clone hard disc data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710749163.3A CN107688510A (en) 2017-08-28 2017-08-28 A kind of method and system of quick clone hard disc data

Publications (1)

Publication Number Publication Date
CN107688510A true CN107688510A (en) 2018-02-13

Family

ID=61155568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710749163.3A Pending CN107688510A (en) 2017-08-28 2017-08-28 A kind of method and system of quick clone hard disc data

Country Status (1)

Country Link
CN (1) CN107688510A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120144108A1 (en) * 2005-02-17 2012-06-07 Overland Storage, Inc. Data protection systems with multiple site replication
CN105373339A (en) * 2014-08-29 2016-03-02 深圳市金胜电子科技有限公司 Hard disk data copy method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120144108A1 (en) * 2005-02-17 2012-06-07 Overland Storage, Inc. Data protection systems with multiple site replication
CN105373339A (en) * 2014-08-29 2016-03-02 深圳市金胜电子科技有限公司 Hard disk data copy method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张萌: "一种移动硬盘的备份软件的开发", 《中国科技信息》 *
王臻: "海量硬盘数据快速复制技术研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Similar Documents

Publication Publication Date Title
US20140376362A1 (en) Dynamic client fail-over during a rolling patch installation based on temporal server conditions
CN104461744A (en) Resource allocation method and device
CN106558305B (en) Voice data processing method and device
CN106201690A (en) Application progress control method and device
TW201322134A (en) System and method for managing virtual machines
CN103218260A (en) Virtual machine migration method and device
CN110347407A (en) A kind of method, apparatus, computer equipment and medium obtaining EMS memory occupation amount
CN109032507A (en) A kind of method, system and associated component generating source book storage snapshot
CN106899654A (en) A kind of sequence value generation method, apparatus and system
WO2021104383A1 (en) Data backup method and apparatus, device, and storage medium
CN112465032A (en) Distribution method and device of training data labeling tasks and computing equipment
CN102368836A (en) Method for realizing flexible configuration transference between passive optical network (PON) ports
CN107153680B (en) Method and system for on-line node expansion of distributed memory database
CN104951519A (en) Method and device for generating serial numbers
CN103885811A (en) Device, system and method for system-wide online migration of virtual machine system
CN105610899A (en) Text file parallel uploading method and device
CN111163149A (en) Intelligent contract platform method based on block chain
CN110019260B (en) User data updating method and related equipment
US20210303162A1 (en) Method, electronic device, and computer program product for recovering data
CN107688510A (en) A kind of method and system of quick clone hard disc data
WO2024055529A1 (en) Placement group member selection method and apparatus, device, and readable storage medium
CN108235133B (en) Video identification method and device
CN108198582B (en) NAND Flash control method and device and SSD
CN103064766A (en) Fast data synchronization method in continuous data protection technology
CN112363671B (en) Virtual machine template mirror image storage method based on fusion framework cloud platform

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: 20180213

RJ01 Rejection of invention patent application after publication