CN102455954A - Power-failure-preventing upgrading method of Linux system - Google Patents

Power-failure-preventing upgrading method of Linux system Download PDF

Info

Publication number
CN102455954A
CN102455954A CN2011103150736A CN201110315073A CN102455954A CN 102455954 A CN102455954 A CN 102455954A CN 2011103150736 A CN2011103150736 A CN 2011103150736A CN 201110315073 A CN201110315073 A CN 201110315073A CN 102455954 A CN102455954 A CN 102455954A
Authority
CN
China
Prior art keywords
upgrading
upgrade
file
backup
kernel
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
CN2011103150736A
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.)
China Standard Software Co Ltd
Original Assignee
China Standard Software 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 China Standard Software Co Ltd filed Critical China Standard Software Co Ltd
Priority to CN2011103150736A priority Critical patent/CN102455954A/en
Publication of CN102455954A publication Critical patent/CN102455954A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a power-failure-preventing upgrading method of a Linux system. In the method, before system upgrading, system backup is performed; upgrading states are marked in the system upgrading process; according to different upgrading states and upgrading types of the Linux system, system upgrading restoration is performed; and particularly, in the state of upgrading failure, the system upgrading restoration is realized in a mode of realizing system rollback by calling a standby system, so that the Linux system can be normally started.

Description

