WO2018098834A1 - Method for ensuring normal booting of linux operating system - Google Patents
Method for ensuring normal booting of linux operating system Download PDFInfo
- Publication number
- WO2018098834A1 WO2018098834A1 PCT/CN2016/108512 CN2016108512W WO2018098834A1 WO 2018098834 A1 WO2018098834 A1 WO 2018098834A1 CN 2016108512 W CN2016108512 W CN 2016108512W WO 2018098834 A1 WO2018098834 A1 WO 2018098834A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- initramfs
- original
- image file
- command
- file
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
Definitions
- the present invention relates to the field of Linux operating systems, and in particular, to a method for ensuring normal startup of a Linux operating system.
- the MTCA platform is widely used in occasions where the environmental stability is not high, it often faces the situation that some equipments are powered off, which will affect the hard disk being read and written, such as incomplete data and file system damage. In particular, the latter can cause the system on the board to fail to start and the board will not work properly.
- the boards equipped with hard disks in the MTCA platform are mainly x86 computing boards. Due to the versatility of the x86 architecture, various manufacturers generally do not specifically develop systems for cost saving, convenient use, and rapid deployment. Stable Linux distributions, such as Redhat, CentOS, Ubuntu Server, etc.
- the main purpose of the present invention is to provide a method for ensuring the normal startup of the Linux operating system. When the file system on the hard disk is damaged, the Linux operating system can still be started normally.
- the method for ensuring normal startup of a Linux system includes the following steps: when partitioning a hard disk, create a partition having the same size as the original root partition as a snapshot partition;
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Stored Programmes (AREA)
- Retry When Errors Occur (AREA)
Abstract
A method for ensuring normal booting of a Linux operating system, comprising the following steps: upon partitioning a hard disk, creating a partition having the same size as an original root partition to serve as a snapshot partition (S10); installing the Linux operating system to the original root partition (S20); modifying an original initramfs mirror image in /boot (S30); the step of modifying the original initramfs mirror image in /boot specifically comprising: using the gunzip command and the cpio command to unzip the original initramfs mirror image to a preset directory (S310); adding the device-mapper package to the preset directory; if the dmsetup command is not present in the sbin sub-directory, placing the dmsetup command in the device-mapper package into the sbin sub-directory (S320); editing the init script so as to modify code in a mounted root file system thereof and add a corresponding code logic thereto (S330); and generating a new initramfs mirror image to overwrite the original initramfs mirror image (S340). By utilizing the aforesaid method, the system can be automatically recovered and normally booted without human intervention when the file system in the hard disk is damaged, thus guaranteeing the operating system can be normally booted up.
Description
本发明涉及Linux操作系统领域,尤其涉及一种保障Linux操作系统正常启动的方法。The present invention relates to the field of Linux operating systems, and in particular, to a method for ensuring normal startup of a Linux operating system.
目前,由于MTCA平台广泛应用于环境稳定性不高的场合,经常面临一些设备整框断电的情况,会给正在读写中的硬盘造成一定影响,比如数据不完整、文件系统损坏等问题,尤其是后者,严重时会导致板卡上的系统无法启动,板卡因而无法正常工作。MTCA平台中配备硬盘的板卡主要是x86计算板,由于x86架构的通用性,各个厂家为节约成本、方便使用、快速部署等方面考虑,一般不会专门为其开发系统,而是直接安装成熟稳定的Linux发行版,如Redhat、CentOS、Ubuntu Server等,这些系统在启动时如果检测到硬盘上的文件系统损坏,会采取保守修复,即仅当文件并无实际损坏、只是文件系统记录表为非clean状态时,才进行轻微的状态修复,修复成功后正常启动。如果确实有文件损坏,则系统不进行修复,也不会正常启动,而是进入一种维护模式,需要用户连接显示器进入系统,手动做一些备份数据、修复系统之类的工作;该模式只是一个最小化系统,不会运行用户部署的各种软件和服务,也就是说板卡没有正常工作。目前,安装这些系统的x86计算板一旦出现文件损坏、系统无法启动的情况,主要是靠用户连接显示器手工修复,不仅对用户的技术能力要求高,而且在MTCA应用场合中,显示器和有技能的人并非经常在现场,发现和解决问题将大大滞后,该问题对工作的不良影响较大。At present, because the MTCA platform is widely used in occasions where the environmental stability is not high, it often faces the situation that some equipments are powered off, which will affect the hard disk being read and written, such as incomplete data and file system damage. In particular, the latter can cause the system on the board to fail to start and the board will not work properly. The boards equipped with hard disks in the MTCA platform are mainly x86 computing boards. Due to the versatility of the x86 architecture, various manufacturers generally do not specifically develop systems for cost saving, convenient use, and rapid deployment. Stable Linux distributions, such as Redhat, CentOS, Ubuntu Server, etc. These systems will take a conservative repair if they detect a file system corruption on the hard disk at boot time, that is, only if the file is not actually damaged, but the file system record table is In the non-clean state, a minor state repair is performed, and the repair starts normally after the repair succeeds. If there is indeed a file corruption, the system will not be repaired and will not start normally. Instead, it will enter a maintenance mode, requiring the user to connect the display to the system, manually do some backup data, repair the system and the like; this mode is just a Minimize the system and not run the various software and services deployed by the user, which means the board is not working properly. At present, in the case of file corruption and system inability to start the x86 computing board installed with these systems, it is mainly manually repaired by the user connected display, which not only requires high technical capabilities of the user, but also in the MTCA application, the display and the skilled People are not always on the scene, and the problem of finding and solving problems will be greatly delayed. This problem has a bad influence on the work.
发明内容Summary of the invention
本发明的主要目的在于提供一种保障Linux操作系统正常启动的方法,在硬盘上的文件系统损坏时,仍可保证该Linux操作系统能够正常启动。The main purpose of the present invention is to provide a method for ensuring the normal startup of the Linux operating system. When the file system on the hard disk is damaged, the Linux operating system can still be started normally.
为实现上述目的,本发明提供的保障Linux系统正常启动的方法,包括下列步骤:在硬盘分区时,创建一与原始根分区大小相同的分区作为快照分区;
To achieve the above objective, the method for ensuring normal startup of a Linux system includes the following steps: when partitioning a hard disk, create a partition having the same size as the original root partition as a snapshot partition;
Claims (1)
- 安装所述Linux操作系统至所述原始根分区中;修改/boot中的原始initramfs镜像文件;所述修改/boot中的原始initramfs镜像文件的步骤具体包括:用gunzip命令和cpio命令将所述原始initramfs镜像文件解包到一预定目录中;在所述预定目录中加入device-mapper软件包;当sbin子目录中不存在dmsetup命令,则将所述所含device-mapper软件包里面的dmsetup命令放到所述sbin子目录中;编辑init脚本程序,修改其挂载根文件系统的代码,加入相应的代码逻辑;生成新的initramfs镜像文件以覆盖所述原始initramfs镜像文件。Installing the Linux operating system into the original root partition; modifying the original initramfs image file in /boot; the step of modifying the original initramfs image file in /boot specifically includes: using the gunzip command and the cpio command to use the original The initramfs image file is unpacked into a predetermined directory; the device-mapper package is added to the predetermined directory; when the dmsetup command does not exist in the sbin subdirectory, the dmsetup command in the included device-mapper package is placed. Go to the sbin subdirectory; edit the init script, modify the code that mounts the root filesystem, add the appropriate code logic, and generate a new initramfs image file to overwrite the original initramfs image file.优选地,所述原始initramfs镜像文件是一个gz格式压缩的cpio文件。Preferably, the original initramfs image file is a cpio file compressed in gz format.优选地,所述修改/boot中的原始initramfs镜像文件具体是修改所述原始initramfs镜像文件的init脚本程序,并视存在与否加入dmsetup程序到sbin目录。Preferably, the original initramfs image file in the modified /boot is specifically an init script program that modifies the original initramfs image file, and joins the dmsetup program to the sbin directory depending on whether it exists or not.优选地,所述Linux系统为Red hat、CentOS或Ubuntu Server发行版系统。Preferably, the Linux system is a Red Hat, CentOS or Ubuntu Server distribution system.优选地,所述保障Linux系统正常启动的方法应用于MTCA环境中硬盘文件系统损坏的情况。Preferably, the method for ensuring normal startup of the Linux system is applied to a situation in which the hard disk file system is damaged in the MTCA environment.优选地,所述Packages存在于安装光盘中。Preferably, the Packages are present in an installation CD.优选地,所述相应的代码逻辑包括:根据配置文件的内容确定是否挂载快照分区、是否对文件系统进行检查和修复、以及是否对新文件的合并处理。Preferably, the corresponding code logic comprises: determining whether to mount the snapshot partition, whether to check and repair the file system according to the content of the configuration file, and whether to merge the new file.优选地,所述生成新的initramfs镜像文件以覆盖所述原始initramfs镜像文件文件的步骤具体是采用cpio命令和gzip命令生成新的initramfs镜像文件以覆盖所述原始initramfs镜像文件。Preferably, the step of generating a new initramfs image file to overwrite the original initramfs image file is specifically generating a new initramfs image file by using the cpio command and the gzip command to overwrite the original initramfs image file.优选地,所述预定目录为目录initramfs-new,所述device-mapper软件包具体是Packages中的device-mapper软件包。Preferably, the predetermined directory is a directory initramfs-new, and the device-mapper software package is specifically a device-mapper software package in Packages.在本发明中,通过采用以上这种保障Linux系统正常启动的方法之后,在硬盘上的文件系统损坏时,不需要人工参与,即可自动恢复系统而正常启动,可保证操作系统能够正常启动。 In the present invention, after the above method for ensuring the normal startup of the Linux system is adopted, when the file system on the hard disk is damaged, the system can be automatically restored and started normally without manual intervention, and the operating system can be started normally.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611088146.1 | 2016-11-29 | ||
CN201611088146.1A CN106776128B (en) | 2016-11-29 | 2016-11-29 | Method for ensuring normal start of Linux operating system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018098834A1 true WO2018098834A1 (en) | 2018-06-07 |
Family
ID=58915179
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/108512 WO2018098834A1 (en) | 2016-11-29 | 2016-12-05 | Method for ensuring normal booting of linux operating system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106776128B (en) |
WO (1) | WO2018098834A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783117A (en) * | 2019-01-18 | 2019-05-21 | 中国人民解放军国防科技大学 | Mirror image file making and starting method of diskless system |
WO2021169355A1 (en) * | 2020-09-23 | 2021-09-02 | 平安科技(深圳)有限公司 | Mirror image system generation method and apparatus, and device and medium |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107590272B (en) * | 2017-09-26 | 2020-04-10 | 天津麒麟信息技术有限公司 | Operating system snapshot realization method based on Overlay file system |
CN109062576A (en) * | 2018-07-18 | 2018-12-21 | 郑州云海信息技术有限公司 | A kind of method and device for repairing file system by initramfs |
CN111367854B (en) * | 2018-12-25 | 2023-02-28 | 成都鼎桥通信技术有限公司 | Construction method of multi-container root file system |
CN111339544B (en) * | 2019-04-24 | 2023-03-14 | 上海安路信息科技股份有限公司 | Offline downloading device and offline downloading method |
CN112579521A (en) * | 2019-09-29 | 2021-03-30 | 北京君正集成电路股份有限公司 | File system implementation method based on equipment mapping mechanism |
CN112579345A (en) * | 2019-09-29 | 2021-03-30 | 北京君正集成电路股份有限公司 | Method for realizing file system restoration based on device mapper mechanism |
CN112579179A (en) * | 2019-09-30 | 2021-03-30 | 合肥杰发科技有限公司 | Partition mounting method of embedded system |
CN112948170B (en) * | 2019-12-10 | 2024-04-09 | 中标软件有限公司 | Method for realizing system power-down protection by using snapshot function of equipment mapping |
CN111241039A (en) * | 2020-01-07 | 2020-06-05 | 天津麒麟信息技术有限公司 | File system power-off protection method, module, readable storage medium and electronic equipment |
CN112463240B (en) * | 2020-12-09 | 2023-04-25 | 成都傲梅科技有限公司 | Method for restarting access to WinPE |
CN112579256B (en) * | 2020-12-14 | 2022-04-19 | 上海英方软件股份有限公司 | Linux migration method and device |
CN112783699B (en) * | 2021-02-20 | 2023-04-18 | 杭州迪普科技股份有限公司 | Method and device for starting emergency mode of community enterprise operating system |
CN113778536A (en) * | 2021-09-07 | 2021-12-10 | 浙江八达电子仪表有限公司时通电气分公司 | Integrated intelligent operating device embedded into Linux operating system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070050675A1 (en) * | 2005-08-29 | 2007-03-01 | Moxa Technologies Co., Ltd. | [method for restoring a booted system] |
CN101232397A (en) * | 2008-02-22 | 2008-07-30 | 华为技术有限公司 | Apparatus and method for renovating multi controller systems |
CN102831034A (en) * | 2012-08-14 | 2012-12-19 | 中国电力科学研究院 | Multimode backup and quick recovery method based on embedded Linux device |
CN104035837A (en) * | 2013-10-29 | 2014-09-10 | 浪潮电子信息产业股份有限公司 | Method for backing up isomorphic/isomerous UNIX/Linux host on line |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1277214C (en) * | 2003-08-12 | 2006-09-27 | 联想(北京)有限公司 | Embedded system upgrading method |
US20090254898A1 (en) * | 2008-04-08 | 2009-10-08 | Microsoft Corporation | Converting a device from one system to another |
CN102262568B (en) * | 2010-05-25 | 2014-01-15 | 中标软件有限公司 | Power-down prevention Linux system startup method |
CN102455954A (en) * | 2011-10-17 | 2012-05-16 | 中标软件有限公司 | Power-failure-preventing upgrading method of Linux system |
CN102662749B (en) * | 2012-03-23 | 2018-02-13 | 天津中兴智联科技有限公司 | A kind of implementation method and device of double Boot switchings |
CN103885847A (en) * | 2014-02-08 | 2014-06-25 | 京信通信系统(中国)有限公司 | Dog feeding method and device based on embedded system |
-
2016
- 2016-11-29 CN CN201611088146.1A patent/CN106776128B/en active Active
- 2016-12-05 WO PCT/CN2016/108512 patent/WO2018098834A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070050675A1 (en) * | 2005-08-29 | 2007-03-01 | Moxa Technologies Co., Ltd. | [method for restoring a booted system] |
CN101232397A (en) * | 2008-02-22 | 2008-07-30 | 华为技术有限公司 | Apparatus and method for renovating multi controller systems |
CN102831034A (en) * | 2012-08-14 | 2012-12-19 | 中国电力科学研究院 | Multimode backup and quick recovery method based on embedded Linux device |
CN104035837A (en) * | 2013-10-29 | 2014-09-10 | 浪潮电子信息产业股份有限公司 | Method for backing up isomorphic/isomerous UNIX/Linux host on line |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783117A (en) * | 2019-01-18 | 2019-05-21 | 中国人民解放军国防科技大学 | Mirror image file making and starting method of diskless system |
WO2021169355A1 (en) * | 2020-09-23 | 2021-09-02 | 平安科技(深圳)有限公司 | Mirror image system generation method and apparatus, and device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN106776128A (en) | 2017-05-31 |
CN106776128B (en) | 2020-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018098834A1 (en) | Method for ensuring normal booting of linux operating system | |
US11762740B2 (en) | Systems and methods for efficient backup restoration | |
RU2409838C2 (en) | Archiving data in virtual application enviroinment | |
US20120084601A1 (en) | Computer system rescue method | |
US8578203B2 (en) | Providing a backup service from a remote backup data center to a computer through a network | |
US20070050675A1 (en) | [method for restoring a booted system] | |
CN107818029B (en) | Automatic test method for cloud hard disk data recovery consistency | |
KR20140109401A (en) | Backing up firmware during initialization of device | |
WO2015176433A1 (en) | Hard disk repairing method and device based on partition table | |
US20100037092A1 (en) | System and method for backup, reboot, and recovery | |
WO2012031567A1 (en) | Fault tolerance method and device for file system | |
CN105593829A (en) | Excluding file system objects from raw image backups | |
CN103514022A (en) | RAID card drive integration method under LINUX | |
CN104572354A (en) | Backup and restoration method for operating system based on restoration service and equipment thereof | |
TW201333688A (en) | Electronic device with repairing function of baseboard management controller firmwire and repairing method thereof | |
EP1764687A1 (en) | Method for restoring a booted system | |
TWI623834B (en) | Booting method for computer system | |
WO2017173924A1 (en) | Method and device for switching between file systems | |
CN105630523A (en) | Computer BIOS data recovery system and method | |
CN109710377B (en) | Method for recovering kvm virtual machine from faulty distributed storage | |
TW202139006A (en) | Server with system setting data synchronization function | |
US8990618B2 (en) | Partial fault tolerance in an embedded appliance | |
CN112948170B (en) | Method for realizing system power-down protection by using snapshot function of equipment mapping | |
TW201301018A (en) | System and method for recovering a master boot record of a disk | |
KR102423056B1 (en) | Method and system for swapping booting disk |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16922967 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16922967 Country of ref document: EP Kind code of ref document: A1 |