Method and apparatus for repairing file system by initramfs

A file system and file system format technology, applied in the field of file system repair through initramfs, can solve the problems of file system damage, complicated operation, startup stuck, etc., and achieve the effect of highlighting substantive features, wide application prospects, and reliable design principles

Inactive Publication Date: 2018-12-21
ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF4 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] When problems occur during the disk reading and writing process of the Linux system, such as abnormal termination, loose interface, abnormal power failure, or application process reading and writing errors, etc., the file system will be damaged, and the file system needs to be repaired; if it is a non-system disk , if the file system of the data disk is damaged, you can use fsck, xfs_repair and other tools to repair the file system under the system; but if there is a problem with the file sys...

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and apparatus for repairing file system by initramfs
  • Method and apparatus for repairing file system by initramfs

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0054] like figure 1 As shown, a method for repairing a file system through initramfs includes the following steps:

[0055] S1: Recompile and generate initramfs and compile the file system repair tool into initramfs;

[0056] S2: Set the interrupt breakpoint for the newly compiled initramfs;

[0057] S3: Query the file system format of the root directory;

[0058] S4: Execute a file system repair instruction according to the file format of the partition system.

[0059] Before step S1 includes:

[0060] S0: Create a temporary folder under the system.

[0061] Step S1 includes:

[0062] S11: recompile initramfs, and install fsck.ext3, fsck.ext4, xfs_repair file system repair tools into initramfs;

[0063] S12: Put the compiled initramfs into the / boot directory.

[0064] like figure 2As shown, step S2 includes:

[0065] S21: Edit the grub parameters on the grub interface when the system starts;

[0066] S22: Add rdbreak=[breakpoint] in the kernel line;

[0067] S23...

Embodiment 2

[0073] A method for repairing a file system through initramfs, comprising the steps of:

[0074] S0: Create a temporary folder under the system:

[0075] # mkdir / test & cd / test

[0076] S1: Recompile initramfs, and install file system repair tools such as fsck.ext3, fsck.ext4, xfs_repair:

[0077] # dracut --install 'fsck.ext3 fsck.ext4 xfs_repair' initramfs-repairfs.img

[0078] Put the new initramfs into the / boot directory for backup:

[0079] # mv / test / initramfs-rapairfs.img / boot

[0080] S2: When you need to repair the file system in initramfs, start to the grub interface, press 'e' to modify, modify the kernel line, add a breakpoint of initramfs at the end of the line, and enter the breakpoint before the root directory of mount / sysroot:

[0081] rdbreak=mount

[0082] Modify the initrd line to boot from the / initramfs-rapairfs.img file, and press 'b' to boot into the initramfs system;

[0083] The stages of entering initramfs as a breakpoint include cmdline, p...

Embodiment 3

[0107] A device for repairing a file system through initramfs, including a compilation module, an interrupt setting module, a query module and an execution module;

[0108] The compilation module is used to recompile and generate initramfs and compile the file system repair tool into initramfs;

[0109] The interrupt setting module is used to set the interrupt breakpoint to enter the newly compiled initramfs;

[0110] The query module is used to query the file system format of the root directory;

[0111] The execution module is used for executing the repair instruction of the file system according to the file format of the partition system.

[0112] The system also includes a creating module, which is used to create a temporary folder under the system.

[0113] The steps are to recompile and generate initramfs and compile the file system repair tool into initramfs, including:

[0114] The compilation module is used to recompile the initramfs, and install the fsck.ext3, fsc...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a method and a device for repairing a file system through initramfs, comprising the following steps: establishing a temporary folder under the system; Recompile to generate initramfs and compile file system repair tools into initramfs; Initramfs generated by setting a breakpoint for new compilation; Query root directory file system format; Repair instructions for the file system are executed according to the partitioned system file format. Recompile initramfs and install the fsck.ext3, fsck.ext4, xfs_repair file system repair tool into initramfs; Place the compiled initramfs in the/boot directory.

Description

technical field [0001] The invention relates to the technical field of system file repair, in particular to a method and device for repairing a file system through initramfs. Background technique [0002] When problems occur in the process of reading and writing the disk of the Linux system, such as abnormal termination, loose interface, abnormal power failure, or application process reading and writing errors, etc., the file system will be damaged, and the file system needs to be repaired; if it is a non-system disk , if the file system of the data disk is damaged, you can use fsck, xfs_repair and other tools to repair the file system under the system; but if there is a problem with the file system on the disk where the system is located, the system will not start normally, and the system root directory cannot be mounted normally. The startup stays on the initramfs interface, and the file system cannot be repaired. The existing solution to this problem needs to start from t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F8/41G06F9/4401G06F11/14
CPCG06F8/41G06F9/4406G06F11/1417
Inventor 刘骏
Owner ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products