The upgrade method of the anti-power down of a kind of linux system
Technical field
The present invention relates to a kind of upgrade method of linux system, especially a kind of upgrade method with anti-lost electric work ability.
Background technology
Operating system auto-update function is the important component part of operating system.Windows system and common linux system release all have the function of automatic renewal, even in some special-purpose linux system release, also comprise this function.Can repair the defective (BUG) in the operating system software through automatically updating function, software release upgrade etc. perhaps is provided.
Shown in Fig. 1 a and 1b, be the process flow diagram of preparation before the existing system upgrading and escalation process realization.The same with the Windows system, the system upgrade of linux system also is that the unexpected factors of non-software such as computer circuit breaking can not appear in supposition in customer upgrade procedure.Usually, in the system upgrade process, require computing machine not cut off the power supply, comprise that the people is for carrying out cold restart.Yet in industrial application, this assumed conditions is not necessarily set up.If at the decompress(ion) AKU shown in Fig. 1 a, to add, replace, revise in the corresponding document process (step 106), the situation of computer circuit breaking or cold restart has appearred, will cause the system upgrade failure, cause operating system to be destroyed probably simultaneously.Not only do not eliminate the defective (BUG) of software, cause system's instability even system crash simultaneously yet.
Summary of the invention
Sudden power occurs and cause program or system normally not to move in order to solve escalation process; On the basis of preparation and the escalation process of the present invention before the existing system shown in Fig. 1 a and 1b upgrading, mainly added system backup (step 108 of Fig. 2 a) and system upgrade recovery (step 214 of Fig. 2 b).
Cause the problem of the system failure to outage in the system upgrade process; The present invention proposes the upgrade method of the anti-power down of a kind of linux system; Its general plotting is: in the upgrading set-up procedure, carries out the decompress(ion) AKU, carries out system backup before interpolation, replacement, the modification corresponding document, and in the system upgrade process, the system upgrade state being carried out mark; The upgrade status and upgrading type start-up system upgrading restoring different according to system; Particularly under the state of upgrading failure, realize that through calling standby system the method for system's rollback realizes that system upgrade recovers, thereby the assurance system can start normally.
Description of drawings
Fig. 1 a is the process flow diagram that set-up procedure realizes before the existing system upgrading;
The process flow diagram that Fig. 1 b realizes for the existing system upgrade method;
The process flow diagram that Fig. 2 a realizes for the preceding set-up procedure of the system upgrade of the anti-power down of the present invention;
Fig. 2 b is the process flow diagram of the system upgrade method realization of the anti-power down of the present invention;
Fig. 3 realizes the process flow diagram of system backup function for the present invention;
Fig. 4 is the present invention's process flow diagram that executive system is recovered after system's power down.
Embodiment
In order to make the object of the invention, technical scheme and beneficial effect clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The upgrade method of anti-power down involved in the present invention mainly comprises two parts, that is: system backup and system upgrade restore funcitons.
As shown in Figure 3, the flow process that the system backup function realizes is:
1) at first judging system upgrade type (step 110), obtain the upgrading type parameter type of the upgrading configuration update.conf on the remote server, if the value of type is 0, then is non-kernel level upgrading; If the value of type is 1, then be the kernel level upgrading.
2) if be non-kernel level upgrading (value that is type is 0); Then obtain the filename of the file/etc/X11/xorg.conf among the compressed package update01.tgz, this document name is added among the upgrade file tabulation update_file.list (step 111) according to the upgrading compressed package update01.tgz utility command tar – tvf that downloads; Then according to the filename of this upgrade file tabulation update_file.list file/etc/X11/xorg.conf; Obtain the content of the current file/etc/X11/xorg.conf of system; The content of copied files/etc/X11/xorg.conf backs up to backup directory/backup/unkernel/ that (file that will back up is to exist in the upgrading tabulation; And the same file that exists in system) (step 113); Will be in the time of copied files according to the file backup of the respective directories of system, that is: with catalogue
Mkdir – p/backup/unkernel/etc/X11; // create directory/etc/X11
cp /etc/X11/xorg.conf /backup/unkernel/backup/unkernel/etc/X11;
// file xorg.conf is backuped among catalogue/etc/X11
3) if the upgrading of operating system kernel level (that is: the value of type is 1); Then be decompressed to system start-up boot configuration file grub.conf in the update package among backup directory/backup/kernel/ (if usefulness is the grub guiding; Then file is grub.conf) (step 112), that is:
tar?–xzvf?update01.tgz-C?/backup/kernel/grub.conf;
// the system start-up boot configuration file grub.conf among the update package update01.tgz is unziped among backup directory/backup/kernel/;
Alternative document is unziped in system's respective directories (step 114), that is:
tar?–xzvfupdate01.tgz–C?/?/boot/vmlinuz*?/boot/initrd*
// with file boot/vmlinuz-2.6.32-neo and boot/initrd-2.6.32-neo.img unzip to root directory in the system directory/in;
Need to prove that for other upgrading of kernel level, kernel file can not be born the same name with the kernel file used in the system in the update package, and the corresponding startup boot configuration file of new kernel file will be arranged in the update package).Wherein, the backup directory structure is divided into kernel level/backup/kernel and non-kernel level file backup catalogue/backup/unkernel.
In addition, after system backup is intact, also need create system upgrade status indicator file; Upgrade status is carried out mark; The establishment of upgrade status identification document has several different methods, can be through setting up a new file, represent the different conditions of upgrading through the filename that changes file.
Upgrade method for traditional sense is not generally distinguished the upgrading classification; Rollback work after backup before though also can upgrade and the upgrading failure; But when carrying out the operating system nucleus upgrading, outage occurs and wait fortuitous event then can cause operating system itself normally not start, the rollback function of ROMPaq self just can not realize like this; The renders operation system can't normally use, and greatly reduces the security of upgrading.
Fortuitous events such as outage appear in the escalation process in order to solve; Guarantee the problem that operating system still can normally be moved; Consider kernel level upgrading if fortuitous event can cause operating system itself possibly can't normally start, special circumstances, the present invention is divided into two types of kernel level upgradings to upgrading and non-kernel level is upgraded; Do pointed different disposal route for these two types of upgradings, thereby guaranteed the reliability of upgrading.
Present embodiment is to realize upgrade status is carried out mark through the method that in the upgrade status identification document, writes mark value; The mark value value is 0 (system upgrade failure) or 1 (system upgrade success); Under the default situations of the intact back of system backup; Upgrade status is labeled as failure, that is: the mark value value is 0 (step 115 of Fig. 3), that is:
echo?0?>/update/etc/update.stat;
// create system upgrade status indicator file update.stat, mark value 0 is write in this document;
If system completes successfully the decompress(ion) AKU, add, replace, revise corresponding document (step 106 of Fig. 2 a), then the upgrade status identification document is revised as success (step 109 of Fig. 2 a), that is:
echo?1?>/update/etc/update.stat;
// with among the mark value 1 writing system upgrade status identification document update.stat;
System or program are restarted back (step 107 of Fig. 2 a), and kernel starts (step 210 of Fig. 2 b), start init process (step 211 of Fig. 2 b).Detect upgrading type file and upgrade status identification document and whether have (step 213 of Fig. 2 b); If exist then executive system upgrading restoring program (step 214 of Fig. 2 b); Its function is to the decompress(ion) AKU, adds, replaces, revises the fault that occurs because of power down suddenly in corresponding document (step 106 of Fig. 2 a) process and recover.
As shown in Figure 4, the flow process that system upgrade recovers to realize is:
1) state of detection upgrade status tab file, judgement are success or failure, judge the ident value of this upgrade status tab file that is:, if the success of 1 expression of this ident value system upgrade; If this ident value 0 expression system upgrade failure (step 120);
2) detect the upgrading type, judgement is that the kernel level upgrading also is non-kernel level upgrading, judges the upgrading type parameter type of upgrading configuration update.conf that is:, if the value of type is 0, then is non-kernel level upgrading; If the value of type is 1, then be kernel level upgrading (step 121 and 122);
3) carry out corresponding operating according to detecting upgrade status with the upgrading type, concrete steps are following:
(1) if upgrades successfully (ident value is 1) and is kernel level (value of type is 1); Then copy system start-up boot configuration file grub.conf among backup directory/backup/kernel/ among the corresponding catalogue/boot/grub/ of system to the original boot configuration file (step 1211) that starts of replacement;
That is: cp – r/backup/kernel/grub.conf/boot/grub/
// copy system start-up boot configuration file grub.conf among backup directory/backup/kernel/ among the corresponding catalogue/boot/grub/ of system to;
(2) if upgrade successfully (ident value is 1) and for non-kernel level upgrading (value of type is 0) then delete system start-up boot configuration file grub.conf (step 1212) among backup directory/backup/kernel/, that is:
rm?–rf/backup/kernel/grub.conf;
// with system start-up boot configuration file grub.conf deletion among backup directory/backup/kernel/;
(3) if upgrading failure (ident value is 0) and be kernel level upgrade (value of type is 1); Then delete system start-up boot configuration file grub.conf among backup directory/backup/kernel/, and the corresponding kernel file of upgrading in the deletion system (step 1221)
rm?–rf?/backup/kernel/grub.conf;
System start-up boot configuration file grub.conf among // deletion backup directory/backup/kernel/;
rm?–rf/boot/vmliuz-2.6.32-neo/boot/initrd-2.6.32-neo.img;
The corresponding kernel file vmliuz-2.6.32-neo and the initrd-2.6.32-neo.img that upgrade in // the deletion system;
(4) if upgrading is failed (ident value is 0) and be non-kernel level upgrading (value of type is 0); Then copy the file xorg.conf of respective backup among backup directory/backup/kernel/ among the corresponding catalogue/etc/X11/ of system (step 1222), that is: to
cp?–r?/backup/unkernel/etc/X11/xorg.conf/etc/X11/;
// copy the file xorg.conf of respective backup among backup directory/backup/kernel/ among the corresponding catalogue/etc/X11/ of system to;
4) last, deletion upgrade status tab file update.stat (step 123).
rm?–rf?/update/etc/update.stat;
// deletion upgrade status tab file update.stat
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being made, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the upgrade method of the anti-power down of a linux system; It is characterized in that this method was carried out system backup before system upgrade, and in the system upgrade process, the system upgrade state being carried out mark; The start-up system upgrading restoring; Under the state of system upgrade failure, realize that through calling standby system the method for system's rollback realizes that system upgrade recovers, thereby the assurance system can start normally.
2. the method for claim 1 is characterized in that, in the upgrading set-up procedure, carries out the decompress(ion) AKU, carries out system backup before interpolation, replacement, the modification corresponding document.
3. according to claim 1 or claim 2 method is characterized in that, if be non-kernel level upgrading, then obtains the filename of compressed package file according to the upgrading compressed package utility command of downloading, and this document name is added in the upgrade file tabulation; According to the filename of this upgrade file tabulation file, obtain the content of current system file then, the content of copied files backs up to backup directory, will be according to the file backup with catalogue of the respective directories of system in the time of copied files.
4. according to claim 1 or claim 2 method is characterized in that, if the upgrading of operating system kernel level then is decompressed to system start-up boot configuration file in the update package in the backup directory.
5. the method for claim 1; It is characterized in that; It is through newly-built one file that the system upgrade state is carried out mark; The filename that changes file is represented the different conditions of upgrading, or: represent the different conditions of upgrading through the method that in the upgrade status identification document, writes different mark value.
6. the method for claim 1 is characterized in that, after system backup is intact upgrade status is labeled as failure, if system completes successfully the decompress(ion) AKU, adds, replaces, revises corresponding document, then the upgrade status identification document is revised as success.
7. the method for claim 1; It is characterized in that the start-up system upgrading restoring is if upgrade successfully and the upgrading type is a kernel level; Then copy system start-up boot configuration file in the backup directory in the corresponding catalogue of system to the original boot configuration file that starts of replacement.
8. the method for claim 1 is characterized in that, the start-up system upgrading restoring successfully and for non-kernel level is upgraded if upgrade, and then deletes system start-up boot configuration file in the backup directory.
9. the method for claim 1 is characterized in that, the start-up system upgrading restoring, if upgrading is failed and for the kernel level upgrading, then delete system start-up boot configuration file in the backup directory, and the corresponding kernel file of upgrading in the deletion system.
10. the method for claim 1 is characterized in that, the start-up system upgrading restoring, if upgrading failure and be that non-kernel level is upgraded, then the document copying of respective backup in the backup directory in the corresponding catalogue of system.
CN2011103150736A 2011-10-17 2011-10-17 Power-failure-preventing upgrading method of Linux system Pending CN102455954A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103150736A CN102455954A (en) 2011-10-17 2011-10-17 Power-failure-preventing upgrading method of Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103150736A CN102455954A (en) 2011-10-17 2011-10-17 Power-failure-preventing upgrading method of Linux system

