CN105511804A - Hard disk mounting method and system - Google Patents

Hard disk mounting method and system Download PDF

Info

Publication number
CN105511804A
CN105511804A CN201510836645.3A CN201510836645A CN105511804A CN 105511804 A CN105511804 A CN 105511804A CN 201510836645 A CN201510836645 A CN 201510836645A CN 105511804 A CN105511804 A CN 105511804A
Authority
CN
China
Prior art keywords
hard disk
carry
new
current
format type
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
CN201510836645.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.)
Opzoon Technology Co Ltd
Original Assignee
Opzoon 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 Opzoon Technology Co Ltd filed Critical Opzoon Technology Co Ltd
Priority to CN201510836645.3A priority Critical patent/CN105511804A/en
Publication of CN105511804A publication Critical patent/CN105511804A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a hard disk mounting method and system. The method comprises following steps: obtaining average utilization rates of all current CPUs when a new disk is detected and usage proportions of all current hard disk capabilities; and determining whether the new disk is mounted or not according to average utilization rates and usage proportions.The hard disk mounting method and system have following beneficial effects: after the system recognizes the addition of the new hard disk, formatting mounting operation is not immediately performed on the hard disk; and the system firstly determines whether the new disk is mounted or not by a judgment according to average utilization rates of all current CPUs and usage proportions of all current hard disk capabilities; when the new disk is needed to be mounted, the system automatically starts to format the new disk and set up a catalog a and perform a series of mounting operation based on an instruction; mounting operation is carried out without manual operation; and the problem in the prior art that hard disk equipment can be recognized but not used is solved.

Description

