CN104156286A - System disk switching method and device for linux operating system - Google Patents

System disk switching method and device for linux operating system Download PDF

Info

Publication number
CN104156286A
CN104156286A CN201410417904.4A CN201410417904A CN104156286A CN 104156286 A CN104156286 A CN 104156286A CN 201410417904 A CN201410417904 A CN 201410417904A CN 104156286 A CN104156286 A CN 104156286A
Authority
CN
China
Prior art keywords
dish
disk
search
current
module
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
CN201410417904.4A
Other languages
Chinese (zh)
Other versions
CN104156286B (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.)
Fujian Star Net eVideo Information Systems Co Ltd
Original Assignee
Fujian Star Net eVideo Information Systems 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 Fujian Star Net eVideo Information Systems Co Ltd filed Critical Fujian Star Net eVideo Information Systems Co Ltd
Priority to CN201410417904.4A priority Critical patent/CN104156286B/en
Publication of CN104156286A publication Critical patent/CN104156286A/en
Application granted granted Critical
Publication of CN104156286B publication Critical patent/CN104156286B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to the field of operating systems, and discloses a system disk switching method and device for a linux operating system. A boot loader is programmed to a flash, two system disks with the linux operating system are manufactured, one system disk is optionally selected and set as a current system disk, and the other system disk is set as a standby system disk; after the system is powered on, the boot loader is started from the flash, the boot loader searches for the current system disk, if the current system disk is found, whether data of the current system disk are integral is detected, if the data are integral, the system is started from the current system disk, and otherwise the boot loader searches for the standby system disk; if the standby system disk is found, whether data of the standby system disk are integral is detected, if the data are integral, when the current system disk breaks down and other problems occur, the current system disk can be switched to the standby system disk, and the system can be started from the standby system disk.

Description