Publications (1)

Publication Number Publication Date
CN102455954A true CN102455954A (en) 2012-05-16

Family

ID=46039163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103150736A Pending CN102455954A (en) 2011-10-17 2011-10-17 Power-failure-preventing upgrading method of Linux system

Country Status (1)

Country Link
CN (1) CN102455954A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064715A (en) * 2013-01-09 2013-04-24 上海大唐移动通信设备有限公司 Remote upgrade method and system for automatic drive test systems
CN104918114A (en) * 2015-06-05 2015-09-16 青岛海信电器股份有限公司 Method and device for upgrading operation system
CN106776128A (en) * 2016-11-29 2017-05-31 邦彦技术股份有限公司 Method for ensuring normal start of Linux operating system
CN107193603A (en) * 2017-05-25 2017-09-22 绵阳美菱软件技术有限公司 The upgrade method and device of a kind of intelligent appliance
CN107357614A (en) * 2017-06-30 2017-11-17 深圳前海弘稼科技有限公司 Parameter updating method and device, planting box and storage medium
CN107608696A (en) * 2017-09-25 2018-01-19 龙尚科技(上海)有限公司 A kind of method of power-off protection upgrading wireless communication module under linux system
CN108694051A (en) * 2018-05-18 2018-10-23 深圳市先河系统技术有限公司 Upgrade method, device based on dual system and storage device
CN108762794A (en) * 2018-04-03 2018-11-06 深圳市布谷鸟科技有限公司 Meter panel of motor vehicle upgrade-system and its upgrade method
CN109815053A (en) * 2019-01-04 2019-05-28 厦门亿联网络技术股份有限公司 A kind of realization IP phone multi-mode system upgrading failure recovery method
CN111258812A (en) * 2020-01-10 2020-06-09 成都千立网络科技有限公司 Terminal access equipment fault recovery system based on linux kernel
CN111459527A (en) * 2019-01-18 2020-07-28 爱思开海力士有限公司 Memory system and operating method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5381545A (en) * 1991-06-04 1995-01-10 International Business Machines Corporation Data backup and recovery in a data processing system
CN101038549A (en) * 2007-03-28 2007-09-19 北京启明星辰信息技术有限公司 A software updating method capable of crossing system
CN101051273A (en) * 2006-04-07 2007-10-10 北京汉辰科技有限公司 Reliable soft ware upgrading method for IPIV
CN101464814A (en) * 2007-12-18 2009-06-24 康佳集团股份有限公司 Embedded system and its implementing method, and embedded equipment
CN101556547A (en) * 2009-05-25 2009-10-14 芯通科技(成都)有限公司 Safe method and system used for remotely upgrading embedded Linux kernel

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5381545A (en) * 1991-06-04 1995-01-10 International Business Machines Corporation Data backup and recovery in a data processing system
CN101051273A (en) * 2006-04-07 2007-10-10 北京汉辰科技有限公司 Reliable soft ware upgrading method for IPIV
CN101038549A (en) * 2007-03-28 2007-09-19 北京启明星辰信息技术有限公司 A software updating method capable of crossing system
CN101464814A (en) * 2007-12-18 2009-06-24 康佳集团股份有限公司 Embedded system and its implementing method, and embedded equipment
CN101556547A (en) * 2009-05-25 2009-10-14 芯通科技(成都)有限公司 Safe method and system used for remotely upgrading embedded Linux kernel

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064715A (en) * 2013-01-09 2013-04-24 上海大唐移动通信设备有限公司 Remote upgrade method and system for automatic drive test systems
CN104918114A (en) * 2015-06-05 2015-09-16 青岛海信电器股份有限公司 Method and device for upgrading operation system
CN104918114B (en) * 2015-06-05 2018-05-18 青岛海信电器股份有限公司 A kind of operating system update method and device
CN106776128B (en) * 2016-11-29 2020-04-21 邦彦技术股份有限公司 Method for ensuring normal start of Linux operating system
CN106776128A (en) * 2016-11-29 2017-05-31 邦彦技术股份有限公司 Method for ensuring normal start of Linux operating system
CN107193603A (en) * 2017-05-25 2017-09-22 绵阳美菱软件技术有限公司 The upgrade method and device of a kind of intelligent appliance
CN107357614A (en) * 2017-06-30 2017-11-17 深圳前海弘稼科技有限公司 Parameter updating method and device, planting box and storage medium
CN107357614B (en) * 2017-06-30 2020-12-04 深圳春沐源控股有限公司 Parameter updating method and device, planting box and storage medium
CN107608696A (en) * 2017-09-25 2018-01-19 龙尚科技(上海)有限公司 A kind of method of power-off protection upgrading wireless communication module under linux system
CN108762794A (en) * 2018-04-03 2018-11-06 深圳市布谷鸟科技有限公司 Meter panel of motor vehicle upgrade-system and its upgrade method
CN108694051A (en) * 2018-05-18 2018-10-23 深圳市先河系统技术有限公司 Upgrade method, device based on dual system and storage device
CN109815053A (en) * 2019-01-04 2019-05-28 厦门亿联网络技术股份有限公司 A kind of realization IP phone multi-mode system upgrading failure recovery method
CN109815053B (en) * 2019-01-04 2021-04-06 厦门亿联网络技术股份有限公司 Method for realizing IP phone multi-mode system upgrade failure recovery
CN111459527A (en) * 2019-01-18 2020-07-28 爱思开海力士有限公司 Memory system and operating method thereof
CN111459527B (en) * 2019-01-18 2023-09-05 爱思开海力士有限公司 Memory system and method of operating the same
US11966603B2 (en) 2019-01-18 2024-04-23 SK Hynix Inc. Memory system for updating firmware when SPO occurs and operating method thereof
CN111258812A (en) * 2020-01-10 2020-06-09 成都千立网络科技有限公司 Terminal access equipment fault recovery system based on linux kernel

