CN106897229A - A kind of fdisk method and system - Google Patents

A kind of fdisk method and system Download PDF

Info

Publication number
CN106897229A
CN106897229A CN201710113581.3A CN201710113581A CN106897229A CN 106897229 A CN106897229 A CN 106897229A CN 201710113581 A CN201710113581 A CN 201710113581A CN 106897229 A CN106897229 A CN 106897229A
Authority
CN
China
Prior art keywords
mbr
former
new
free block
fdisk
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
CN201710113581.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 CN201710113581.3A priority Critical patent/CN106897229A/en
Publication of CN106897229A publication Critical patent/CN106897229A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration

Abstract

This application discloses a kind of fdisk method, including:Using former MBR, the partitioned organization of hard disk is read, find free block;New MBR is generated, and covers former MBR, the partitioned organization after subregion is carried out using new MBR record free block.It can be seen that, the application is using former MBR, the free block of hard disk is found, and generates new MBR, and new MBR is covered into former MBR, so that the free block that fdisk structure is changed into new MBR record carries out the partitioned organization after subregion, in sum, carry out subregion using free block and do not interfere with legacy data, generate new MBR, 4 index relatives of subregion can be re-established, so as to increased main partition.In addition, disclosed herein as well is a kind of fdisk system.

Description

A kind of fdisk method and system
Technical field
The present invention relates to disk partition field, more particularly to a kind of fdisk method and system.
Background technology
With the development of science and technology single system computer is difficult to meet the demand of people sometimes, dual system even multisystem Using gradually becoming normality.The installation of multisystem will use the use of MBR, in order to carry out subregion to hard disk, with Multisystem is set to be mountable in hard disk.
0 cylinder of hard disk, 0 magnetic head, 1 sector are referred to as MBR, and MBR is made up of three parts, main boot Program, hard disk partition table and subregion effective marker, main bootstrap program accounts for 446 words in the MBS of 512 bytes altogether Section, Part II is hard disk partition table, accounts for 64 bytes, and the size of how many and each subregion of subregion is all remembered at it in hard disk In, Part III is magic number, accounts for 2 bytes, is fixed as 0xAA55 or 0x55AA.
In the prior art, there are many operating systems, such as Windows series:XP, Vista, Win7, Win8, Win10, this The operating system of a little Windows series typically all can at least take a main partition, and what is had can also account for 2~4 main partitions, such as System recovers subregion etc.;Any (SuSE) Linux OS installed using Grub, also at least needs a main partition;FreeBSD Also a main partition is at least needed, and MBR can only distribute 4 subregions, it can be seen that being limited to MBR Subregion limitation when multiple operating system is installed, it is found that the inadequate situation in main partition, and then be difficult to install new operation System, it is difficult to increase main partition in the case where available data is retained, be inconvenient.
Therefore, how main partition is increased in the case where available data is retained, as the problem for needing to break through.
The content of the invention
In view of this, it is an object of the invention to provide a kind of fdisk method and system, with not to preserving number In the case of being changed according to Jining, increase main partition.Its concrete scheme is as follows:
A kind of fdisk method, including:
Using former MBR, the partitioned organization of hard disk is read, find free block;
New MBR is generated, and covers former MBR, entered using free block described in the new MBR Partitioned organization after row subregion.
Preferably, the process of the new MBR of generation, including:
Judge the idle block size whether more than predetermined threshold value;
If it is determined that the free block size is more than the threshold value, then the new MBR is generated.
Preferably, the new MBR of generation, and former MBR is covered, using the new MBR institute Before partitioned organization after stating free block and carrying out subregion, also include:
The former MBR is saved in the free block in the form of disk block.
Preferably, the new MBR of generation, and former MBR is covered, using the new MBR institute Before partitioned organization after stating free block and carrying out subregion, also include:
The former MBR is saved in the free block in the form of disk block.
Preferably, it is described subregion is carried out to the free block using the new MBR after, also include:
Using the positional information of the described former MBR preserved in the new MBR, by the former main boot The record backup covering new MBR, to recover the partitioned organization of former MBR.
The invention also discloses a kind of fdisk system, including:
Searching modul, for using former MBR, reading the partitioned organization of hard disk, finds free block;
Division module, for generating new MBR, and covers former MBR, using the new MBR The free block carries out the partitioned organization after subregion.
Preferably, the division module, including:
Judging unit, for judging the idle block size whether more than predetermined threshold value;
Zoning unit, if it is determined that being more than the threshold value for the free block size, then generates the new main boot note Record.
Preferably, also include:
Backup module, for the former MBR to be saved in the free block in the form of disk block.
Preferably, the backup module, specifically for the former MBR is saved in into institute in the form of disk block In stating the original position of free block.
Preferably, also include:
Restoration module, for the positional information using the described former MBR preserved in the new MBR, By the former MBR backup covering new MBR, to recover the partitioned organization of former MBR.
In the present invention, fdisk method, including:Using former MBR, the partitioned organization of hard disk is read, found Free block;New MBR is generated, and covers former MBR, subregion is carried out using new MBR record free block Partitioned organization afterwards.It can be seen that, the present invention finds the free block of hard disk using former MBR, and generates new main boot note Record, and new MBR is covered into former MBR so that fdisk structure is changed into the sky of new MBR record Not busy block carries out the partitioned organization after subregion, in sum, carries out subregion using free block and does not interfere with legacy data, and generation is new MBR, can re-establish 4 index relatives of subregion, so as to increased main partition.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of fdisk method flow schematic diagram disclosed in the embodiment of the present invention;
Fig. 2 is another fdisk method flow schematic diagram disclosed in the embodiment of the present invention;
Fig. 3 is a kind of fdisk system structure diagram disclosed in the embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
The embodiment of the invention discloses a kind of fdisk method, shown in Figure 1, the method includes:
Step S11:Using former MBR, the partitioned organization of hard disk is read, find free block;
It is understood that former MBR is to be located at disk one section of guidance code foremost, it is responsible for disk operating The differentiation of subregion legitimacy, the positioning of subregion guidance information when system is written and read to disk, it is by disc operating system right Produced when hard disk is initialized, be made up of three parts, main bootstrap program, hard disk partition table and subregion effective marker, Main bootstrap program accounts for 446 bytes in the MBS of 512 bytes altogether, and Part II is hard disk partition table, accounts for 64 words Section, the size of how many and each subregion of subregion all remembers that wherein, Part III is magic number in hard disk, accounts for 2 bytes, fixed It is 0xAA55 or 0x55AA.
Specifically, present hard discs partitioned organization is record in former MBR, using the hard disk in former MBR Partition table and main bootstrap program, can find the free block in present hard discs, that is, the hard disk block not being partitioned.
Step S12:New MBR is generated, and covers former MBR, entered using new MBR free block Partitioned organization after row subregion.
Specifically, after free block is found, subregion is carried out to free block according to practical application request, for example, by free block Three one, main partitions expansion area is divided into, or is divided into two main partitions Liang Ge expansion areas, and generated relative with operating system The new MBR answered, new MBR is saved in the starting block of hard disk in the form of disk block, that is, cover former master and draw Record is led, record free block is carried out into the partitioned organization after subregion in new MBR, lived again and set up the index relative of subregion.
It is understood that the partition sections described in former MBR, are not remembered in new MBR Record and subregion, so former subregion would not take the subregion planned number of new MBR, and new subregion does not interfere with former subregion yet In data.
It should be noted that MBR can be generated first, then subregion is carried out to free block, generation MBR will As the subregion of free block is updated, it is ensured that the establishment of index relative;Subregion first can also be carried out to free block, using subregion Partitioned organization afterwards, generates new MBR.
It can be seen that, the present invention finds the free block of hard disk using former MBR, and generates new MBR, and New MBR is covered into former MBR so that the free block that fdisk structure is changed into new MBR record enters Partitioned organization after row subregion, in sum, carries out subregion and does not interfere with legacy data using free block, generates new main boot Record, can re-establish 4 index relatives of subregion, so as to increased main partition.
The embodiment of the invention discloses a kind of specific fdisk method, relative to a upper embodiment, the present embodiment pair Technical scheme has made further instruction and optimization.It is shown in Figure 2, specifically:
Step S21:Using former MBR, the partitioned organization of hard disk is read, find free block.
Step S22:Judge idle block size whether more than predetermined threshold value.
It is understood that in actual applications, the idle block size of hard disk differs making after surely meeting user partition With demand, for example, installation operation system is needed after user partition, too small free block, it is difficult to installation operation system, therefore, it is After avoiding user from re-starting subregion, it is found that space is difficult to meet the problem of demand, free time size can be judged before subregion Whether demand is met.
Specifically, user can be according to practical application request, preset threshold value, for judging whether idle block size is full Sufficient demand, when idle block size exceedes threshold value, then illustrates that idle block size meets demand, when idle block size is less than threshold value, then Illustrate that idle block size is unsatisfactory for demand.For example, threshold value can be set as 10G.
Step S23:If it is determined that idle block size is more than threshold value, then new MBR is generated, and cover former main boot Record, the partitioned organization after subregion is carried out using new MBR free block.
Step S24:If it is determined that idle block size is less than threshold value, then subregion is not carried out.
It should be noted that because new MBR can cover former MBR, therefore, use new MBR Will be unable to access the data in the corresponding subregion of former MBR, and after former MBR is lost, will be unable to re-start Access, therefore, in the new MBR of generation, and former MBR is covered, divided using new MBR free block Before partitioned organization behind area, i.e. subregion, former MBR is saved in free block in the form of disk block, accordingly even when point Qu Hou, former MBR is still preserved can be searched in a hard disk.
It is understood that after the former MBR of backup, it is possible to use the original master preserved in new MBR draws The positional information of record is led, by the former MBR backup new MBR of covering, to recover the subregion of former MBR Structure.
Specifically, after subregion, user simply may temporarily build main partition is used for Test Operating System, when user test is complete , it is necessary to partitioned organization is reverted into the structure before test after finishing, therefore the original master preserved in new MBR can be utilized to draw The positional information that record is preserved in a hard disk is led, former MBR is found, and the backup covering of former MBR is new main Leader record, so as to recover former partitioned organization.
Wherein, new MBR just saves the former MBR for being pre-stored in free block when creating;Together When, for the ease of searching the original position being saved in former MBR in free block, also ensure that and new operation system is being installed System is to be override easily.
Accordingly, the embodiment of the present invention additionally provides a kind of fdisk system, and shown in Figure 3, the system includes:
Searching modul 11, for using former MBR, reading the partitioned organization of hard disk, finds free block;
Division module 12, for generating new MBR, and covers former MBR, empty using new MBR Not busy block carries out the partitioned organization after subregion.
It can be seen that, the present invention finds the free block of hard disk using former MBR, and generates new MBR, and New MBR is covered into former MBR so that the free block that fdisk structure is changed into new MBR record enters Partitioned organization after row subregion, in sum, carries out subregion and does not interfere with legacy data using free block, generates new main boot Record, can re-establish 4 index relatives of subregion, so as to increased main partition.
Specifically, above-mentioned division module 12, including judging unit and zoning unit;Wherein,
Judging unit, for judging idle block size whether more than predetermined threshold value;
Zoning unit, if it is determined that being more than threshold value for idle block size, then generates new MBR.
Further, in the embodiment of the present invention, can also include:
Backup module, for former MBR to be saved in free block in the form of disk block.
Restoration module, for the positional information using the former MBR preserved in new MBR, original master is drawn The record backup new MBR of covering is led, to recover the partitioned organization of former MBR.
Wherein, above-mentioned backup module, specifically for former MBR is saved in into free block in the form of disk block In original position.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between there is any this actual relation or order.And, term " including ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that A little key elements, but also other key elements including being not expressly set out, or also include for this process, method, article or The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", does not arrange Except also there is other identical element in the process including the key element, method, article or equipment.
A kind of fdisk method and system provided by the present invention are described in detail above, it is used herein Specific case is set forth to principle of the invention and implementation method, and the explanation of above example is only intended to help and understands this The method and its core concept of invention;Simultaneously for those of ordinary skill in the art, according to thought of the invention, specific Be will change in implementation method and range of application, in sum, this specification content should not be construed as to of the invention Limitation.

