CN1512349A - Method for establishing guidable partition - Google Patents

Method for establishing guidable partition Download PDF

Info

Publication number
CN1512349A
CN1512349A CNA021594910A CN02159491A CN1512349A CN 1512349 A CN1512349 A CN 1512349A CN A021594910 A CNA021594910 A CN A021594910A CN 02159491 A CN02159491 A CN 02159491A CN 1512349 A CN1512349 A CN 1512349A
Authority
CN
China
Prior art keywords
sector
boot sector
file
boot
subregion
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.)
Granted
Application number
CNA021594910A
Other languages
Chinese (zh)
Other versions
CN1216329C (en
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN021594910A priority Critical patent/CN1216329C/en
Publication of CN1512349A publication Critical patent/CN1512349A/en
Application granted granted Critical
Publication of CN1216329C publication Critical patent/CN1216329C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The process of establishing booting sector includes at least the following steps: obtaining booting record and booting sector and saving as file; sectoring and formatting the designated hard disc; reading out the main booting record and booting sector of the designated hard disc; correcting the stored booting record and booting sector based on the content of the main booting record and booting sector in the designated hard disc; writing the corrected main booting record and booting sector into designated hard disc; and copying the system file to the sector. The present invention realizes the direct establishment of FAT and FAT32 sector in booting DOS system under Linux, simplifies the manual operation of user while solving the problem of establishing booting sector.

Description

Create bootable partitioned method
Technical field
The present invention relates in a kind of operating system to create the bootable partitioned method of another kind of operating system, relate in particular to a kind of subregion of under Linux, creating the bootable DOS system of FAT or FAT32 form, belong to field of computer technology.
Background technology
Operating system is the platform of various computer application software operations.In general, as long as operating system can be supported the hardware device of a computing machine, on same computing machine, can move several operation systems.But when installing operating system, various operating systems all need be set up file system correspondingly on the memory device of computing machine, and deposit data necessary, could guide this operating system from memory device like this.The required necessary data of these booting operating systems need be generated in installation process by the installation procedure of this operating system, is perhaps write by other operating system of supporting this file system.
Using in the most general IBMPC compatible computer at present, the operating system of main flow has DOS, Windows series and Linux series.The file system of DOS system support is FAT and FAT32.Windows 95 and Windows NT support FAT, and Windows 95 osr2, Windows 98, Windows2000 and Windows XP support FAT32, and Windows NT, Windows 2000 and Windows XP support NTFS.The file system that Linux supports is more, except that supporting the distinctive ext2 file system of Linux fully, can also read and write and create FAT, FAT32 file system, reads new technology file system.
But FAT that Linux creates down and FAT32 file system can only be used for depositing file, can not be used for guiding DOS or Windows system.And in some applications, exactly need in the Linux environment, need to create a guidable FAT or FAT32 subregion, be used for starting DOS, the software under the operation DOS.If DOS or Windows system are not installed on the hard disk of this computing machine, then can only under the DOS environment, create bootable subregion with other medium such as floppy disk or optical disk start-up DOS environment by system command.This method is not only loaded down with trivial details, but also needs other media resource, can't meet the demands in the demanding application of automatic degree to system.
Summary of the invention
Fundamental purpose of the present invention is to provide the bootable partitioned method of a kind of establishment at the deficiencies in the prior art, can directly create the subregion of the bootable DOS system of FAT or FAT 32 forms under Linux, is used for starting DOS, the software under the operation DOS.
The object of the present invention is achieved like this, comprises the steps: at least
Step 1. is obtained Main Boot Record and boot sector, saves as file;
Step 2. pair appointment hard disk carries out subregion and format;
Step 3. reads the Main Boot Record and the boot sector of specifying hard disk;
Step 4. is revised Main Boot Record and the boot sector preserved in the step 1 according to the Main Boot Record of specifying hard disk and the content of boot sector;
Step 5. writes the appointment hard disk with revised Main Boot Record and boot sector;
Step 6. copies to system file on the subregion, finishes.
The Main Boot Record of described step 1 and boot sector read from the hard disk that formats with the DOS system partitioning, save as data file after reading, and are provided with the back step and use.
Described step 2 to specifying hard disk to carry out subregion and format, can be undertaken by the linux system order, subregion is necessary for first subregion of specifying hard disk.
The correction Main Boot Record and the boot sector of described step 4 comprise at least:
At first the judgment data form promptly judges whether the form into FAT32;
If then read the FAT32 boot sector respectively, and FAT32 boot sector file is revised to the content of the FAT32 boot sector file in the buffer zone with FAT32 boot sector in the buffer zone to buffer zone;
If not, then the content of FAT boot sector is revised, read the FAT boot sector respectively, and FAT boot sector file is revised to the content of the FAT boot sector file in the buffer zone with FAT boot sector in the buffer zone to buffer zone.
Described step 6 system file is copied on the subregion is to write DOS system file IO.SYS, MSDOS.SYS and COMMAND.COM on the new subregion of creating.
The present invention has realized the FAT and the FAT32 subregion of the bootable DOS of direct establishment system under Linux, has simplified user's manual operations on the one hand, has solved the problem that can't create bootable subregion of the systems face that need automatically perform this function on the other hand.
Description of drawings
Fig. 1 is the theory diagram of the method for the invention;
Fig. 2 be an embodiment of the method for the invention process flow diagram.
Embodiment
MSDOS7.0 operating system commonly used is as follows from the step of hard disk guiding:
The Basic Input or Output System (BIOS) of depositing in the ROM (read-only memory) of computing machine (ROM) (BIOS) is carried out initialization to system; BIOS reads and is positioned at hard disk 0 cylinder, 0 magnetic head, the Main Boot Record of 1 sector (MBR);
Carry out Main Boot Record, the boot in the Main Boot Record reads the boot sector that is positioned at the starting position of system partitioning;
Carry out the boot on the boot sector, boot is searched on subregion and reading system kernel IO.SYS;
Carry out kernel file IO.SYS, it will read configuration file MSDOS.SYS and command interpreter COMMAND.COM, finish bootup process.
From above-mentioned steps as can be known, operating system from the necessary condition that hard disk guides is:
On the hard disk boot sector, there is correct Main Boot Record;
On operating system partition, there is correct boot sector;
On operating system partition, there is correct system file.
As long as satisfy these conditions, FAT that creates out or FAT32 subregion just should be guidable.
But when creating guidable subregion, can not simply fixing data be write assigned address.Because also deposited hard disk partition table in the Main Boot Record, dos operating system has been deposited the disk parameter table in boot sector, these data all are to generate creating the division and format in the process of subregion, and the fixing data of writing direct will be destroyed these parameters, and the system that makes can't work.So must before writing data, carry out necessary modification, could create correct subregion to data.
Fig. 2 be one embodiment of the invention process flow diagram, be implemented in the bootable subregion that Linux creates down FAT or FAT32 form by following steps.
Step 1. is obtained Main Boot Record and boot sector.Main Boot Record and boot sector can read from the hard disk that formats with the DOS system partitioning, save as data file after reading, and are provided with the back step and use.Main Boot Record is a sector, and length is 512 bytes; The boot sector of FAT form is a sector, and length is 512 bytes; The boot sector of FAT32 form is 3 sectors, and length is 1536 bytes.
Step 2. pair appointment hard disk carries out subregion.Subregion can be undertaken by the system command of Linux, and subregion is necessary for first subregion of specifying hard disk, and the length of FAT subregion can not surpass 2047M, and the length of FAT32 subregion without limits.The subregion of newly creating is appointed as activity (Active).
The new subregion of creating of step 3. format may be undertaken by the linux system order.
Step 4. reads specifies 1 sector (Main Boot Record) that starts from 0 cylinder, 0 magnetic head, 1 sector on the hard disk, and depositing length in is the buffer zone 1 of 512 bytes.
The Main Boot Record file of preserving in step 5. read step 1, depositing length in is the buffer zone 2 of 512 bytes.
Step 6. begins 0 * 1be position in the buffer zone 1, and length is that the partition table content of 64 bytes writes buffer zone 2, and the starting position is 0 * 1be place.
Step 7. writes Master boot sector with the content of buffer zone 2, promptly specifies a sector that starts from 0 cylinder, 0 magnetic head, 1 sector on the hard disk.
Step 8. judges whether to be FAT32 form subregion, if change step 13; If not, then be illustrated as FAT form subregion, execution in step 9;
Step 9. reads the FAT boot sector from 1 sector of Master boot sector (specifying hard disk 0 cylinder 1 magnetic head 1 sector position), and depositing length in is the buffer zone 1 of 512 bytes;
The FAT boot sector of preserving in step 10. read step 1, depositing length in is the buffer zone 2 of 512 bytes;
Step 11. is not because the disk parameter in the buffer zone 2 generates according to designated disk, so be necessary according to the data in the buffer zone 1 data in the buffer zone 2 to be revised.The length that 0 * 0b position in the buffer zone 1 is begun is that the data (disk parameter table) of 43 bytes write buffer zone 2, and the starting position is 0 * 0b place.4 byte integer (sector number is hidden in representative) that 0 * 1c in the buffer zone 2 is begun are changed to the numerical value that equates with 2 byte integer (every magnetic track sector number) of 0 * 18 beginning.1 byte (drive letter) of 0 * 24 position in the buffer zone 2 is changed to 0 * 80 (representing first hard disk).
Step 12. writes FAT boot sector (specifying a sector of hard disk 0 cylinder 0 magnetic head 1 sector) with the content of buffer zone 2, jumps to step 17;
Step 13. reads FAT32 boot sector (3 sectors of specifying hard disk 0 cylinder 1 magnetic head 1 sector to begin), and depositing length in is the buffer zone 3 of 1536 bytes;
The FAT32 boot sector of preserving in step 14. read step 1, depositing length in is the buffer zone 4 of 1536 bytes;
Step 15. is not because the disk parameter in the buffer zone 4 generates according to designated disk, so be necessary according to the data in the buffer zone 3 data in the buffer zone 4 to be revised.The length that 0 * 0b position in the buffer zone 3 is begun is that the data (disk parameter table) of 71 bytes write buffer zone 4, and the starting position is 0 * 0b place.The length that 0 * 200 position in the buffer zone 3 is begun is that the data (FAT32 data) of 512 bytes write buffer zone 4, and the starting position is 0 * 200 place.4 byte integer (sector number is hidden in representative) that 0 * 1c in the buffer zone 4 is begun are changed to the numerical value that equates with 2 byte integer (every magnetic track sector number) of 0 * 18 beginning.1 byte (drive letter) of 0 * 40 position in the buffer zone 4 is changed to 0 * 80 (representing first hard disk).
Step 16. writes FAT32 boot sector (3 sectors of specifying hard disk 0 cylinder 0 magnetic head 1 sector to begin) with the content of buffer zone 4;
Step 17. copies to system file on the subregion, promptly writes DOS system file IO.SYS on the new subregion of creating, and MSDOS.SYS and COMMAND.COM finish then.
This computer-chronograph can directly guide the DOS system from the fdisk of new establishment, and carries out the various programs under the DOS.
In being about to the perfectly sound server navigation software of releasing, used the present invention.Software of the present invention is based upon on the CD fully, by optical disk start-up, and the Linux environment on the automatic boot cd-rom, and under this environment, server is configured, make server can finish the installation of Windows NT or Windows 2000 automatically.Wherein server hard disc is carried out subregion and used the present invention, on the hard disk of server, create FAT or the FAT32 subregion of a bootable DOS, and required file is installed by the initialize operation system with the format part.Take out CD afterwards, started voluntarily by server, server automatically performs the operating system installation program that presets from this subregion guiding DOS system, finishes the installation of Windows NT or Windows 2000.
It should be noted last that: above embodiment is the unrestricted technical scheme of the present invention in order to explanation only, although the present invention is had been described in detail with reference to the foregoing description, those of ordinary skill in the art is to be understood that: still can make amendment or be equal to replacement the present invention, and not breaking away from any modification or partial replacement of the spirit and scope of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (5)

1, the bootable partitioned method of a kind of establishment is characterized in that: comprises at least,
Step 1. is obtained Main Boot Record and boot sector, saves as file;
Step 2. pair appointment hard disk carries out subregion and format;
Step 3. reads the Main Boot Record and the boot sector of specifying hard disk;
Step 4. is revised Main Boot Record and the boot sector preserved in the step 1 according to the Main Boot Record of specifying hard disk and the content of boot sector;
Step 5. writes the appointment hard disk with revised Main Boot Record and boot sector;
Step 6. copies to system file on the subregion, finishes.
2, the bootable partitioned method of establishment according to claim 1, it is characterized in that: the Main Boot Record of described step 1 and boot sector read from the hard disk that formats with the DOS system partitioning, save as data file after reading, be provided with the back step and use.
3, the bootable partitioned method of establishment according to claim 1 is characterized in that: described step 2 to specifying hard disk to carry out subregion and format, can be undertaken by the linux system order, subregion is necessary for first subregion of specifying hard disk.
4, the bootable partitioned method of establishment according to claim 1 is characterized in that: the correction Main Boot Record and the boot sector of described step 4 comprise at least:
At first the judgment data form promptly judges whether the form into FAT32;
If then read the FAT32 boot sector respectively, and FAT32 boot sector file is revised to the content of the FAT32 boot sector file in the buffer zone with FAT32 boot sector in the buffer zone to buffer zone;
If not, then the content of FAT boot sector is revised, read the FAT boot sector respectively, and FAT boot sector file is revised to the content of the FAT boot sector file in the buffer zone with FAT boot sector in the buffer zone to buffer zone.
5, the bootable partitioned method of establishment according to claim 1 is characterized in that: described step 6 system file is copied on the subregion is to write DOS system file IO.SYS, MSDOS.SYS and COMMAND.COM on the new subregion of creating.
CN021594910A 2002-12-31 2002-12-31 Method for establishing guidable partition Expired - Fee Related CN1216329C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN021594910A CN1216329C (en) 2002-12-31 2002-12-31 Method for establishing guidable partition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN021594910A CN1216329C (en) 2002-12-31 2002-12-31 Method for establishing guidable partition

Publications (2)

Publication Number Publication Date
CN1512349A true CN1512349A (en) 2004-07-14
CN1216329C CN1216329C (en) 2005-08-24

Family

ID=34237499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN021594910A Expired - Fee Related CN1216329C (en) 2002-12-31 2002-12-31 Method for establishing guidable partition

Country Status (1)

Country Link
CN (1) CN1216329C (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100573480C (en) * 2008-02-29 2009-12-23 中国科学院计算技术研究所 A kind of hard disk data protection method and system
WO2012159436A1 (en) * 2011-05-20 2012-11-29 深圳市万兴软件有限公司 Method and device for adjusting disk partitions in windows
CN103970557A (en) * 2013-02-04 2014-08-06 中兴通讯股份有限公司 Storage device and system starting method thereof
CN108776577A (en) * 2018-05-04 2018-11-09 新华三技术有限公司成都分公司 Disk management method, device, electronic equipment and storage medium
CN110413291A (en) * 2019-07-18 2019-11-05 贵阳朗玛信息技术股份有限公司 Movable storage medium and preparation method thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7475278B2 (en) * 2005-11-15 2009-01-06 International Business Machines Corporation Method, system and computer program product for recovery of formatting in repair of bad sectors in disk drives

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100573480C (en) * 2008-02-29 2009-12-23 中国科学院计算技术研究所 A kind of hard disk data protection method and system
WO2012159436A1 (en) * 2011-05-20 2012-11-29 深圳市万兴软件有限公司 Method and device for adjusting disk partitions in windows
CN103970557A (en) * 2013-02-04 2014-08-06 中兴通讯股份有限公司 Storage device and system starting method thereof
CN103970557B (en) * 2013-02-04 2018-08-14 中兴通讯股份有限公司 The method and storage device of storage device activation system
CN108776577A (en) * 2018-05-04 2018-11-09 新华三技术有限公司成都分公司 Disk management method, device, electronic equipment and storage medium
CN110413291A (en) * 2019-07-18 2019-11-05 贵阳朗玛信息技术股份有限公司 Movable storage medium and preparation method thereof

Also Published As

Publication number Publication date
CN1216329C (en) 2005-08-24

Similar Documents

Publication Publication Date Title
US7032107B2 (en) Virtual partition for recording and restoring computer data files
JP6050262B2 (en) Virtual disk storage technology
US9286098B1 (en) Using master file template area to increase density of virtual machines in a computer system
JP5496254B2 (en) Converting a machine to a virtual machine
US6453383B1 (en) Manipulation of computer volume segments
CN1313941C (en) Method for data exchange between data handling equipment and operating system
JP4571992B2 (en) How to install and optimize program code on logical disks
CN1291332C (en) Disk system and method of updating firmware
JP5121427B2 (en) Method and apparatus for unified storage system
US6996706B1 (en) Booting an operating system or running other pre-boot code from a file stored under a different operating system
JPH0792745B2 (en) Method and apparatus for installing software files in a workstation
KR20000022716A (en) Efficient volume copy using pre-configuration of log structured target storage
JP3833677B2 (en) Method and computer system for integrating a compression system with an operating system
CN110806911A (en) Cloud desktop management and control method, device and system
KR20070083646A (en) Adaptive booting from mass storage device
CN1216329C (en) Method for establishing guidable partition
KR100637983B1 (en) Computer system and method for preparing a computer-readable medium
CN1755628A (en) Method of automatically installing software during operation system startup
CN100336036C (en) Multiple operating system boot loading method
CN1776687A (en) File segmenting method and device for FAT file system
JP2000163255A (en) Computer system for accessing computer-readable medium and method therefor
CN101046751A (en) System and method for installing hypervisor after user operating system has been installed and loaded
CN1776640A (en) FAT file system error treating method and device
CN1834910A (en) Multi-mode computer system and its operation method
CN109739437A (en) A method of based on cloud platform Linux virtual machine dilatation root partition

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20050824

Termination date: 20201231

CF01 Termination of patent right due to non-payment of annual fee