Hard disk hanging method and system
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of based on the hard disk hanging method under embedded system and system.
Background technology
In embedded systems, such as hardware firewall, router etc. equipment all comprises at least one CF card, or one piece of hard disk, sometimes need dynamically for this equipment adds new hard disk, but under normal circumstances, but embedded device can identify this hard disk can not carry automatically, that is hard disc apparatus can have been identified, but this equipment but can not use.
Summary of the invention
The invention provides a kind of hard disk hanging method and system, can hard disc apparatus have been identified for solving system in prior art, but non-serviceable problem.
First aspect, the invention provides a kind of hard disk hanging method, comprising:
When new hard disk being detected, obtain the average utilization of current all CPU, and the usage ratio of current all hard-disk capacities;
Judge whether to carry out carry to described new hard disk according to described average utilization and described usage ratio.
Further, judge whether to carry out carry to described new hard disk by following formula according to described average utilization and described usage ratio:
X+ (1-Y)/n > ε, wherein, X is the usage ratio of current all hard-disk capacities, and Y is the average utilization of current all CPU, and n is the number of CPU, and ε is predetermined threshold value coefficient.
Further, if X+ (1-Y)/n > ε sets up, then carry is carried out to new hard disk; Otherwise new hard disk is vacant.
Further, the step of Format Type is selected when also comprising new hard disk carry.
Further, the step of described selection Format Type comprises:
Obtain the Format Type of current all hard disks;
Add up the number of each Format Type;
If the statistics number of one of them Format Type is maximum, then new hard disk form type is this Format Type;
If the statistics number that there are two or more Format Types is identical, then calculate hard disk total volume size belonging to often kind of Format Type, new hard disk form type is Format Type belonging to the maximum hard disk of total volume.
Further, also comprise: in carry process, system sets up hard disk catalogue successively according to the carry order of new hard disk.
Further, also comprise: when under present hard discs catalogue, carry hard disk remaining capacity is less than or equal to predetermined threshold value, system under automatically switching to next hard disk catalogue carry hard disk to be used use.
On the other hand, the invention provides a kind of based on the hard disk carry system under above-mentioned hard disk hanging method, comprising:
Hard disk detection module, for detecting whether added new hard disk;
Data acquisition module, for the usage ratio of the average utilization and current all hard-disk capacities that obtain current all CPU respectively;
Carry judge module, for carrying out judging and obtaining judged result according to described average utilization and described usage ratio;
Hard disk carry module, carries out carry according to judged result to new hard disk.
Further, also comprise format selection module, for the Format Type of all hard disks current in acquisition system, and distribute Format Type according to the statistics of Format Type to carry hard disk.
Further, also comprise catalogue and set up module, set up hard disk catalogue successively for the carry order according to new hard disk.
As shown from the above technical solution, this method after system identification adds to new hard disk, can not carry out format carry to this hard disk immediately.First system can be passed through to judge to determine whether to need new hard disk carry according to the average utilization of current all CPU and current all hard-disk capacity usage ratios.When the new hard disk of needs carry, then system automatically starts new formatting hard disk according to instruction, sets up a series of carry actions such as catalogue.Accomplish to carry out carry without the need to manual operation, the system in prior art that solves can identify hard disc apparatus, but non-serviceable problem.
Accompanying drawing explanation
The schematic flow sheet of the hard disk hanging method that Fig. 1 provides for one embodiment of the invention;
The structural representation of the hard disk carry system that Fig. 2 provides for another embodiment of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples for illustration of the present invention, but are not used for limiting the scope of the invention.
Fig. 1 shows one embodiment of the invention and provides a kind of based on the hard disk hanging method under embedded system, comprising:
New hard disk after S1, systems axiol-ogy to interpolation;
S2, system obtain the average utilization of current all CPU, this average utilization Y=(y1+y2+ ... + yn)/n, wherein y1, y2 ... yn is the utilization factor of each CPU respectively, and n is the CPU number in system.
S3, system obtain the usage ratio X of current all hard-disk capacities.
According to described average utilization and described usage ratio, S4, system judge whether described new hard disk carries out carry.
Further, the formula whether carrying out foundation in the judgement of carry at described new hard disk is: X+ (1-Y)/n > ε, wherein, X is the usage ratio of current all hard-disk capacities, Y is the average utilization of current all CPU, n is the number of CPU in system, and ε is predetermined threshold value coefficient.According to above-mentioned acquisition judged result be: if X+ (1-Y)/n > ε sets up, then carry is carried out to new hard disk; Otherwise new hard disk is vacant.
System carries out carry according to judged result to the new hard disk recognized.Carry out in carry process to new hard disk, system can complete the format to new hard disk according to various instruction automatically, and subregion, sets up the actions such as catalogue, to complete carry work.
For above-mentioned method step, with specific embodiment, this is explained.Utilization factor as there is four CPU, each CPU in system is respectively 10%, 50%, 80% and 20%.So average utilization Y=(10%+50%+80%+20%)/4=40%.The usage ratio X=80% of current all hard-disk capacities.So hard disk carry judgment formula: X+ (1-Y)/n=0.8+ (1-0.4)/4=0.95.Predetermined threshold value coefficient ε=0.8 under normal circumstances, then 0.95 > 0.8.At this moment, system just start to identification and not yet the new hard disk of carry carry out carry.As also in said system, the usage ratio X=60% of current all hard-disk capacities.So hard disk carry judgment formula: X+ (1-Y)/n=0.6+ (1-0.4)/4=0.75.Predetermined threshold value coefficient ε=0.8 under normal circumstances, then 0.75 < 0.8.At this moment, system does not carry out carry to the new hard disk recognized.
Explain explanation further, this method is being carried out in carry process to the new hard disk recognized, and also needs to select Format Type to new hard disk.Its step comprises:
System can judge to obtain the Format Type of current all hard disks and add up the number of each Format Type.
If the statistics number of certain Format Type is maximum, then belonging to new hard disk, Format Type is given tacit consent to this Format Type of selection.
If the statistics number that there is two or more Format Type is identical, then calculate hard disk total volume size belonging to often kind of Format Type, new hard disk form type is Format Type belonging to the maximum hard disk of total volume.
For the selection of the Format Type of the new hard disk of above-mentioned carry, be described by specific embodiment.If there are three hard disks in system, wherein two is ext4 form, and one is ext3 form, then the Format Type of carry hard disk just selects ext4 form.If there are four hard disks in system, two is ext4 form, and total volume size is 100G; Two is ext3 form, and total volume size is 200G.Then the Format Type of carry hard disk just selects ext3 form.
Explain explanation further again: this method is being carried out in carry process to the new hard disk recognized, also need to set up hard disk catalogue to new hard disk.System can set up hard disk catalogue successively according to the carry order of new hard disk.Such as it sets up catalogue/tmpN, and wherein N increases along with the number of carry hard disk and increases, and such as adds the tenth piece of new hard disk, then sets up catalogue/tmp10, and by the hard disk carry that just formatd in newly-built catalogue.
If system continues content to write in carry hard disk, when under present hard discs catalogue, carry hard disk remaining capacity is less than or equal to predetermined threshold value, system is carry hard disk continuation write to be used under automatically switching to next hard disk catalogue.As present hard discs is mounted to/tmp8, when hard drive space residual capacity is 10%, then system automatically switches to/tmp9, continues to write on the hard disk under/tmp9.
This method after system identification adds to new hard disk, can not carry out format carry to this hard disk immediately.First system can be passed through to judge to determine whether to need new hard disk carry according to the average utilization of current all CPU and current all hard-disk capacity usage ratios.When the new hard disk of needs carry, then system automatically starts new formatting hard disk according to instruction, sets up a series of carry actions such as catalogue.Accomplish to carry out carry without the need to manual operation, the system in prior art that solves can identify hard disc apparatus, but non-serviceable problem.
In order to achieve the above object, as shown in Figure 2, the invention provides a kind of based on the hard disk carry system under above-mentioned hard disk hanging method, comprising:
Hard disk detection module, for detecting whether added new hard disk.If detect and add new hard disk, then other functional modules carry out work.Otherwise other functional modules do not carry out work.
Data acquisition module, for the use capacity of the average utilization and current all hard disks that obtain current all CPU respectively;
Carry judge module, for obtaining judged result according to described average utilization and described use capacity according to hard disk carry judgment formula;
Hard disk carry module, carries out carry according to judged result to new hard disk.
Format selection module, for obtaining the Format Type of current all hard disks, and distributes Format Type according to the statistics of Format Type to carry hard disk.
Catalogue sets up module, sets up hard disk catalogue for system successively according to the carry order of new hard disk.
Native system designs based on above-mentioned hard disk hanging method, and its implementation is all identical with the principle process of above-mentioned hard disk hanging method.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
One of ordinary skill in the art will appreciate that: above each embodiment, only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of the claims in the present invention.