Claims (10)

1. a kind of fdisk method, it is characterised in that including:
Using former MBR, the partitioned organization of hard disk is read, find free block;
New MBR is generated, and covers former MBR, divided using free block described in the new MBR Partitioned organization behind area.
2. fdisk method according to claim 1, it is characterised in that the process of the new MBR of generation, Including:
Judge the idle block size whether more than predetermined threshold value;
If it is determined that the free block size is more than the threshold value, then the new MBR is generated.
3. fdisk method according to claim 1 and 2, it is characterised in that the new MBR of generation, and cover The former MBR of lid, before carrying out the partitioned organization after subregion using free block described in the new MBR, also includes:
The former MBR is saved in the free block in the form of disk block.
4. the fdisk method according to right wants 3, it is characterised in that it is described by the former MBR with disk block Form be saved in process in the free block, including:
The former MBR is saved in the original position of the free block in the form of disk block.
5. fdisk method according to claim 3, it is characterised in that it is described using the new MBR to institute After stating free block and carrying out subregion, also include:
Using the positional information of the described former MBR preserved in the new MBR, by the former MBR The backup covering new MBR, to recover the partitioned organization of former MBR.
6. a kind of fdisk system, it is characterised in that including:
Searching modul, for using former MBR, reading the partitioned organization of hard disk, finds free block;
Division module, for generating new MBR, and covers former MBR, using described in the new MBR Free block carries out the partitioned organization after subregion.
7. fdisk system according to claim 6, it is characterised in that the division module, including:
Judging unit, for judging the idle block size whether more than predetermined threshold value;
Zoning unit, if it is determined that being more than the threshold value for the free block size, then generates the new MBR.
8. the fdisk system according to claim 6 or 7, it is characterised in that also include:
Backup module, for the former MBR to be saved in the free block in the form of disk block.
9. fdisk system according to claim 8, it is characterised in that the backup module, specifically for will be described During former MBR is saved in the original position of the free block in the form of the disk block.
10. fdisk system according to claim 8, it is characterised in that also include:
Restoration module, for the positional information using the described former MBR preserved in the new MBR, by institute The former MBR backup covering new MBR is stated, to recover the partitioned organization of former MBR.
CN201710113581.3A 2017-02-28 2017-02-28 A kind of fdisk method and system Pending CN106897229A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710113581.3A CN106897229A (en) 2017-02-28 2017-02-28 A kind of fdisk method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710113581.3A CN106897229A (en) 2017-02-28 2017-02-28 A kind of fdisk method and system