A kind of system disk changing method and device of linux operating system
Technical field
The present invention relates to operating system field, relate in particular to a kind of system disk changing method and device of linux operating system.
Background technology
Along with the development of various hardware resources, the ability of electronic equipment is also more and more stronger.The also appearance in a large number of product of two operating systems is installed for this reason, on an electronic equipment platform.Two operating systems of conventionally, installing on an equipment operate in respectively in region of memory separately.During the first operating system, the second operating system is in dormant state.When switching, make the first operating system enter dormant state, then wake the second operating system up.Profit realizes the switching of two operating systems in such a way.But if the operating system of moving collapse, system cannot normally enter the state that suspends to internal memory, thereby also cannot normally switch between dual system.
At present, under embedded Linux operating system environment, also there are not system disk changing method and device.
Therefore, expectation provides a kind of system disk changing method and device of linux operating system, can occur at the system disk of linux operating system when abnormal automatically switching to another system disk, thereby realize system disk, switches.
Summary of the invention
Technical matters to be solved by this invention is: a kind of system disk changing method and device of linux operating system are provided, can realize when current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
A kind of system disk changing method of linux operating system:
Storage hard disk on mainboard is divided into current system dish and back-up system dish;
After system powers on, from flash, start bootstrap loader;
Bootstrap loader search current system dish;
If search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise whether complete bootstrap loader search back-up system dish, if search back-up system dish, detect back-up system dish data, if data integrity, from back-up system disk startup system.
Another technical scheme that the present invention adopts is:
A kind of system disk switching device shifter of linux operating system:
Described device comprises mainboard division module, bootstrap loader module, search module, judge module and startup module;
Described mainboard division module, for being divided into the storage hard disk on mainboard on current system dish and back-up system dish;
Described bootstrap loader module, after powering on, starts bootstrap loader from flash for system;
Described search module, for bootstrap loader search current system dish or back-up system dish;
Described judge module, for judging whether to search current system dish or back-up system dish;
Described startup module, if for searching current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise bootstrap loader search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, from back-up system disk startup system.
Beneficial effect of the present invention is: the present invention is divided into current system dish and back-up system dish by the storage hard disk on mainboard, from flash, start bootstrap loader, bootstrap loader starts to search for current system dish, if search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, realized when the problems such as current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system.
Accompanying drawing explanation
Fig. 1 is the block diagram of the system disk changing method of a kind of linux operating system of the embodiment of the present invention;
Fig. 2 is the block diagram of the system disk changing method of the another kind of linux operating system of the embodiment of the present invention;
Fig. 3 is the structured flowchart of the system disk switching device shifter of a kind of linux operating system of the embodiment of the present invention;
Label declaration:
10, mainboard division module; 20, bootstrap loader module; 30, search module; 40, judge module; 50, start module.
Embodiment
By describing technology contents of the present invention in detail, being realized object and effect, below in conjunction with embodiment and coordinate accompanying drawing to be explained.
The design of most critical of the present invention is: the storage hard disk on mainboard is divided into current system dish and back-up system dish, by bootstrap loader, search for current system dish, if search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity has been realized when the problems such as current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system.
Please refer to Fig. 1, is the block diagram of the system disk changing method of a kind of linux operating system of the embodiment of the present invention, and concrete steps are as follows:
S1, the storage hard disk on mainboard is divided into current system dish and back-up system dish;
After S2, system power on, from flash, start bootstrap loader;
S3, bootstrap loader search current system dish;
If S4 searches current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise whether complete bootstrap loader search back-up system dish, if search back-up system dish, detect back-up system dish data, if data integrity, from back-up system disk startup system.
From foregoing description, beneficial effect of the present invention is: the present invention is divided into current system dish and back-up system dish by the storage hard disk on mainboard, from flash, start bootstrap loader, bootstrap loader search current system dish, if search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise bootstrap loader search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, realized when the problems such as current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system.
Further, in the system disk changing method of a kind of linux operating system of the embodiment of the present invention, described search current system dish or search back-up system dish are to search for by the label of search current system dish or back-up system dish.
Seen from the above description, bootstrap loader search current system dish or search back-up system dish are to search for by the label of search current system dish or back-up system dish, and described label is the sign of disk, can artificially set, there is randomness, can improve the security of search procedure.
Further, in the system disk changing method of a kind of linux operating system of the embodiment of the present invention, described label adopts order to write or change.
Seen from the above description, described label adopts order to write or change, and described order adopts e2label instruction, convenient and swift.
Further, in the system disk changing method of a kind of linux operating system of the embodiment of the present invention, the storage hard disk on described mainboard is divided into plural back-up system dish.
Seen from the above description, the storage hard disk on described mainboard is divided into plural back-up system dish, also has other back-up system dishes when a back-up system dish breaks down, and plays dual fail-safe effect.
Further, in the system disk changing method of a kind of linux operating system of the embodiment of the present invention, further comprising the steps of:
If search plural back-up system dish, the optional back-up system dish of user is set to current system dish.
Seen from the above description, user can require to select to want, from which back-up system disk startup system, to have realized the object that user is freely switched according to individual.
Further, in the system disk changing method of a kind of linux operating system of the embodiment of the present invention, further comprising the steps of before the step that the storage hard disk on mainboard is divided into current system dish and back-up system dish:
Programming bootstrap loader is in flash;
Make two above system disks with linux operating system;
An optional system disk is set to current system dish, and all the other system disks are set to back-up system dish.
Seen from the above description, before starting, system to carry out above preliminary work, need to be by bootstrap loader programming in flash, and first bootload loading procedure before system starts, separately needs in advance storage hard disk to be divided into current system dish and back-up system dish.
Please refer to Fig. 2, is the block diagram of the system disk changing method of another kind of linux operating system, and embodiments of the invention one are:
A system disk changing method for linux operating system, specifically comprises the following steps:
S10, programming bootstrap loader are in flash;
S11, two above system disks with linux operating system of making;
S12, an optional system disk are set to current system dish, and all the other system disks are set to back-up system dish;
After S13, system power on, from flash, start bootstrap loader;
S14, bootstrap loader search current system dish;
If S15 searches current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise whether complete bootstrap loader search back-up system dish, if search back-up system dish, detect back-up system dish data, if data integrity, from back-up system disk startup system.
Seen from the above description, by by bootstrap loader programming in flash, and make two with the system disk of linux operating system, an optional system disk is set to current system dish, another system disk is set to back-up system dish, after system powers on, from flash, start bootstrap loader, bootstrap loader search current system dish, if search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise bootstrap loader search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, realized when the problems such as current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system,
Please refer to Fig. 3, is the structured flowchart of the system disk switched system of a kind of linux operating system of the embodiment of the present invention:
The system disk switching device shifter of described a kind of linux operating system comprises mainboard division module 10, bootstrap loader module 20, search module 30, judge module 40 and starts module 50;
Described mainboard division module 10, for being divided into the storage hard disk on mainboard on current system dish and back-up system dish;
Described bootstrap loader module 20, after powering on, starts bootstrap loader from flash for system;
Described search module 30, for bootstrap loader search current system dish or back-up system dish;
Described judge module 40, for judging whether to search current system dish or back-up system dish;
Described startup module 50, for from current system dish or back-up system disk startup system.
Further, in the system disk switching device shifter of a kind of linux operating system of the embodiment of the present invention, also comprise selection module;
Described selection module, if for searching plural back-up system dish, the optional back-up system dish of user is set to current system dish.
Seen from the above description, user can select arbitrarily among all back-up system dishes that search to be set to current system dish from select module, has realized the object that user is freely switched.
Further, in the system disk switching device shifter of a kind of linux operating system of the embodiment of the present invention, also comprise writing module;
Said write module, coils mark for writing or change current system dish or back-up system.
Seen from the above description, can write or change label by writing module, convenient and swift.
Further, in the system disk switching device shifter of a kind of linux operating system of the embodiment of the present invention, also comprise pretreatment module;
Described pretreatment module for the storage hard disk on mainboard is divided into current system dish and back-up system dish before carry out following operation:
Programming bootstrap loader is in flash;
Make two above system disks with linux operating system;
An optional system disk is set to current system dish, and all the other system disks are set to back-up system dish.
In sum, system disk changing method and the device of a kind of linux operating system provided by the invention, by by bootstrap loader programming in flash, and make two with the system disk of linux operating system, an optional system disk is set to current system dish, another system disk is set to back-up system dish, after system powers on, from flash, start bootstrap loader, bootstrap loader search current system dish, if search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise bootstrap loader search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, realized when the problems such as current system dish breaks down, can be switched to back-up system dish, from back-up system disk startup system, described search current system dish or search back-up system dish are to search for by searching for label current or back-up system dish, described label is to adopt e2label instruction to write or change by writing module, convenient and swift, on described mainboard, can be divided into plural back-up system dish, when a back-up system dish breaks down, also have other back-up system dishes, play dual fail-safe effect, described selection module, user can require to select to want, from which back-up system disk startup system, to have realized the object that user is freely switched according to individual.
The foregoing is only embodiments of the invention; not thereby limit the scope of the claims of the present invention; every equivalents of utilizing instructions of the present invention and accompanying drawing content to do, or be directly or indirectly used in relevant technical field, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. a system disk changing method for linux operating system, is characterized in that, comprises the following steps:
Storage hard disk on mainboard is divided into current system dish and back-up system dish;
After system powers on, from flash, start bootstrap loader;
Bootstrap loader search current system dish;
If search current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise whether complete bootstrap loader search back-up system dish, if search back-up system dish, detect back-up system dish data, if data integrity, from back-up system disk startup system.
2. the system disk changing method of a kind of linux operating system according to claim 1, is characterized in that, described search current system dish or back-up system dish are to search for by the label of search current system dish or back-up system dish.
3. the system disk changing method of a kind of linux operating system according to claim 2, is characterized in that, described label adopts order to write or change.
4. the system disk changing method of a kind of linux operating system according to claim 1, is characterized in that, the storage hard disk on described mainboard is divided into plural back-up system dish.
5. the system disk changing method of a kind of linux operating system according to claim 4, is characterized in that, further comprising the steps of:
If search plural back-up system dish, the optional back-up system dish of user is set to current system dish.
6. the system disk changing method of a kind of linux operating system according to claim 1, is characterized in that, further comprising the steps of before the step that the storage hard disk on mainboard is divided into current system dish and back-up system dish:
Programming bootstrap loader is in flash;
Make two above system disks with linux operating system;
An optional system disk is set to current system dish, and all the other system disks are set to back-up system dish.
7. a system disk switching device shifter for linux operating system, is characterized in that, described device comprises mainboard division module, bootstrap loader module, search module, judge module and startup module;
Described mainboard division module, for being divided into the storage hard disk on mainboard on current system dish and back-up system dish;
Described bootstrap loader module, after powering on, starts bootstrap loader from flash for system;
Described search module, for bootstrap loader search current system dish or back-up system dish;
Described judge module, for judging whether to search current system dish or back-up system dish;
Described startup module, if for searching current system dish, whether completely detect current system dish data, if data integrity, from current system disk startup system, otherwise bootstrap loader search back-up system dish, if search back-up system dish, whether completely detect back-up system dish data, if data integrity, from back-up system disk startup system.
8. the system disk switching device shifter of linux operating system according to claim 7, is characterized in that, also comprises selection module;
Described selection module, if for searching plural back-up system dish, the optional back-up system dish of user is set to current system dish.
9. the system disk switching device shifter of linux operating system according to claim 7, is characterized in that, also comprises writing module;
Said write module, for writing or change the label of current system dish or back-up system dish.
10. the system disk switching device shifter of linux operating system according to claim 7, is characterized in that, it also comprises pretreatment module,
Pretreatment module for the storage hard disk on mainboard is divided into current system dish and back-up system dish before carry out following operation:
Programming bootstrap loader is in flash;
Make two above system disks with linux operating system;
An optional system disk is set to current system dish, and all the other system disks are set to back-up system dish.
CN201410417904.4A 2014-08-22 2014-08-22 The system disk changing method and device of a kind of linux operating systems Active CN104156286B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410417904.4A CN104156286B (en) 2014-08-22 2014-08-22 The system disk changing method and device of a kind of linux operating systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410417904.4A CN104156286B (en) 2014-08-22 2014-08-22 The system disk changing method and device of a kind of linux operating systems

