CN107918568A - A kind of method for preventing linux system from restarting failure - Google Patents

A kind of method for preventing linux system from restarting failure Download PDF

Info

Publication number
CN107918568A
CN107918568A CN201711112988.0A CN201711112988A CN107918568A CN 107918568 A CN107918568 A CN 107918568A CN 201711112988 A CN201711112988 A CN 201711112988A CN 107918568 A CN107918568 A CN 107918568A
Authority
CN
China
Prior art keywords
storage medium
file system
root file
method described
daily record
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
CN201711112988.0A
Other languages
Chinese (zh)
Other versions
CN107918568B (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.)
CRSC Research and Design Institute Group Co Ltd
Original Assignee
CRSC Research and Design Institute Group 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 CRSC Research and Design Institute Group Co Ltd filed Critical CRSC Research and Design Institute Group Co Ltd
Priority to CN201711112988.0A priority Critical patent/CN107918568B/en
Publication of CN107918568A publication Critical patent/CN107918568A/en
Application granted granted Critical
Publication of CN107918568B publication Critical patent/CN107918568B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This disclosure relates to a kind of method for preventing linux system from restarting failure, the method is replicated the root file system on CFast cards, with the root file system activation system of duplication in system start-up phase.The method can also be on the basis of the existing storage medium of system, in addition be used for record log using non-volatile memory medium, so that the root file system and journal file of system are recorded in different storage mediums.By using above-mentioned one or two kinds of methods, system writing machine meeting can be reduced by virtual hard disk technology, reduces disk write bad probability, and solve the problems, such as that system power failure file system crash influences system and starts automatic repair.By increasing individually storage medium recorded journal file, the logging ca of system is expanded, and without changing any original program.Even if SSD hard disk corruptions, business will not interrupt;The simply daily record nonvolatile storage function of loss;Daily record also has in memory to be preserved.

Description