Publications (1)

Publication Number Publication Date
CN106897229A true CN106897229A (en) 2017-06-27

Family

ID=59185202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710113581.3A Pending CN106897229A (en) 2017-02-28 2017-02-28 A kind of fdisk method and system

Country Status (1)

Country Link
CN (1) CN106897229A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704199A (en) * 2017-09-07 2018-02-16 郑州云海信息技术有限公司 A kind of logical partition method and device of solid state hard disc
CN109471665A (en) * 2018-10-31 2019-03-15 湖南国科微电子股份有限公司 A kind of method of automatic installation Windows operating system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1340765A (en) * 2000-08-29 2002-03-20 廖瑞民 Method for dividing one hard disk into more partitions separated fully
US20030115443A1 (en) * 2001-12-18 2003-06-19 Cepulis Darren J. Multi-O/S system and pre-O/S boot technique for partitioning resources and loading multiple operating systems thereon
CN1205555C (en) * 2001-11-12 2005-06-08 联想(北京)有限公司 Hard disk data backup and restore method
CN1725182A (en) * 2004-07-22 2006-01-25 国际商业机器公司 Apparatus and method for updating I/O capability of a logically-partitioned computer system
CN103257860A (en) * 2006-04-19 2013-08-21 英特尔公司 Method and apparatus to support independent operating systems in partitions of processing system
CN104484625A (en) * 2014-12-29 2015-04-01 北京明朝万达科技有限公司 Computer with dual operating systems and implementation method thereof
CN105242986A (en) * 2015-09-11 2016-01-13 金步国 Method for backing up and restoring Windows operating system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1340765A (en) * 2000-08-29 2002-03-20 廖瑞民 Method for dividing one hard disk into more partitions separated fully
CN1205555C (en) * 2001-11-12 2005-06-08 联想(北京)有限公司 Hard disk data backup and restore method
US20030115443A1 (en) * 2001-12-18 2003-06-19 Cepulis Darren J. Multi-O/S system and pre-O/S boot technique for partitioning resources and loading multiple operating systems thereon
CN1725182A (en) * 2004-07-22 2006-01-25 国际商业机器公司 Apparatus and method for updating I/O capability of a logically-partitioned computer system
CN103257860A (en) * 2006-04-19 2013-08-21 英特尔公司 Method and apparatus to support independent operating systems in partitions of processing system
CN104484625A (en) * 2014-12-29 2015-04-01 北京明朝万达科技有限公司 Computer with dual operating systems and implementation method thereof
CN105242986A (en) * 2015-09-11 2016-01-13 金步国 Method for backing up and restoring Windows operating system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
IAN SHIELDS: "学习 Linux,101_ 创建分区和文件系统", 《学习 LINUX,101_ 创建分区和文件系统》 *
LINUX_MENG: "mbr备份以及破坏后如何恢复", 《MBR备份以及破坏后如何恢复》 *
何平: "《LINUX管理员指南》", 31 December 1999 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704199A (en) * 2017-09-07 2018-02-16 郑州云海信息技术有限公司 A kind of logical partition method and device of solid state hard disc
WO2019047842A1 (en) * 2017-09-07 2019-03-14 郑州云海信息技术有限公司 Logic partition method for solid state drive and device
CN109471665A (en) * 2018-10-31 2019-03-15 湖南国科微电子股份有限公司 A kind of method of automatic installation Windows operating system
CN109471665B (en) * 2018-10-31 2022-01-11 湖南国科微电子股份有限公司 Method for automatically installing Windows operating system