Publications (2)

Publication Number Publication Date
CN104156286A true CN104156286A (en) 2014-11-19
CN104156286B CN104156286B (en) 2017-07-04

Family

ID=51881791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410417904.4A Active CN104156286B (en) 2014-08-22 2014-08-22 The system disk changing method and device of a kind of linux operating systems

Country Status (1)

Country Link
CN (1) CN104156286B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040172578A1 (en) * 2003-02-27 2004-09-02 Acer Inc. Method and system of operating system recovery
JP2007172192A (en) * 2005-12-21 2007-07-05 Nec Corp Data control system, shared disk drive, and method of switching disk access control used for them
CN102289397A (en) * 2011-09-13 2011-12-21 全星科技(珠海)有限公司 Method and device for automatically restoring embedded system of set top box
CN102331958A (en) * 2011-11-02 2012-01-25 赵玉燕 Method for starting hard disk under Linux system
CN102841863A (en) * 2012-07-10 2012-12-26 上海德拓信息技术有限公司 Method for backuping data through adopting dual-disk read-write operation
CN102981935A (en) * 2012-11-15 2013-03-20 浪潮电子信息产业股份有限公司 Method of enhancing reliability of storage equipment system disks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040172578A1 (en) * 2003-02-27 2004-09-02 Acer Inc. Method and system of operating system recovery
JP2007172192A (en) * 2005-12-21 2007-07-05 Nec Corp Data control system, shared disk drive, and method of switching disk access control used for them
CN102289397A (en) * 2011-09-13 2011-12-21 全星科技(珠海)有限公司 Method and device for automatically restoring embedded system of set top box
CN102331958A (en) * 2011-11-02 2012-01-25 赵玉燕 Method for starting hard disk under Linux system
CN102841863A (en) * 2012-07-10 2012-12-26 上海德拓信息技术有限公司 Method for backuping data through adopting dual-disk read-write operation
CN102981935A (en) * 2012-11-15 2013-03-20 浪潮电子信息产业股份有限公司 Method of enhancing reliability of storage equipment system disks

