CN115904820A - Recovery method and system for failed hard disk - Google Patents

Recovery method and system for failed hard disk Download PDF

Info

Publication number
CN115904820A
CN115904820A CN202310140057.0A CN202310140057A CN115904820A CN 115904820 A CN115904820 A CN 115904820A CN 202310140057 A CN202310140057 A CN 202310140057A CN 115904820 A CN115904820 A CN 115904820A
Authority
CN
China
Prior art keywords
kernel
hard disk
firmware
maintained
source code
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
CN202310140057.0A
Other languages
Chinese (zh)
Other versions
CN115904820B (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.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage Technology 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 Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202310140057.0A priority Critical patent/CN115904820B/en
Publication of CN115904820A publication Critical patent/CN115904820A/en
Application granted granted Critical
Publication of CN115904820B publication Critical patent/CN115904820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a recovery method and a recovery system for a failed hard disk, and particularly relates to the technical field of computers, wherein the recovery method for the failed hard disk comprises the following steps: obtaining version information of an operating system kernel, and downloading kernel source codes according to the version information; creating a directory in the operating system, and storing the kernel source code into the directory; adding the firmware burning process of the hard disk chip into the kernel source code, and printing the firmware version number into the log file of the kernel in the kernel source code when the firmware burning process is finished; configuring and compiling the kernel according to the kernel source code to obtain a kernel mirror image; and guiding a system of the terminal equipment to be maintained to start through the kernel mirror image, and completing the recovery of the failed hard disk of the terminal equipment to be maintained. The recovery of the failed hard disk can be realized without disassembling the whole machine.

Description

Recovery method and system for failed hard disk
Technical Field
The application relates to the technical field of computers, in particular to a recovery method and a recovery system for a failed hard disk.
Background
In the technical field of computers, an operating system provides an application programming interface for firmware upgrade of a hard disk controller chip of a terminal device, so that the firmware upgrade of the hard disk controller chip is realized. Since a chip manufacturer can design a field protection mechanism of abnormal operation in the firmware, when the abnormal operation occurs, the firmware of the chip is locked in an unreadable and writable state. After the power failure and the restart, the mainboard cannot start the operating system from the chip, and the hard disk is invalid. At the moment, the whole machine needs to be disassembled, and the chip is subjected to unsoldering, burning and rewelding from the main board by means of a special unsoldering tool. The process is complicated, the maintenance cost is high, and the time consumption is long.
Disclosure of Invention
In view of the above disadvantages of the prior art, the present invention provides a method and a system for recovering a failed hard disk, which can recover the failed hard disk without disassembling the entire device.
The invention provides a recovery method of a failed hard disk, which at least comprises the following steps:
obtaining version information of an operating system kernel, and downloading kernel source codes according to the version information;
creating a directory in the operating system, and storing the kernel source code into the directory;
adding the firmware burning process of the hard disk chip into the kernel source code, and printing the firmware version number into the log file of the kernel in the kernel source code when the firmware burning process is finished;
configuring and compiling the kernel according to the kernel source code to obtain a kernel mirror image; and
and guiding a system of the terminal equipment to be maintained to start through the kernel mirror image, and completing the recovery of the failed hard disk of the terminal equipment to be maintained.
In an embodiment of the present invention, the step of adding the firmware burning process of the hard disk chip to the kernel source code, and printing the firmware version number in the kernel source code into the log file of the kernel when the firmware burning process is finished includes:
acquiring a firmware burning process of the hard disk chip, and adding the firmware burning process into the kernel source code;
and when the firmware burning process is finished, acquiring the firmware version number of the hard disk chip, and printing the firmware version number to the log file of the kernel through an information printing function.
In an embodiment of the present invention, the log file is located in a kernel information buffer, and kernel information is processed through the kernel information buffer.
In an embodiment of the present invention, configuring and compiling the kernel according to the kernel source code and the log file, and the step of obtaining the kernel image includes:
selecting configuration options of the hard disk chip, configuring the kernel according to the kernel source code, and generating a configuration file;
and compiling according to the configuration file to generate a kernel mirror image, and recording the execution process of configuration and compilation through the log file.
In an embodiment of the present invention, the kernel source includes a driver file, and the kernel source is added to an initialization function of the driver file.
In an embodiment of the present invention, the driver file includes a read function, and the read function obtains a firmware version number of the hard disk chip.
In an embodiment of the present invention, the step of completing the recovery of the failed hard disk of the terminal device to be maintained by guiding the system start of the terminal device to be maintained through the kernel mirror image includes:
providing a mobile storage device, and replacing a kernel file of the mobile storage device with the kernel mirror image;
and inserting the mobile storage equipment into the terminal equipment to be maintained, starting the terminal equipment to be maintained by the mobile storage equipment, and completing the recovery of the failed hard disk of the terminal equipment to be maintained.
In an embodiment of the present invention, the step of inserting the mobile storage device into the terminal device to be maintained, starting the terminal device to be maintained by the mobile storage device, and completing the recovery of the failed hard disk of the terminal device to be maintained includes;
inserting the mobile storage equipment into the terminal equipment to be maintained, and starting the terminal equipment to be maintained to enter a basic input and output system;
searching a starting label in the basic input and output system, and setting the mobile storage device to start the terminal device to be maintained under the starting label;
and burning and upgrading the firmware of the hard disk chip to finish the recovery of the failed hard disk of the terminal equipment to be maintained.
In an embodiment of the present invention, the step of upgrading the firmware burning of the hard disk chip further includes: the log file is exported through a display command, whether the firmware version number is upgraded to a new version firmware is checked, and if the firmware version number is not upgraded to the new version firmware, the error reason is searched; and if the firmware is upgraded to a new version, completing firmware burning upgrade of the hard disk chip.
The invention also provides a recovery system of the failed hard disk, which at least comprises:
and the data acquisition module acquires the version information of the kernel of the operating system and downloads the kernel source code according to the version information.
The data processing module is used for creating a directory in the operating system and storing the kernel source code into the directory; and adding a firmware burning process of a hard disk chip into the kernel source code, and printing the firmware version number into the log file of the kernel in the kernel source code when the firmware burning process is finished.
And the kernel mirror image generation module is used for configuring and compiling the kernel according to the kernel source code to acquire the kernel mirror image.
And the starting recovery module is used for guiding the system of the terminal equipment to be maintained to start through the kernel mirror image so as to complete the recovery of the failed hard disk of the terminal equipment to be maintained.
According to the method and the system for recovering the failed hard disk, provided by the invention, the firmware burning process of the hard disk chip is added into the acquired kernel source code through the acquired kernel source code, and the kernel mirror image is generated according to the kernel source code in a customized manner. And replacing the kernel file of the mobile storage device with a customized kernel mirror image, inserting the mobile storage device into the terminal device to be maintained, and starting the terminal device to be maintained by the mobile storage device, so that the firmware of the hard disk chip of the terminal device to be maintained is burned and upgraded, and the recovery of the failed hard disk is completed. In this embodiment, the entire device does not need to be disassembled, and the customized mobile storage device starts the terminal device to be maintained, that is, the firmware of the hard disk chip of the terminal device to be maintained is re-burned and upgraded, so as to recover the failed hard disk. Meanwhile, the operation process is simple, and the maintenance cost is low.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a diagram illustrating an environment for implementing a method for recovering a failed hard disk according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for recovering a failed hard disk according to an exemplary embodiment of the present application;
FIG. 3 is a flow chart of step S230 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 4 is a flow chart of step S240 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 5 is a flow chart of step S250 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 6 is a flow chart of step S520 in the embodiment shown in FIG. 5 in an exemplary embodiment;
FIG. 7 is a block diagram illustrating a system for recovery of a failed hard disk according to an exemplary embodiment of the present application.
In the figure: 110. terminal equipment to be maintained; 120. a mobile storage device; 130. a terminal device; 710. a data acquisition module; 720. a data processing module; 730. a kernel mirror image generation module; 740. the recovery module is started.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the disclosure of the present specification, wherein the following description is made for the embodiments of the present invention with reference to the accompanying drawings and the preferred embodiments. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be understood that the preferred embodiments are illustrative of the invention only and are not limiting upon the scope of the invention.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring embodiments of the present invention.
First, the EMMC (Embedded MulTI Media Card) is the standard specification of the MMC association, mainly for Embedded memories mainly used in mobile phone products. In the technical field of computers, an EMMC hard disk chip is mainly welded on a mainboard of a terminal device, and firmware upgrading of the EMMC hard disk chip is achieved through a windows operating system. In this embodiment, for the situation that the firmware cannot be read or written due to abnormal operation, a way of not disassembling the whole device is provided, re-burning of the firmware is realized, and recovery of the failed hard disk can be realized under the condition of saving time and cost.
Referring to fig. 1, in an embodiment of the present invention, a terminal device 110 to be repaired includes a motherboard and an EMMC hard disk welded on the motherboard, and the EMMC hard disk stores a system, an application, data, and the like, and the firmware upgrade of an EMMC hard disk chip is implemented by a windows operating system. When the terminal device 110 to be maintained is in an abnormal operation state, the hard disk firmware of the terminal device 110 to be maintained is in a non-readable and non-writable state, and the hard disk of the terminal device 110 to be maintained is in a failure state. At this time, the mobile storage device 120 is customized by the terminal device 130, and the customized mobile storage device 120 is inserted into the terminal device 110 to be repaired, so that the mobile storage device 120 establishes a connection with the terminal device 110 to be repaired. At this time, the mobile storage device 120 starts the terminal device 110 to be maintained, so as to realize burning and upgrading of the hard disk firmware of the terminal device 110 to be maintained, thereby realizing recovery of the failed hard disk of the terminal device 110 to be maintained.
Referring to fig. 1 and fig. 2, in an embodiment of the present invention, the terminal device 110 to be repaired shown in fig. 1 may be a terminal device such as a tablet computer, a notebook computer, and the like, but is not limited thereto. The removable storage device 120 shown in fig. 1 may be, for example, an SD card, a removable hard disk, a usb disk, and the like, and in this embodiment, the removable storage device 120 is a usb disk. The terminal device 130 shown in fig. 1 may be a terminal device such as a tablet computer, a notebook computer, and in this embodiment, the terminal device 130 and the terminal device 110 to be repaired have the same hard disk chip and the same firmware version number of the hard disk chip. The mobile storage device 120 establishes a connection between the terminal device 110 to be maintained and the mobile storage device 120 through a Universal Serial Bus (USB) interface inserted into the host, and starts the terminal device 110 to be maintained through the mobile storage device 120, so as to recover the failed hard disk. Fig. 2 is a flowchart illustrating a recovery method for a failed hard disk according to an exemplary embodiment of the present application. As shown in fig. 2, the method for recovering a failed hard disk according to the present invention can be applied to the implementation environment shown in fig. 1.
Referring to fig. 2, in an embodiment of the present invention, a method for recovering a failed hard disk at least includes steps S210 to S250. In step S210, version information of the kernel of the operating system is obtained, and the kernel source code is downloaded according to the version information. It is to be understood that the kernel is the most basic part of the operating system, which is a piece of software that provides limited secure access to computer hardware for many applications, and that the kernel determines when a program operates on a piece of hardware for how long.
Referring to fig. 1, in an embodiment of the present invention, when the terminal device 110 to be maintained has an abnormal operation condition, the hard disk firmware cannot be read or written, and the hard disk appears to be in a failure state. At this time, the mobile storage device 120 is customized by the terminal device 130, and if the mobile storage device 120 is used to recover a failed hard disk, a kernel needs to be configured, so as to customize the mobile storage device 120 capable of re-burning the hard disk firmware of the terminal device 110 to be repaired.
Referring to fig. 1 and fig. 2, in an embodiment of the present invention, in step S210, an operating system is installed on the terminal device 130. In this embodiment, the terminal device 130 is, for example, a notebook computer. The operating system is a ubuntu operating system, i.e. a Linux operating system based on desktop applications, and the core of the operating system is a Linux kernel. At this time, version information of the operating system is acquired by the diameter command. In particular, the diameter command displays a number of system information, including the Linux kernel architecture, name version, and release. And when the version information of the Linux kernel needs to be checked, opening a terminal window, executing a diameter-a command, and printing out all operating system information, wherein the operating system information comprises the version information of the Linux kernel. After the version information of the kernel of the operating system is obtained, the dependency package required by the subsequent compiling kernel is installed, so that errors are avoided when the kernel is compiled. In the embodiment, the dependent package is installed through a command sudo apt-get install kernel-web kernel-package libncurs 5-dev.
Referring to fig. 1 and fig. 2, in an embodiment of the present invention, in step S210, according to the version information of the operating system kernel, a kernel source code version that can be downloaded is checked. At this time, the Linux kernel official website can be logged in, and the kernel source code can be downloaded. It is understood that the kernel source code includes kernel core code that owns multiple subsystems of the Linux kernel, other non-core code, and auxiliary files for configuration and compilation, etc. Through the acquired kernel source code, the configuration and compilation of the kernel can be performed, so as to realize the customization of the mobile storage device 120.
Referring to fig. 1 and fig. 2, in an embodiment of the present invention, in step S220, a directory is created in the operating system, and the kernel source code is stored in the directory. And after downloading of the kernel source codes is completed, decompressing and installing the obtained kernel source codes under the directory. In this embodiment, a directory is created in the operating system, the kernel source codes are downloaded, and the obtained kernel source codes are decompressed and stored in the directory. Specifically, creating a directory in an operating system is realized through a command sudo mkdir src, decompressing and storing the acquired kernel source code into the directory, and realizing through a command cd src and an ap-get source linux-image- $ (uniform-r).
Referring to fig. 1 and 2, in an embodiment of the present invention, in step S230, a firmware burning process of the hard disk chip is added to the kernel source code, and when the firmware burning process is finished, the firmware version number is printed in the kernel source code to the log file of the kernel. It should be understood that the chip is not programmed during the manufacturing process. Before the chip leaves the factory, a manufacturer can set a burning process in a self-defined mode and store the program into the chip. In this embodiment, since the operation of the terminal device is abnormal, the firmware of the EMMC hard disk chip is in an unreadable or writable state, and at this time, the firmware needs to be re-burned, so as to recover the failed hard disk.
Referring to fig. 1 to 3, in an embodiment of the present invention, when step S230 is executed, the firmware burning process of the hard disk chip is added to the kernel source code, and the firmware version number is printed to the kernel through the function in the kernel source code. Specifically, step S230 may include step S310 and step S320.
Step S310, acquiring the firmware burning process of the hard disk chip, and adding the firmware burning process into the kernel source code.
Step S320, when the firmware burning process is finished, acquiring the firmware version number of the hard disk chip, and printing the firmware version number to the log file of the kernel through an information printing function.
Referring to fig. 1 to 3, in an embodiment of the invention, in step S310, when the firmware of the EMMC hard disk chip leaves the factory, the hard disk controller manufacturer may customize the burning process and write the program into the EMMC hard disk chip. In this embodiment, in order to perform firmware re-burning, a firmware burning process of the EMMC hard disk chip needs to be acquired, and the acquired firmware burning process is added to the kernel source code. The kernel source code comprises a drive file/drivers/mmc/core/mmc, an initialization function mmc _ init _ card () is found out under the drive file, and the obtained firmware burning process is added into the initialization function mmc _ init _ card ().
Referring to fig. 1 to 3, in an embodiment of the invention, in step S310, specifically, the adding of the firmware burning process to the kernel source code is mainly to add a CMD command sequence, and add a corresponding program code to the kernel source code. First, add command CMD62, command CMD62 with parameters 0xA3B2C0D5, and add Delay function Delay 100ms, defining a Delay of 250ms. Then add command CMD1, command CMD1 with parameters 0x40FF8080, and add Delay function Delay 100ms, defining a Delay of 250ms. And then adding a command CMD2, a command CMD3, a command CMD7, a command CMD6 and a command CMD13 in sequence, wherein the command CMD2 has parameters of 0x00000000, the command CMD3 has parameters of 0x00020000, the command CMD7 has parameters of 0x00020000, the command CMD6 has parameters of 0x03b70000, the command CMD6 has parameters of 0x03b90000 and the command CMD13 has parameters of 0x00020000 in sequence. Then, a command CMD25 is added, the command CMD25 having parameters 0x000001E3, where the number of blocks BlkCnt =2 and the data content Pattern = 0x0D. Finally, a command CMD12 and a command CMD13 are added in sequence, wherein the command CMD12 has a parameter 0x00020000, and the command CMD13 has a parameter 0x00020000.
Referring to fig. 1 to 3, in an embodiment of the invention, in step S320, the kernel source code includes a driver file/drivers/mmc/core/mmc.c, a read function mmc _ read _ ext _ csd () is found under the driver file, and the firmware version number of the hard disk chip can be obtained by reading the read function mmc _ read _ ext _ csd (). The hard disk chip includes a plurality of registers, and obtains a FIRMWARE VERSION number FIRMWARE _ VERSION of the hard disk chip, that is, obtains a register value Ext _ CSD [ 261. At this time, the FIRMWARE VERSION number FIRMWARE _ VERSION is printed into the log file of the kernel by the information printing function printk, that is, the register value Ext _ CSD [261 ] is printed into the log file of the kernel [ 254]. Specifically, the information printing function printk is a function for recording log information in kernel source code, and is only used within the scope of the kernel source code, and can record information in the kernel and call a console driver to output the information. The log file of the kernel is the kernel log, and is located in the kernel information buffer log ring, and the information printing function printk prints the firmware version number into the log file of the kernel, that is, the kernel information is output into the kernel information buffer log ring.
Referring to fig. 1 and 2, and fig. 4, the method for recovering a failed hard disk according to the present invention includes step S240. In step S240, the kernel is configured and compiled according to the kernel source code, and a kernel image is obtained. After the preparation work of the kernel source code is completed, firstly, the kernel is configured, and a corresponding module is selected according to the development requirement. And finally compiling the source code into a program, and acquiring the customized kernel mirror image. As shown in fig. 4, in an exemplary embodiment, when step S240 is executed, the kernel is configured and compiled according to the kernel source code and the log file, and a kernel image is obtained. Specifically, step S240 may include step S410 and step S420.
Step S410, selecting the configuration options of the hard disk chip, configuring the kernel according to the kernel source code, and generating a configuration file.
Step S420, compiling according to the configuration file to generate a kernel image, and recording an execution process of configuration and compilation through the log file.
Referring to fig. 1 and 2, and fig. 4, in step S410, when the kernel configuration is required, the kernel first enters the directory storing the kernel source code, and then the kernel configuration is performed. Specifically, this is achieved by commands cd linux- $ (diameter-r) and make menuconfig. When the kernel configuration is carried out, a plurality of configuration options exist, and targeted selection is carried out, so that the volume of the customized kernel mirror image can be effectively reduced under the condition of not influencing the system work. In this embodiment, a configuration option of the EMMC hard disk chip is selected, that is, an EMMC hard disk chip module is selected to perform kernel configuration, and finally, the kernel configuration is completed, and a configuration file is generated.
Referring to fig. 1 and 2, and fig. 4, in step S420, when the kernel configuration is completed, the configuration interface is exited, and the kernel compilation is performed according to the configuration file generated by the configuration. In the embodiment, the compiling is performed by adopting multiple threads, so that the compiling efficiency can be effectively improved, and the compiling time can be reduced. Specifically, the customized kernel image zImage is generated by compiling and is stored in the directory/linux/arch/arm/boot/zImage through the command sudo make-j 8.
Referring to fig. 1 and 2, and fig. 5, the method for recovering a failed hard disk according to the present invention includes step S250. In step S250, the kernel image is used to guide the system of the terminal device 110 to be repaired to start, so as to complete the recovery of the failed hard disk of the terminal device 110 to be repaired. In this embodiment, the windows system of the terminal device 110 to be maintained is guided to start through the customized kernel image, so as to implement the burning and upgrading of the hard disk chip firmware of the terminal device 110 to be maintained, thereby completing the recovery of the failed hard disk of the terminal device 110 to be maintained. As shown in fig. 5, in an exemplary embodiment, when step S250 is executed, that is, the kernel image is used to guide the system start of the terminal device 110 to be repaired, and the failed hard disk recovery of the terminal device 110 to be repaired is completed. Specifically, step S250 may include step S510 and step S520.
Step S510, providing a mobile storage device, and replacing a kernel file of the mobile storage device with the kernel mirror image.
Step S520, inserting the mobile storage device into the terminal device to be maintained, starting the terminal device to be maintained by the mobile storage device, and completing the recovery of the failed hard disk of the terminal device to be maintained.
Referring to fig. 1 and 2, and fig. 5, in an embodiment of the present invention, an ubuntu operating system is installed on a terminal device, and a kernel image zmmage is generated by customizing an obtained kernel source code, so that an ubuntu mobile storage device 120 of the same version is manufactured, and thus, the terminal device 110 to be repaired is started. In this embodiment, the removable storage device 120 is a usb disk, and in other setting examples, other devices with a storage function may be used. The start-up disk production tool Rufus is downloaded on the terminal equipment on which the ubuntu operating system is installed. After the downloading is completed, the mobile storage device 120 is inserted into the terminal device where the ubuntu operating system is installed, the rufus. Exe program is run, the inserted mobile storage device 120 is selected, the downloaded ubuntu.iso image file is selected for configuration, and finally the manufacturing of the ubuntu startup U disk, that is, the ubuntu mobile storage device 120 of the same version, is completed. Wherein, the directory/container of the image file comprises a kernel file vmlinux. At this time, the kernel file vmlinux is deleted, and the customized kernel image zmmage is copied to the directory/container, that is, the kernel file vmlinux of the mobile storage device 120 is replaced by the kernel image zmmage.
Referring to fig. 1 and 2, and fig. 5 and 6, in an embodiment of the present invention, when an operating system is abnormal and the firmware of the EMMC hard disk chip is in an unreadable state, the EMMC hard disk chip becomes in an unavailable state after being powered off and restarted again, which indicates that the EMMC hard disk fails. At this time, the customized mobile storage device 120 is used as a boot disk of the terminal device 110 to be repaired, so that the EMMC hard disk chip firmware of the terminal device 110 to be repaired can be re-burned, the EMMC hard disk is in an available state, and the operating system can be normally used. As shown in fig. 6, in an exemplary embodiment, when step S520 is executed, that is, the mobile storage device 120 is inserted into the terminal device 110 to be repaired, the terminal device 110 to be repaired is started by the mobile storage device 120, and the recovery of the failed hard disk of the terminal device 110 to be repaired is completed. Specifically, step S520 may include steps S610 to S630.
Step S610, inserting the mobile storage device into the terminal device to be maintained, and starting the terminal device to be maintained to enter a basic input and output system.
Step S620, searching for a start tag in the bios, and setting the mobile storage device to start the terminal device to be maintained under the start tag.
Step S630, the firmware of the hard disk chip is burned and upgraded, and the recovery of the failed hard disk of the terminal equipment to be maintained is completed.
Referring to fig. 1 and 2, and fig. 6, in an embodiment of the present invention, for a terminal device 110 to be repaired with a failed hard disk, a customized terminal device 110 to be repaired is inserted, that is, a usb disk is inserted into a computer with a failed hard disk. At this time, the power-on key of the terminal device 110 to be maintained is pressed to start the terminal device 110 to be maintained. Meanwhile, when the power-on icon is seen, pressing other keys such as F2 or Delete, the terminal device 110 to be maintained enters a Basic Input Output System (BIOS).
Referring to fig. 1 and 2, and fig. 6, in an embodiment of the present invention, after entering a BIOS interface of a basic input output system, a Boot tag Boot is searched in the BIOS interface, and a Boot item may be set in the Boot tag Boot. Specifically, the mobile storage device 120 is Set to start the terminal device 110 to be repaired in the Set Boot Priority of the Boot entry, and finally, the selection of the Boot entry is saved and the BIOS interface is exited.
Referring to fig. 1 and 2, and fig. 6, in an embodiment of the present invention, after the setting of the boot entry is completed, the terminal device 110 to be repaired is booted by the mobile storage device 120, and after the boot of the operating system ubuntu in the mobile storage device 120 is completed, the firmware of the EMMC hard disk chip is re-burned, that is, the EMMC hard disk chip is upgraded to a new firmware version. In this embodiment, after the firmware burning upgrade of the EMMC hard disk chip, it is necessary to export a log file, that is, export the kernel log, by using the display command dmesg to check whether the firmware version number Ext _ CSD [261 ] of the EMMC hard disk chip is upgraded to a new version firmware, if not upgraded to a new version firmware, the cause of error is found, and if upgraded to a new version firmware, the firmware burning upgrade of the EMMC hard disk chip is completed.
Referring to fig. 1 to 6, the mobile storage device 120 inserted into the terminal device 110 to be repaired is pulled out, and the terminal device 110 to be repaired is restarted. At this time, the motherboard can recognize the EMMC hard disk, which is presented in a recovery state. The Windows system can be normally started and does not show abnormal operation, and at the moment, the firmware of the EMMC hard disk chip is in a usable state and can be normally read and written. Therefore, the terminal device 110 to be maintained is started by customizing the mobile storage device 120, the burning upgrade of the hard disk chip firmware is performed, and the recovery of the failed hard disk is completed.
Fig. 7 is a block diagram illustrating a structure of a system for recovering a failed hard disk according to an exemplary embodiment of the present application. The system can be applied to the implementation environment shown in fig. 1, and is specifically configured in the terminal device 110 to be repaired and the terminal device 130, respectively. The system may also be applied to other exemplary implementation environments and is specifically configured in other devices, and the embodiment does not limit the implementation environment to which the system is applied.
Referring to fig. 1 and 7, the exemplary recovery system for a failed hard disk at least includes a data obtaining module 710, a data processing module 720, a kernel image generating module 730, and a startup recovery module 740, where the data obtaining module 710 obtains version information of an operating system kernel, and downloads kernel source codes according to the version information. The data processing module 720 creates a directory in the operating system, stores the kernel source code into the directory, and the data processing module 720 adds the firmware burning process of the hard disk chip into the kernel source code, and prints the firmware version number into the log file of the kernel in the kernel source code when the firmware burning process is finished. The kernel image generation module 730 configures and compiles the kernel according to the kernel source code to obtain the kernel image. The start recovery module 740 guides the system of the terminal device 110 to be repaired to start through the kernel mirror image, and completes recovery of the failed hard disk of the terminal device 110 to be repaired.
It should be noted that the recovery system for a failed hard disk provided in the foregoing embodiment and the recovery method for a failed hard disk provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute operations has been described in detail in the method embodiment, and is not described here again. In practical applications, the generation system of the communication network interface provided in the foregoing embodiment may distribute the functions through different function modules as required, that is, divide the internal structure of the system into different function modules to complete all or part of the functions described above, which is not limited herein.
In summary, the firmware burning process of the EMMC hard disk chip is added to the acquired kernel source code through the acquired kernel source code, and the Linux kernel is configured and compiled on the terminal device in which the ubuntu operating system is installed, so as to customize the kernel image. The kernel file of the mobile storage device 120 is replaced by a customized kernel mirror image, the mobile storage device is inserted into the terminal device to be maintained, and the terminal device to be maintained is started by the mobile storage device, so that the firmware of the EMMC hard disk chip of the terminal device to be maintained is burned and upgraded, the recovery of the failed hard disk is completed, the hard disk chip is in an available state, and the EMMC hard disk chip can be read and written normally. In this embodiment, the EMMC hard disk chip is desoldered from the motherboard without disassembling the entire device. The burning upgrading of the hard disk chip can be realized through the customized mobile storage equipment, and meanwhile, the implementation process is simple and the cost is low.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
The foregoing embodiments are merely illustrative of the principles of the present invention and its efficacy, and are not to be construed as limiting the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A recovery method of a failed hard disk is characterized by at least comprising the following steps:
obtaining version information of an operating system kernel, and downloading kernel source codes according to the version information;
creating a directory in the operating system, and storing the kernel source code into the directory;
adding a firmware burning process of the hard disk chip into the kernel source code, and printing a firmware version number into a log file of the kernel in the kernel source code when the firmware burning process is finished;
according to the kernel source code, configuring and compiling the kernel to obtain a kernel mirror image; and
and guiding a system of the terminal equipment to be maintained to start through the kernel mirror image, and completing recovery of the failed hard disk of the terminal equipment to be maintained.
2. The method for recovering a failed hard disk according to claim 1, wherein the step of adding the firmware burning process of the hard disk chip to the kernel source code, and printing the firmware version number in the kernel source code into the log file of the kernel when the firmware burning process is finished comprises:
acquiring a firmware burning process of the hard disk chip, and adding the firmware burning process into the kernel source code;
and when the firmware burning process is finished, acquiring the firmware version number of the hard disk chip, and printing the firmware version number into the log file of the kernel through an information printing function.
3. The method according to claim 1, wherein the log file is located in a kernel information buffer, and kernel information is processed through the kernel information buffer.
4. The method according to claim 1, wherein the kernel is configured and compiled according to the kernel source code and the log file, and the step of obtaining the kernel image includes:
selecting configuration options of the hard disk chip, configuring the kernel according to the kernel source code, and generating a configuration file;
and compiling according to the configuration file to generate a kernel mirror image, and recording the execution process of configuration and compilation through the log file.
5. The method according to claim 1, wherein the kernel source code comprises a driver file, and the kernel source code is added to an initialization function of the driver file.
6. The method for recovering the failed hard disk according to claim 5, wherein the drive file comprises a read function, and the firmware version number of the hard disk chip is obtained through the read function.
7. The method for recovering the failed hard disk according to claim 1, wherein the step of completing the recovery of the failed hard disk of the terminal device to be maintained by guiding the system start of the terminal device to be maintained through the kernel mirror image comprises the following steps:
providing a mobile storage device, and replacing a kernel file of the mobile storage device with the kernel mirror image;
and inserting the mobile storage equipment into the terminal equipment to be maintained, starting the terminal equipment to be maintained by the mobile storage equipment, and completing the recovery of the failed hard disk of the terminal equipment to be maintained.
8. The method for recovering the failed hard disk according to claim 7, wherein the step of inserting the mobile storage device into the terminal device to be maintained, starting the terminal device to be maintained by the mobile storage device, and completing the recovery of the failed hard disk of the terminal device to be maintained comprises the steps of;
inserting the mobile storage equipment into the terminal equipment to be maintained, and starting the terminal equipment to be maintained to enter a basic input and output system;
searching a starting label in the basic input and output system, and setting the mobile storage equipment to start the terminal equipment to be maintained under the starting label;
and burning and upgrading the firmware of the hard disk chip to finish the recovery of the failed hard disk of the terminal equipment to be maintained.
9. The method for recovering a failed hard disk according to claim 8, wherein the step of upgrading the firmware of the hard disk chip by burning further comprises: the log file is exported through a display command, whether the firmware version number is upgraded to a new firmware version is checked, and if the firmware version number is not upgraded to the new firmware version, the error reason is searched; and if the firmware is upgraded to a new version, completing firmware burning upgrade of the hard disk chip.
10. A system for recovering a failed hard disk, comprising at least:
the data acquisition module acquires the version information of the kernel of the operating system and downloads kernel source codes according to the version information;
the data processing module is used for creating a directory in the operating system and storing the kernel source code into the directory; adding a firmware burning process of a hard disk chip into the kernel source code, and printing a firmware version number into a log file of the kernel in the kernel source code when the firmware burning process is finished;
the kernel mirror image generation module is used for configuring and compiling the kernel according to the kernel source code to obtain a kernel mirror image; and
and the starting recovery module is used for guiding the system of the terminal equipment to be maintained to start through the kernel mirror image so as to complete the recovery of the failed hard disk of the terminal equipment to be maintained.
CN202310140057.0A 2023-02-21 2023-02-21 Recovery method and system for failed hard disk Active CN115904820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310140057.0A CN115904820B (en) 2023-02-21 2023-02-21 Recovery method and system for failed hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310140057.0A CN115904820B (en) 2023-02-21 2023-02-21 Recovery method and system for failed hard disk

Publications (2)

Publication Number Publication Date
CN115904820A true CN115904820A (en) 2023-04-04
CN115904820B CN115904820B (en) 2023-06-16

Family

ID=86488395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310140057.0A Active CN115904820B (en) 2023-02-21 2023-02-21 Recovery method and system for failed hard disk

Country Status (1)

Country Link
CN (1) CN115904820B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073304A1 (en) * 2000-12-07 2002-06-13 Marsh James L. System and method for updating firmware
CN1534490A (en) * 2003-03-31 2004-10-06 联想(北京)有限公司 Realization method of computer hard disk data restoring and back-up
CN101038551A (en) * 2006-03-16 2007-09-19 南京大学 Method for implementing the start of Linux operation system in mobile hard disk
WO2012079301A1 (en) * 2010-12-17 2012-06-21 中兴通讯股份有限公司 Method and device for upgrading touch screen firmware of mobile terminal
CN103858107A (en) * 2011-08-16 2014-06-11 谷歌公司 Secure recovery apparatus and method
CN105590072A (en) * 2015-12-18 2016-05-18 上海华测导航技术股份有限公司 Method for achieving automatic burning of embedded system
CN110088731A (en) * 2016-12-14 2019-08-02 微软技术许可有限责任公司 Use the soft resetting of the kernel of non-volatile ram
CN113094059A (en) * 2021-04-13 2021-07-09 深圳市研强物联技术有限公司 Firmware system data transmission method and burning device thereof
US20210224158A1 (en) * 2020-01-16 2021-07-22 Silicon Motion, Inc. Data storage device restoring method
CN113268366A (en) * 2020-02-17 2021-08-17 斑马智行网络(香港)有限公司 Kernel operation method, device and system
CN114625389A (en) * 2020-12-14 2022-06-14 北京配天技术有限公司 Embedded equipment upgrading method, embedded equipment and storage device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073304A1 (en) * 2000-12-07 2002-06-13 Marsh James L. System and method for updating firmware
CN1534490A (en) * 2003-03-31 2004-10-06 联想(北京)有限公司 Realization method of computer hard disk data restoring and back-up
CN101038551A (en) * 2006-03-16 2007-09-19 南京大学 Method for implementing the start of Linux operation system in mobile hard disk
WO2012079301A1 (en) * 2010-12-17 2012-06-21 中兴通讯股份有限公司 Method and device for upgrading touch screen firmware of mobile terminal
CN103858107A (en) * 2011-08-16 2014-06-11 谷歌公司 Secure recovery apparatus and method
CN105590072A (en) * 2015-12-18 2016-05-18 上海华测导航技术股份有限公司 Method for achieving automatic burning of embedded system
CN110088731A (en) * 2016-12-14 2019-08-02 微软技术许可有限责任公司 Use the soft resetting of the kernel of non-volatile ram
US20210224158A1 (en) * 2020-01-16 2021-07-22 Silicon Motion, Inc. Data storage device restoring method
CN113268366A (en) * 2020-02-17 2021-08-17 斑马智行网络(香港)有限公司 Kernel operation method, device and system
CN114625389A (en) * 2020-12-14 2022-06-14 北京配天技术有限公司 Embedded equipment upgrading method, embedded equipment and storage device
CN113094059A (en) * 2021-04-13 2021-07-09 深圳市研强物联技术有限公司 Firmware system data transmission method and burning device thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆银丽;于红利;黄智伟;: "μClinux2.4.17中添加SATA硬盘控制器驱动的方法研究", 南华大学学报(自然科学版) *

Also Published As

Publication number Publication date
CN115904820B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
KR100778293B1 (en) Digital tv and upgrade method of bootloader for the same
KR101856284B1 (en) Backing up firmware during initialization of device
CN104123153A (en) Apparatus and method for firmware upgrade using USB
US6944867B2 (en) Method for providing a single preloaded software image with an ability to support multiple hardware configurations and multiple types of computer systems
US9448889B2 (en) BIOS failover update with service processor
CN1399194A (en) Method and system for creating and using operation system with optional functions
US9448808B2 (en) BIOS update with service processor without serial peripheral interface (SPI) access
CN101021797A (en) Repairing and staging method for software of embedded system
CN111562934B (en) Software system upgrading method based on hot patch, terminal and storage medium
US20040199911A1 (en) Apparatus and method for upgrading execution code of the portable memory device
CN102479121A (en) Method for realizing and testing redundant array of independent disks (RAID)
CN115718610A (en) Reliable method for updating application program of single chip microcomputer
CN102053848A (en) Automatic installation method for Linux operating system
CN114756290A (en) Operating system installation method, device and readable storage medium
US20060026415A1 (en) Method of updating a portion BIOS
CN113849230A (en) Server starting method and device, electronic equipment and readable storage medium
CN116954674A (en) eMMC firmware upgrading method, firmware upgrading equipment and storage device
CN115904820B (en) Recovery method and system for failed hard disk
KR20180023575A (en) Firmware auto updating method and computer readable recording medium writing firmware auto updating method
EP4296860A1 (en) Method for running startup program of electronic device, and electronic device
US8762699B1 (en) System, apparatus, and method for initiating a reboot of a personal computer system by pressing a button on an attached storage device and causing the operating system on the attached storage device to be booted
CN111258617B (en) Electronic equipment
CN114625389A (en) Embedded equipment upgrading method, embedded equipment and storage device
CN101739262A (en) Firmware updating method and electronic device using same
KR101113342B1 (en) Boot-loader version managing method for mobile communication terminal

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