Similar Documents

Publication Publication Date Title
US7136862B2 (en) Method for creation and management of virtual volumes for DBMs
CN104298559B (en) The method and device of physical host system virtualization
US8479194B2 (en) Virtual machine migration
CN101840362B (en) Method and device for achieving copy-on-write snapshot
CN101770384B (en) Car audio system software upgrading method
CN103605588B (en) A kind of disk backup method of virtue machine
CN101650660B (en) Booting a computer system from central storage
CN100451966C (en) Method and apparatus for discovering hardware in a data processing system
US20050071560A1 (en) Autonomic block-level hierarchical storage management for storage networks
CN104239166A (en) Method for realizing file backup for running virtual machine
WO2016165597A1 (en) Processing method and device for data storage
JP4987307B2 (en) Storage system
CN104238963A (en) Data storage method, device and system
WO2013140446A1 (en) Storage apparatus and method thereof for fast creation of a eager zeroed virtual disk by allocation of pre -zeroed storage areas
CN105468405A (en) Installation processing method and device of application program
CN105677257A (en) Data storage method and electronic equipment
CN101221485A (en) Method for establishing redundant magnetic disk array and control device thereof
CN106897229A (en) A kind of fdisk method and system
CN103605617A (en) Method and device for recording changes in stored data
CN106325872A (en) Multioperation system management method capable of supporting Macintosh computer and multioperation system management device capable of supporting Macintosh computer
CN108459822B (en) Installation method and device of operating system
CN106502830B (en) A kind of method for restoring system backup based on Btrfs file system
US20120005450A1 (en) User control of file data and metadata blocks
CN1340765A (en) Method for dividing one hard disk into more partitions separated fully
CN101373457B (en) Hard disk write-protection lock based on USB equipment under Windows environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170627

RJ01 Rejection of invention patent application after publication