Also Published As

Publication number Publication date
CN104156286B (en) 2017-07-04

Similar Documents

Publication Publication Date Title
EP2005295B1 (en) Direct boot arrangement using a nand flash memory
US8966237B2 (en) Operating system switching method in information processing system including a switcher checking wakeup status in the processor
CN101770384B (en) Car audio system software upgrading method
CN104598254A (en) Method and device for rapidly powering on Android system
EP2416229A2 (en) Information processing device, power control method, and program
CN114879828A (en) Firmware interface with persistent memory storage
KR101646425B1 (en) Switching between operational contexts
CN103729211A (en) Operating system recovery method and device and terminal equipment
WO2015199700A1 (en) Post package repair (ppr) data in non-volatile memory
CN103377054A (en) Starting method and starting device
CN103853584A (en) Master system recovery method and terminal
CN102841807B (en) Control method, control device and computer system
CN102880477A (en) Method for realizing computer start and computer
JP2012123673A (en) Power supply switching device, power supply switching device control method, and power supply control program
KR20160108492A (en) Techniques for switching between operating systems
US20110246759A1 (en) Method for boosting an electronic device with multiple processing units, and electronic device for implementing the same
CN103870298A (en) Switching method and electronic device
CN103019833A (en) Terminal equipment and method for enabling same to support quick switching of operating systems
US7849300B2 (en) Method for changing booting sources of a computer system and a related backup/restore method thereof
CN102141920A (en) Method for dynamically configuring C-State and communication equipment
KR101260934B1 (en) Method and system for application synchronization
CN104156286A (en) System disk switching method and device for linux operating system
CN103870295A (en) Switching method and electronic device
CN104021007A (en) Parameter renewing method and electronic devices
CN105677414A (en) Method for achieving dual boot in Hostboot

Legal Events

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