A kind of method for preventing linux system from restarting failure
Technical field
This disclosure relates to operating system, specifically, is related to a kind of method for preventing linux system from restarting failure.
Background technology
In the prior art, directly using the Linux system of ssd hard disks installation release, the Linux systems through so installing System, system log caused by system operation can only local record daily record.And local record daily record needs to incite somebody to action by file system Log recording, when daily record is not synchronized on disk also by the write operation of file system in time, can cause file system on disk Unite inconsistent.If power off at this time, it is possible to fail in system start-up phase to file system check, so as to cause linux systems System cannot normally start influence service operation.Simultaneously as there are a large amount of daily record write operations, disk write bad probability can be increased, The system of also resulting in is not normally functioning.
The content of the invention
Based on this, the present disclosure proposes a kind of method for preventing linux system from restarting failure, for solving the above problems or Subproblem.
A kind of method for preventing linux system from restarting failure, the method is in system start-up phase, by CFast cards Root file system is replicated, with the root file system activation system of duplication.
In the method, wherein:The root file system of the duplication is stored in virtual disk, and the virtual disk exists Built in memory.
In the method, wherein:The method before system closedown, to CFast cards on synchrodata.
In the method, wherein:Before the duplication, whether the root file system detected on CFast cards has damage, If damaging automatic reparation root file system.
In the method, wherein:After root file system is repaired automatically, write-in CFast before last shutdown is prompted The data of card are successfully written.
Compared with prior art, the above method that the disclosure provides has following advantageous effects:
(1) system writing machine meeting is reduced by virtual hard disk technology, reduces disk write bad probability.
(2) solve the problems, such as that system power failure file system crash influences system and starts automatic repair.
A kind of method for preventing linux system from restarting failure, the method is on the basis of the existing storage medium of system, separately It is outer that record log is used for using non-volatile memory medium, so that the root file system and journal file of system are recorded in difference Storage medium in.
In the method, wherein:Using the non-volatile memory medium in addition used as the second storage medium, described Its subregion is mounted to daily record output directory by two storage mediums by being identified in script is started.
In the method, wherein:Using the existing storage medium of the system as the first storage medium;It is situated between in the second storage When matter mounting is normal, periodically by the Log backup being recorded in the first storage medium into the second storage medium.
In the method, wherein:The second storage medium mounting judges normal through daily record application program.
In the method, wherein:The backup is write the log rollback in the first storage medium by daily record application program Enter into the second storage medium and realize.
Compared with prior art, the above method that the disclosure provides has following advantageous effects:
(1) by increasing individually storage medium recorded journal file, the logging ca of system is expanded, and do not have to Change any original program.
(2) even if SSD hard disk corruptions, business will not interrupt;The simply daily record nonvolatile storage function of loss;Daily record Also have in memory and preserve.
Brief description of the drawings
On preventing linux system from restarting the method flow schematic diagram of failure in Fig. 1 disclosure one embodiment;
On preventing linux system from restarting the method flow schematic diagram of failure in another embodiment of Fig. 2 disclosure.
Embodiment
In one embodiment, there is provided a kind of method for preventing linux system from restarting failure, the method are opened in system In the dynamic stage, the root file system on CFast cards is replicated, with the root file system activation system of duplication.
Preferably, a virtual disk (ramdisk) is built in memory, in system start-up phase, will be located at cfast cards In root file system copy in the ramdisk disks in memory, it is root file system then to switch the ramdisk disks, is opened Dynamic Linux system.Because root file system ramdisk is located in memory in itself, and the file system in cfast cards is not Carry is needed, so any write operation will not be produced to cfast.
In this embodiment, system writing machine meeting is reduced by virtual hard disk technology, reduces disk write bad probability. Therefore system starts failure problem caused by this programme can solve system cut-off file system crash at all.
In another embodiment, based on above-described embodiment, in the method, wherein:The method is in system closedown Before, to synchrodata on CFast cards.Then, in system start-up phase, we first check that the basic system on cfast cards is It is no to have damage, if damaging automatic reparation file system, then root file system is copied in ram disk again, and with file Whether system repaired, and provided different prompt messages, reminded the data success for being used for confirming the preceding write-in CFast cards of last shutdown Write-in.
In this embodiment, system caused by not only can solving system cut-off file system crash, which starts, unsuccessfully asks Topic, and can also overcoming toward updating the data in CFast, not the situation abnormal power-down of synchronization, in this case it is still possible to cause in cfast The problem of file system crash system can not normally start.
In one embodiment, there is provided a kind of method for preventing linux system from restarting failure, the method show in system On the basis of having storage medium, record log is in addition used for using non-volatile memory medium, so that the root file system of system System and journal file are recorded in different storage mediums.By increasing individually storage medium recorded journal file, expand The logging ca of system, and without changing any original program.
Existing storage medium is usually cfast cards as system disk, on this basis, increase non-volatile memory medium use In record log, so that the root file system and journal file of system are recorded in different storage mediums, can prevent from remembering The storage medium damage of record daily record causes root file system normally to start.Preferably, non-volatile memory medium great Rong The SSD hard disks of amount.
Preferably, in the method, it is described using the non-volatile memory medium in addition used as the second storage medium Its subregion is mounted to daily record output directory "/mnt/log " by the second storage medium by being identified in script is started.
Preferably, in the method, using the existing storage medium of the system as the first storage medium;In the second storage When medium mounting is normal, periodically by the Log backup being recorded in the first storage medium into the second storage medium.
Preferably, in the method, the second storage medium mounting judges normal through daily record application program.It is described The daily record being recorded in ram disk is periodically synchronously write the by daily record program after judging that the mounting of current second storage medium is correct In two storage mediums, otherwise log information is not write into the second storage medium.In this case, even if the second storage medium damages Bad, business will not interrupt;The simply daily record nonvolatile storage function of loss;Daily record also has in memory to be preserved.
Preferably, in the method, the backup by daily record application program by the log rollback in the first storage medium It is written in the second storage medium and realizes, so as to ensures completely log recording will not be caused to fail because of disk write.
In one embodiment, the method is using the flow chart activation system shown in Fig. 1.
In one embodiment, the method carries out daily record storage using the flow chart shown in Fig. 2.If daily record application program Judge that current ssd hard disks mounting is incorrect or abnormal, then log information is not write into SSD hard disks, or timing is rejudged and worked as Whether preceding ssd hard disks correctly mount, or terminate to exit the program.
In one embodiment, both use in system start-up phase, the root file system on CFast cards replicated, With the root file system activation system of duplication, and increase non-volatile memory medium at the same time, make root file system and the day of system Will file record prevents the storage medium of record log damages from causing root file system normal in different storage mediums Start.
Although embodiment of the present invention is described above in association with attached drawing, the invention is not limited in above-mentioned Specific embodiments and applications field, above-mentioned specific embodiment are only schematical, directiveness, rather than restricted 's.Those of ordinary skill in the art are under the enlightenment of this specification and in the scope for not departing from the claims in the present invention and being protected In the case of, the form of many kinds can also be made, these belong to the row of protection of the invention.