Claims (10)

1. a hard disk hanging method, is characterized in that, comprising:
When new hard disk being detected, obtain the average utilization of current all CPU, and the usage ratio of current all hard-disk capacities;
Judge whether to carry out carry to described new hard disk according to described average utilization and described usage ratio.
2. hard disk hanging method according to claim 1, is characterized in that, judges whether to carry out carry to described new hard disk by following formula according to described average utilization and described usage ratio:
X+ (1-Y)/n > ε, wherein, X is the usage ratio of current all hard-disk capacities, and Y is the average utilization of current all CPU, and n is the number of CPU, and ε is predetermined threshold value coefficient.
3. hard disk hanging method according to claim 2, is characterized in that, if X+ (1-Y)/n > ε sets up, then carries out carry to new hard disk; Otherwise new hard disk is vacant.
4. hard disk hanging method according to claim 1, is characterized in that, selects the step of Format Type when also comprising new hard disk carry.
5. hard disk hanging method according to claim 4, is characterized in that, the step of described selection Format Type comprises:
Obtain the Format Type of current all hard disks;
Add up the number of each Format Type;
If the statistics number of one of them Format Type is maximum, then new hard disk form type is this Format Type;
If the statistics number that there are two or more Format Types is identical, then calculate hard disk total volume size belonging to often kind of Format Type, new hard disk form type is Format Type belonging to the maximum hard disk of total volume.
6. hard disk hanging method according to claim 1, is characterized in that, also comprise: in carry process, and system sets up hard disk catalogue successively according to the carry order of new hard disk.
7. hard disk hanging method according to claim 6, it is characterized in that, also comprise: when under present hard discs catalogue, carry hard disk remaining capacity is less than or equal to predetermined threshold value, system under automatically switching to next hard disk catalogue carry hard disk to be used use.
8., based on the hard disk carry system under hard disk hanging method described in claim arbitrary in the claims 1-7, it is characterized in that, comprising:
Hard disk detection module, for detecting whether added new hard disk;
Data acquisition module, for the usage ratio of the average utilization and current all hard-disk capacities that obtain current all CPU respectively;
Carry judge module, for carrying out judging and obtaining judged result according to described average utilization and described usage ratio;
Hard disk carry module, carries out carry according to judged result to new hard disk.
9. hard disk carry system according to claim 8, is characterized in that, also comprise format selection module, for obtaining the Format Type of current all hard disks, and distributes Format Type according to the statistics of Format Type to carry hard disk.
10. hard disk carry system according to claim 8, is characterized in that, also comprise catalogue and set up module, sets up hard disk catalogue successively for the carry order according to new hard disk.
CN201510836645.3A 2015-11-25 2015-11-25 Hard disk mounting method and system Pending CN105511804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510836645.3A CN105511804A (en) 2015-11-25 2015-11-25 Hard disk mounting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510836645.3A CN105511804A (en) 2015-11-25 2015-11-25 Hard disk mounting method and system