Similar Documents

Publication Publication Date Title
CN102455954A (en) Power-failure-preventing upgrading method of Linux system
EP2318929B1 (en) Application restore points
US8924783B2 (en) Self-managed processing device
JP5444178B2 (en) Backup / restore processing device, backup / restore processing method and program
CN104636217A (en) Root file system automatic backup and exception recovery method and partition structure
CN109032838B (en) Automatic verification method for consistency of backup and recovery data of virtual machine
CN102163167A (en) Method and device for rescuing system
CN101196839A (en) Data renovation and synchronization process of double-flash read-only memory
CN104572352A (en) POS terminal key data backup recovery method
CN111984366B (en) Method and system for containerized deployment of disaster recovery mechanism
US8132047B2 (en) Restoring application upgrades using an application restore point
CN115437818A (en) Automatic restoration method, system, storage medium and equipment for VxWorks system start failure
Cisco Managing the RDU Database
CN114138563A (en) Method for backing up and restoring Hyper-V virtual machine
CN113672436A (en) Disaster recovery backup method, device, equipment and storage medium
WO2014147707A1 (en) Informaton processing device, information processing method, and information processing program
CN113190379B (en) Method, system and medium for reducing backup set of database backup
CN107391216A (en) A kind of method for upgrading software and device
CN114003436A (en) Software backup method and device
CN114253765A (en) Data recovery method and related equipment
JP6276604B2 (en) Information processing apparatus and control method thereof
CN111258812A (en) Terminal access equipment fault recovery system based on linux kernel
CN116009891A (en) Method for managing operating system, electronic device and computer program product
CN112148532A (en) Batch recovery method and device for hard disk data, storage medium and electronic equipment
CN117850827A (en) Domestic operating system security upgrading device and method with transaction characteristics

Legal Events

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

Application publication date: 20120516