Claims (10)

  1. A kind of 1. method for preventing linux system from restarting failure, it is characterised in that:
    The method is replicated the root file system on CFast cards, with the root file system of duplication in system start-up phase Activation system.
  2. 2. according to the method described in claim 1, it is characterized in that:
    The root file system of the duplication is stored in virtual disk, and the virtual disk is built in memory.
  3. 3. according to the method described in claim 1, it is characterized in that:
    The method before system closedown, to CFast cards on synchrodata.
  4. 4. according to the method described in claim 1, it is characterized in that:
    Before the duplication, whether the root file system detected on CFast cards has damage, if damaging automatic reparation root text Part system.
  5. 5. according to the method described in claim 4, it is characterized in that:
    After root file system is repaired automatically, the data of write-in CFast cards are successfully written before the last shutdown of prompting.
  6. A kind of 6. method for preventing linux system from restarting failure, it is characterised in that:
    In addition the method is used for record log on the basis of the existing storage medium of system using non-volatile memory medium, So that the root file system and journal file of system are recorded in different storage mediums.
  7. 7. according to the method described in claim 6, it is characterized in that:
    Using the non-volatile memory medium in addition used as the second storage medium, second storage medium is by starting foot Identified in this, and its subregion is mounted to daily record output directory.
  8. 8. according to the method described in claim 7, it is characterized in that:
    Using the existing storage medium of the system as the first storage medium;
    When the mounting of the second storage medium is normal, periodically the Log backup being recorded in the first storage medium is situated between to the second storage In matter.
  9. 9. according to the method described in claim 8, it is characterized in that:
    The second storage medium mounting judges normal through daily record application program.
  10. 10. according to the method described in claim 8, it is characterized in that:
    Log rollback in first storage medium is written in the second storage medium by the backup by daily record application program to be realized.
CN201711112988.0A 2017-11-13 2017-11-13 Method for preventing Linux system from failing to restart Active CN107918568B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711112988.0A CN107918568B (en) 2017-11-13 2017-11-13 Method for preventing Linux system from failing to restart

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711112988.0A CN107918568B (en) 2017-11-13 2017-11-13 Method for preventing Linux system from failing to restart

Publications (2)

Publication Number Publication Date
CN107918568A true CN107918568A (en) 2018-04-17
CN107918568B CN107918568B (en) 2021-03-30

Family

ID=61896440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711112988.0A Active CN107918568B (en) 2017-11-13 2017-11-13 Method for preventing Linux system from failing to restart

Country Status (1)

Country Link
CN (1) CN107918568B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984118A (en) * 2018-06-26 2018-12-11 四川斐讯信息技术有限公司 A kind of log information saving method and system based on openwrt system flash subarea
CN109491837A (en) * 2018-11-01 2019-03-19 郑州云海信息技术有限公司 A kind of the log fault-tolerance processing method and device of Nonvolatile memory reservoir
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN110502460A (en) * 2018-05-16 2019-11-26 华为技术有限公司 The method and node of data processing
CN110990187A (en) * 2019-10-23 2020-04-10 北京全路通信信号研究设计院集团有限公司 Memory inspection method and system
CN114253820A (en) * 2022-02-25 2022-03-29 苏州浪潮智能科技有限公司 Log recording method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567136A (en) * 2010-12-15 2012-07-11 研祥智能科技股份有限公司 Backup and recovery method of computer system, device and computer system
CN103077043A (en) * 2012-11-15 2013-05-01 上海爱数软件有限公司 Method for fast starting and operating Linux
CN105205142A (en) * 2015-09-18 2015-12-30 广东欧珀移动通信有限公司 Method, device and mobile terminal for saving log file
CN105677258A (en) * 2016-02-23 2016-06-15 浪潮(北京)电子信息产业有限公司 Method and system for managing log data
CN105718330A (en) * 2016-01-15 2016-06-29 浪潮(北京)电子信息产业有限公司 Linux system backup data recovery method and device
CN106598780A (en) * 2016-11-22 2017-04-26 深圳中科讯联科技股份有限公司 System backup and recovery method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567136A (en) * 2010-12-15 2012-07-11 研祥智能科技股份有限公司 Backup and recovery method of computer system, device and computer system
CN103077043A (en) * 2012-11-15 2013-05-01 上海爱数软件有限公司 Method for fast starting and operating Linux
CN105205142A (en) * 2015-09-18 2015-12-30 广东欧珀移动通信有限公司 Method, device and mobile terminal for saving log file
CN105718330A (en) * 2016-01-15 2016-06-29 浪潮(北京)电子信息产业有限公司 Linux system backup data recovery method and device
CN105677258A (en) * 2016-02-23 2016-06-15 浪潮(北京)电子信息产业有限公司 Method and system for managing log data
CN106598780A (en) * 2016-11-22 2017-04-26 深圳中科讯联科技股份有限公司 System backup and recovery method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502460A (en) * 2018-05-16 2019-11-26 华为技术有限公司 The method and node of data processing
CN110502460B (en) * 2018-05-16 2021-03-23 华为技术有限公司 Data processing method and node
CN108984118A (en) * 2018-06-26 2018-12-11 四川斐讯信息技术有限公司 A kind of log information saving method and system based on openwrt system flash subarea
CN109491837A (en) * 2018-11-01 2019-03-19 郑州云海信息技术有限公司 A kind of the log fault-tolerance processing method and device of Nonvolatile memory reservoir
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN109710317B (en) * 2018-11-16 2020-07-07 华为技术有限公司 System starting method and device, electronic equipment and storage medium
CN110990187A (en) * 2019-10-23 2020-04-10 北京全路通信信号研究设计院集团有限公司 Memory inspection method and system
CN110990187B (en) * 2019-10-23 2023-09-15 北京全路通信信号研究设计院集团有限公司 Memory inspection method and system
CN114253820A (en) * 2022-02-25 2022-03-29 苏州浪潮智能科技有限公司 Log recording method and related device

Also Published As

Publication number Publication date
CN107918568B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN107918568A (en) A kind of method for preventing linux system from restarting failure
US7724643B2 (en) Recovery of duplex data system after power failure
CN101593083B (en) device, computer and method for protecting and restoring computer configuration information
US20040068334A1 (en) Method for updating firmware of computer device
CN102033786B (en) Method for repairing consistency of copies in object storage system
CN104050056A (en) File system backup of multi-storage-medium device
CN101231604B (en) Apparatus, system, and method for volume-level restoration of cluster server data
CN107315659B (en) Metadata redundancy backup method and device
CN102521084A (en) Data storage and reading method
US6748552B2 (en) Stored program controlled switching system
CN101281452A (en) Method for automatically rebuilding hard disk
CN101930384A (en) Fault tolerance method and device for file system
JP2012530285A (en) Method and apparatus for maintaining key information area of file system
JP2001337792A (en) Disk array device
CN103064752A (en) Method and device of repairing document
US20160117132A1 (en) Method for optimizing the use of a non-volatile memory in a motor vehicle computer for monitoring a functional member
JPWO2007088605A1 (en) Component information restoration method, component information management method, and electronic apparatus
US7600151B2 (en) RAID capacity expansion interruption recovery handling method and system
CN103092719A (en) Power-off protection method for file system
KR20090094594A (en) Information storage medium recording data according to journaling file system, method and apparatus of writing/recovering data using journaling file system
US20100169572A1 (en) Data storage method, apparatus and system for interrupted write recovery
US20040064784A1 (en) Document management system, method and computer program
US20160004607A1 (en) Information processing apparatus and information processing method
CN111897583A (en) Equipment starting method and embedded equipment
CN111104256A (en) Data reading method, device, equipment and storage medium

Legal Events

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