Publications (1)

Publication Number Publication Date
CN105511804A true CN105511804A (en) 2016-04-20

Family

ID=55719824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510836645.3A Pending CN105511804A (en) 2015-11-25 2015-11-25 Hard disk mounting method and system

Country Status (1)

Country Link
CN (1) CN105511804A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368308A (en) * 2017-07-06 2017-11-21 苏州蜗牛数字科技股份有限公司 A kind of method and device of android game hosts loading fdisk as data partition
CN109189332A (en) * 2018-08-14 2019-01-11 北京锐安科技有限公司 A kind of disk hanging method, device, server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368308A (en) * 2017-07-06 2017-11-21 苏州蜗牛数字科技股份有限公司 A kind of method and device of android game hosts loading fdisk as data partition
CN109189332A (en) * 2018-08-14 2019-01-11 北京锐安科技有限公司 A kind of disk hanging method, device, server and storage medium

Similar Documents

Publication Publication Date Title
EP3142011B1 (en) Anomaly recovery method for virtual machine in distributed environment
US10846186B2 (en) Central processing unit CPU hot-remove method and apparatus, and central processing unit CPU hot-add method and apparatus
CN104813622A (en) Data collection and transfer device
CN106294222A (en) A kind of method and device determining PCIE device and slot corresponding relation
CN104598364A (en) Method for monitoring power consumption of load equipment in server system
CN104020960A (en) Method and device for conducting partition formatting and mounting on hard disk
CN103559124A (en) Fast fault detection method and device
CN105740122A (en) Method and system for monitoring mobile phone memory leak
CN109254839A (en) It determines the method in task triggered time, construct the method and system of task timer
CN103218276A (en) Method and system for multi-node incremental backup
CN106155826B (en) For the method and system of mistake to be detected and handled in bus structures
CN105511804A (en) Hard disk mounting method and system
CN105630657A (en) Temperature detection method and device
CN102902801B (en) Voltmeter address retrieval method, related equipment and system
CN105740118A (en) Chip exception detection method and apparatus as well as circuit panel exception detection method and apparatus
CN104572329A (en) Fault determination method and device
US20220191113A1 (en) Method and apparatus for monitoring abnormal iot device
CN104598243A (en) Multi-user application program management method and device applied to intelligent terminal
CN112866061A (en) NCSI (network control information system) testing method, device, equipment and medium of onboard network port
CN111858244A (en) Hard disk monitoring method, system, device and medium
CN109271096A (en) NVME storage expansion system
CN105389233A (en) Dual-system state parameter storage method, first system and dual-system terminal
CN106030544B (en) Method for detecting memory of computer equipment and computer equipment
CN106776135A (en) A kind of data back up method and device
CN101369238A (en) Exception monitoring and reset processing method for USB equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination