CN115904820B - Recovery method and system for failed hard disk - Google Patents
Recovery method and system for failed hard disk Download PDFInfo
- Publication number
- CN115904820B CN115904820B CN202310140057.0A CN202310140057A CN115904820B CN 115904820 B CN115904820 B CN 115904820B CN 202310140057 A CN202310140057 A CN 202310140057A CN 115904820 B CN115904820 B CN 115904820B
- 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.)
- Active
Links
- 238000011084 recovery Methods 0.000 title claims abstract description 58
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000003860 storage Methods 0.000 claims description 62
- 230000008569 process Effects 0.000 claims description 19
- 238000012545 processing Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 22
- 238000010586 diagram Methods 0.000 description 8
- 230000002159 abnormal effect Effects 0.000 description 7
- GVGLGOZIDCSQPN-PVHGPHFFSA-N Heroin Chemical compound O([C@H]1[C@H](C=C[C@H]23)OC(C)=O)C4=C5[C@@]12CCN(C)[C@@H]3CC5=CC=C4OC(C)=O GVGLGOZIDCSQPN-PVHGPHFFSA-N 0.000 description 2
- 101000711846 Homo sapiens Transcription factor SOX-9 Proteins 0.000 description 2
- 101100232371 Hordeum vulgare IAT3 gene Proteins 0.000 description 2
- 102100034204 Transcription factor SOX-9 Human genes 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003825 pressing Methods 0.000 description 2
- 102000011727 Caspases Human genes 0.000 description 1
- 108010076667 Caspases Proteins 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
Images
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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 of a failed hard disk, and particularly relates to the technical field of computers, wherein the recovery method of the failed hard disk comprises the following steps: acquiring version information of an operating system kernel, and downloading kernel source codes according to the version information; creating a catalog in the operating system, and storing the kernel source code into the catalog; adding the firmware burning flow 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 flow is finished; configuring and compiling the kernel according to the kernel source code to obtain a kernel image; and guiding the system of the terminal equipment to be maintained to start through the kernel mirror image, and completing recovery of the failure 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
Technical Field
The application relates to the technical field of computers, in particular to a recovery method and a recovery system of a failure hard disk.
Background
In the technical field of computers, an operating system provides an application programming interface for firmware upgrading of a hard disk controller chip of a terminal device, so that the firmware upgrading of the hard disk controller chip is realized. Since a chip manufacturer designs a field protection mechanism of abnormal operation in firmware, when the abnormal operation occurs, the firmware of the chip is locked in an unreadable and writable state. After restarting after the power failure again, the main board cannot start the operating system from the chip, and the hard disk failure is shown. At this time, the whole machine needs to be disassembled, and the chip is subjected to desoldering, burning and reselding from the main board by means of a special desoldering tool. The process is tedious, the maintenance cost is high, and the time consumption is long.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present invention provides a recovery method and system for a failed hard disk, which can recover the failed hard disk without disassembling the whole machine.
The invention provides a recovery method of a failure hard disk, which at least comprises the following steps:
acquiring version information of an operating system kernel, and downloading kernel source codes according to the version information;
creating a catalog in the operating system, and storing the kernel source code into the catalog;
adding the firmware burning flow 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 flow is finished;
configuring and compiling the kernel according to the kernel source code to obtain a kernel image; and
and guiding the system of the terminal equipment to be maintained to start through the kernel mirror image, and completing recovery of the failure 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 to the log file of the kernel in the kernel source code when the firmware burning process is finished includes:
acquiring a firmware burning flow of the hard disk chip, and adding the firmware burning flow into the kernel source code;
and when the firmware burning flow 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.
In an embodiment of the present invention, the log file is located in a kernel information buffer, and the 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 image, and recording the execution process of configuration and compiling through the log file.
In an embodiment of the present invention, the kernel source code includes a driver file, and the kernel source code is added to an initialization function of the driver file.
In an embodiment of the present invention, the driving file includes a reading function, and the firmware version number of the hard disk chip is obtained through the reading function.
In an embodiment of the present invention, the step of booting the system of the terminal device to be maintained through the kernel mirror image to complete recovery of the failed hard disk of the terminal device to be maintained 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 device into the terminal equipment to be maintained, starting the terminal equipment to be maintained by the mobile storage device, and completing recovery of the failure hard disk of the terminal equipment to be maintained.
In an embodiment of the present invention, inserting the mobile storage device into a terminal device to be maintained, starting the terminal device to be maintained by the mobile storage device, and completing recovery of a failed hard disk of the terminal device to be maintained, where the steps include;
inserting the mobile storage device into terminal equipment to be maintained, and starting the terminal equipment to be maintained to enter a basic input/output system;
searching a starting label in the basic input and output system, and setting the mobile storage equipment under the starting label to start the terminal equipment to be maintained;
and the firmware of the hard disk chip is burnt and upgraded to finish the recovery of the hard disk failure of the terminal equipment to be maintained.
In an embodiment of the present invention, after the firmware of the hard disk chip is burned and upgraded, the method further includes the steps of: the log file is exported through a display command, whether the firmware version number is updated to a new version firmware is checked, and if the firmware version number is not updated to the new version firmware, an error reason is found; if the firmware is updated to the new version firmware, the firmware burning and upgrading of the hard disk chip is completed.
The invention also provides a recovery system of the failure hard disk, which at least comprises:
the data acquisition module acquires 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 catalog in the operating system and storing the kernel source code into the catalog; and adding the firmware burning flow 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 flow is finished.
And the kernel image generating module configures and compiles the kernel according to the kernel source code to acquire a kernel 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, and completing recovery of the hard disk failure of the terminal equipment to be maintained.
According to the recovery method and system for the failed hard disk, provided by the invention, the firmware burning flow of the hard disk chip is added into the obtained kernel source code through the obtained kernel source code, and the kernel mirror image is customized and generated according to the kernel source code. 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 burnt and upgraded, and the recovery of the failed hard disk is completed. In this embodiment, the complete machine is not required to be disassembled, and the customized mobile storage device starts the terminal device to be maintained, i.e., the firmware of the hard disk chip of the terminal device to be maintained is re-burned and updated, 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 application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is an environment diagram illustrating a method of recovering a failed hard disk according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a method of 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 of FIG. 2 in an exemplary embodiment;
FIG. 4 is a flow chart of step S240 in the embodiment of FIG. 2 in an exemplary embodiment;
FIG. 5 is a flow chart of step S250 in the embodiment of FIG. 2 in an exemplary embodiment;
FIG. 6 is a flow chart of step S520 in the embodiment of FIG. 5 in an exemplary embodiment;
FIG. 7 is a block diagram of a recovery system for a failed hard disk as illustrated by 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. and starting a recovery module.
Detailed Description
Further advantages and effects of the present invention will become readily apparent to those skilled in the art from the disclosure herein, by referring to the accompanying drawings and the preferred embodiments. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be understood that the preferred embodiments are presented by way of illustration only and not by way of limitation.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In the following description, numerous details are set forth in order to provide a more thorough explanation of embodiments of the present invention, it will be apparent, however, to one skilled in the art that embodiments of the present invention may be practiced without these specific details, in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the embodiments of the present invention.
It should be noted that EMMC (Embedded MulTI Media Card) is an embedded memory standard specification mainly aiming at mobile phone products, which is set by MMC co-ordination. In the technical field of computers, an EMMC hard disk chip is mainly welded on a main board of a terminal device, and firmware upgrade of the EMMC hard disk chip is realized through a windows operating system. In this embodiment, for the case that abnormal operation causes that firmware cannot be read and written, a manner that the whole machine is not required to be disassembled is provided to realize re-burning of the firmware, so that recovery of a 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 maintained includes a motherboard and an EMMC hard disk welded on the motherboard, and firmware upgrade of the EMMC hard disk chip is implemented through an EMMC hard disk storage system, applications, data, etc. and through a windows operating system. When the terminal device 110 to be maintained has abnormal operation, the hard disk firmware of the terminal device 110 to be maintained is in a status of incapable of being read and written, and the hard disk of the terminal device 110 to be maintained is in a failure status. 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 terminal equipment 110 to be maintained is started by the mobile storage equipment 120, so as to realize the burn-in and upgrade of the hard disk firmware of the terminal equipment 110 to be maintained, thereby realizing the recovery of the failed hard disk of the terminal equipment 110 to be maintained.
Referring to fig. 1 and 2, in an embodiment of the invention, the terminal device 110 to be maintained shown in fig. 1 may be a tablet computer, a notebook computer, or 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, etc., 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, or the like, and in this embodiment, the terminal device 130 and the terminal device 110 to be repaired have the same hard disc chip and the same hard disc chip firmware version number. The mobile storage device 120 establishes connection between the terminal device 110 to be repaired and the mobile storage device 120 through a universal serial bus (Universal Serial Bus, USB) interface inserted into the host, and starts the terminal device 110 to be repaired through the mobile storage device 120, so as to recover the failed hard disk. FIG. 2 is a flow chart illustrating a method of recovering a failed hard disk according to an exemplary embodiment of the present application. As shown in fig. 2, the recovery method of the 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 invention, the recovery method of the 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 kernel source codes are 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 many applications with limited secure access to computer hardware, and that the kernel decides how long a program is operating on a piece of hardware.
Referring to fig. 1, in an embodiment of the present invention, when an abnormal operation condition occurs in the terminal device 110 to be repaired, the hard disk firmware cannot be read and written, and the hard disk is in a failure state. At this time, the mobile storage device 120 is customized by the terminal device 130, and the mobile storage device 120 is used to recover the failed hard disk, so that the kernel needs to be configured, thereby customizing the mobile storage device 120 that can re-burn the hard disk firmware of the terminal device 110 to be maintained.
Referring to fig. 1 and 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, namely a Linux operating system which is mainly a desktop application, and the core of the operating system is a Linux kernel. At this time, version information of the operating system is acquired through an uneme command. Specifically, the uneme command displays a plurality of system information including Linux kernel architecture, name version, and release. When the Linux kernel version information needs to be checked, a terminal window is opened, an uname-a command is executed, and all operating system information is printed out, wherein the Linux kernel version information is included. 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 this embodiment, the dependency package is installed by the command sudo apt-get install kernel-ridge kernel-package libncurses-dev.
Referring to fig. 1 and fig. 2, in step S210, a downloadable kernel source code version is checked according to the obtained version information of the operating system kernel. At this time, the Linux kernel official website can be logged in to download the kernel source code. It should be understood that the kernel source code includes kernel core code of a plurality of subsystems having Linux kernels, other non-core code, and auxiliary files for configuration and compilation, etc. Through the obtained kernel source code, the configuration and compiling of the kernel can be performed, so that the customization of the mobile storage device 120 is realized.
Referring to fig. 1 and 2, in step S220, a directory is created in the operating system, and the kernel source code is stored in the directory. After the downloading of the kernel source codes is completed, the obtained kernel source codes are decompressed and installed under the directory. In this embodiment, a directory is created in the operating system, kernel source codes are downloaded, and the obtained kernel source codes are decompressed and stored in the directory. Specifically, creating a catalog in an operating system is realized through a command sudo mkdir src, decompressing and storing the obtained kernel source code into the catalog, and realizing through commands cd src and apt-get source linux-image- $ (uneme-r).
Referring to fig. 1 and fig. 2, 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, a firmware version number is printed in a log file of the kernel in the kernel source code. It should be appreciated that the chip is not written with a program during the production process. Before the chip leaves the factory, the manufacturer can set the burning flow by self-definition and store the program into the chip. In this embodiment, because the terminal device has abnormal operation, the firmware of the EMMC hard disk chip is in an unreadable and writable state, and the firmware needs to be re-burned at this time, 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 performed, a firmware burning process of the hard disk chip is added to the kernel source code, and a firmware version number is printed to the kernel through a function in the kernel source code. Specifically, step S230 may include step S310 and step S320.
Step S310, obtaining a firmware burning procedure of the hard disk chip, and adding the firmware burning procedure into the kernel source code.
Step S320, when the firmware burning process is finished, obtaining 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.
Referring to fig. 1 to 3, in step S310, the firmware of the EMMC hard disk chip is shipped, and the hard disk controller manufacturer will customize the burning process to write the program into the EMMC hard disk chip. In this embodiment, in order to re-burn firmware, a firmware burning process of the EMMC hard disk chip needs to be obtained, and the obtained firmware burning process is added to the kernel source code. The kernel source code comprises a driving file/driver/mmc/core/mmc.c, an initialization function mmc_init_card () is found under the driving file, and the obtained firmware burning flow is added into the initialization function mmc_init_card ().
Referring to fig. 1 to 3, in step S310, specifically, the firmware burning procedure is added to the kernel source code mainly by adding CMD command sequences, and the corresponding program code is added to the kernel source code. First, a command CMD62 is added, the command CMD62 having parameters 0xA3B2C0D5, and a Delay function Delay is added for 100ms, defining a Delay of 250ms. Then add command CMD1, command CMD1 with parameter 0x40FF8080 and add Delay function Delay 100ms, defining Delay 250ms. Then adding a command CMD2, a command CMD3, a command CMD7, a command CMD6 and a command CMD13 in sequence, wherein the command CMD2 band parameter 0x00000000, the command CMD3 band parameter 0x00020000, the command CMD7 band parameter 0x00020000, the command CMD6 band parameter 0x03b70000, the command CMD6 band parameter 0x03b90000 and the command CMD13 band parameter 0x00020000. Then, a command CMD25 is added, the command CMD25 having a parameter of 0x000001E3, wherein the Block number blkcnt=2, and the data content pattern=0x0d. Finally, command CMD12 and command CMD13 are added in sequence, wherein command CMD12 has a parameter of 0x00020000 and command CMD13 has a parameter of 0x00020000.
Referring to fig. 1 to 3, in step S320, the kernel source code includes a driver/mmc/core/mmc.c, and a read function mmc_read_ext_csd () is found in the driver, so that the firmware version number of the hard disk chip can be obtained through the read function mmc_read_ext_csd (). The hard disk chip comprises a plurality of registers, and the register value Ext_CSD [261:254] is obtained by obtaining the FIRMWARE VERSION number FIRMWARE_VERSION of the hard disk chip. At this time, the FIRMWARE VERSION number FIRMWARE_VERSION is printed into the log file of the kernel through the information printing function printk, namely, the register value Ext_CSD [261:254] is printed into the log file of the kernel. Specifically, the information printing function printk is a function for recording log information in the kernel source code, can only be used in the kernel source code range, can record information into the kernel, and calls a console driver to output the information. The log file of the kernel is a kernel log, which is positioned in a kernel information buffer log ring buffer, and the information printing function printk prints the firmware version number into the log file of the kernel, namely, the kernel information is output into the kernel information buffer log ring buffer.
Referring to fig. 1 and 2, and fig. 4, the recovery method of 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, the configuration of the kernel is firstly carried out, and corresponding modules are selected according to development requirements. And finally compiling the source code into a program, and obtaining the customized kernel image. As shown in fig. 4, in an exemplary embodiment, when step S240 is performed, 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 configuration options of the hard disk chip, configuring the kernel according to the kernel source code, and generating a configuration file.
Step S420, compiling and generating a kernel mirror image according to the configuration file, and recording the execution process of configuration and compiling through the log file.
Referring to fig. 1 and 2, and fig. 4, in step S410, when kernel configuration is required, the kernel configuration is performed after entering the directory storing the kernel source code. Specifically, the command cd linux- $ (uname-r) and make menuconfig are used. 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 that the system operation is not influenced. In this embodiment, the configuration options of the EMMC hard disk chip are selected, that is, the EMMC hard disk chip module is selected to perform core configuration, and finally the core configuration is completed, so as to generate a configuration file.
Referring to fig. 1 and 2, and fig. 4, in step S420, when the configuration of the kernel is completed, the configuration interface is exited, and the kernel is compiled according to the configuration file generated by the configuration. In this embodiment, multithreading is adopted for compiling, so that compiling efficiency can be effectively improved, and compiling time can be reduced. Specifically, the custom kernel image zImage is finally compiled and generated through the command sudo make-j 8, and is stored in the catalog/linux/arch/arm/boot/zImage.
Referring to fig. 1 and 2, and fig. 5, the recovery method of a failed hard disk according to the present invention includes step S250. In step S250, the system of the terminal device 110 to be repaired is started up by the kernel mirror image, so as to complete 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 be started through the customized kernel mirror image, so as to implement the burn-in upgrade 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 performed, that is, the system of the terminal device 110 to be repaired is booted through the kernel image, recovery of the failed hard disk 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 the kernel file of the mobile storage device with the kernel image.
And step S520, inserting the mobile storage device into the terminal equipment to be maintained, starting the terminal equipment to be maintained by the mobile storage device, and completing recovery of the hard disk failure of the terminal equipment to be maintained.
Referring to fig. 1 and fig. 2, and fig. 5, in an embodiment of the present invention, a ubuntu operating system is installed on a terminal device, and a kernel image zImage is generated through the obtained kernel source code customization, so that a ubuntu mobile storage device 120 with the same version is manufactured, so as to start the terminal device 110 to be maintained. In this embodiment, the mobile storage device 120 is a usb disk, and in other setting examples, other devices with storage functions may be used. The launch disc authoring tool Rufus is downloaded on the terminal device where the ubuntu operating system is installed. After the downloading is completed, the mobile storage device 120 is inserted into the terminal device for installing the ubuntu operating system, the rufus. Exe program is run, the inserted mobile storage device 120 is selected, the downloaded ubunt. Iso image file is selected for configuration, and finally the production of the ubuntu starting U disk, namely the ubuntu mobile storage device 120 with the same version, is completed. Wherein, the catalog/caspase of the image file comprises a kernel file vmlinuz. At this time, the kernel file vmlinuz is deleted, and the customized kernel image zImage is copied to the directory/cache, i.e., the kernel file vmlinuz of the mobile storage device 120 is replaced by the kernel image zImage.
Referring to fig. 1 and 2, and fig. 5 and 6, in an embodiment of the present invention, when an operation abnormality occurs in an operating system, firmware of an EMMC hard disk chip is in an unreadable state, and after the EMMC hard disk chip is powered off again and restarted, the EMMC hard disk chip becomes in an unavailable state, which is shown as an EMMC hard disk failure. At this time, the customized mobile storage device 120 is used as a starting disc of the terminal device 110 to be maintained, so that the re-burning of the firmware of the EMMC hard disk of the terminal device 110 to be maintained can be realized, which is shown as that the EMMC hard disk is in a usable state, and the operating system can be normally used. As shown in fig. 6, in an exemplary embodiment, when step S520 is performed, 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 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, the mobile storage device is inserted into the terminal device to be maintained, and the terminal device to be maintained is started to enter a basic input/output system.
Step S620, searching a starting label in the basic input and output system, and setting the terminal equipment to be maintained to be started by the mobile storage equipment under the starting label.
Step 630, the firmware of the hard disk chip is burned and upgraded to complete recovery of the hard disk failure of the terminal equipment to be maintained.
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 hard disk failure, a customized terminal device 110 to be repaired is inserted, i.e. a usb disk is inserted into a computer with a hard disk failure. At this time, the terminal equipment 110 to be maintained is turned on by pressing the start key of the terminal equipment 110 to be maintained. Meanwhile, after seeing the boot icon, the terminal device 110 to be repaired enters the basic input output system (Basic Input Output System, BIOS) by pressing other keys such as F2 or Delete.
Referring to fig. 1 and fig. 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 terminal device 110 to be maintained is started by the mobile storage device 120 in the setting start item Set Boot Priority, and finally the selection of the start item is saved, and the BIOS interface is exited.
Referring to fig. 1 and fig. 2, and fig. 6, in an embodiment of the present invention, after the setting of the start-up item is completed, the terminal device 110 to be maintained is started by the mobile storage device 120, and when the starting of the operating system ubuntu in the mobile storage device 120 is completed, the firmware re-burning of the EMMC hard disk chip is completed, i.e. the EMMC hard disk chip is updated to a new version firmware. In this embodiment, after the firmware of the EMMC hard disk chip is burned and upgraded, a log file needs to be exported through a display command dmesg, that is, a kernel log is exported, so as to check whether the firmware version number ext_csd [261:254] of the EMMC hard disk chip is upgraded to a new version firmware, if not, an error cause is found, and if the firmware is upgraded to the new version firmware, the firmware burning and upgrading 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 unplugged, and the terminal device 110 to be repaired is restarted. At this time, the main board can recognize the EMMC hard disk, which is in a restored state. The Windows system can be started normally and is not shown as abnormal operation, and at the moment, the firmware of the EMMC hard disk chip is in an available state, so that normal reading and writing can be performed. Therefore, the terminal equipment 110 to be maintained is started by customizing the mobile storage equipment 120, and the burning and upgrading of the firmware of the hard disk chip are performed, so that the recovery of the failed hard disk is completed.
FIG. 7 is a block diagram illustrating a recovery system for a failed hard disk in accordance with an exemplary embodiment of the present application. The system can be applied in 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 be adapted to other exemplary implementation environments and may be specifically configured in other devices, and the present embodiment is not limited to the implementation environments to which the system is adapted.
Referring to fig. 1 and 7, the recovery system of the failed hard disk at least includes a data acquisition module 710, a data processing module 720, a kernel image generating module 730 and a start recovery module 740, wherein the data acquisition module 710 acquires version information of the kernel of the operating system, and downloads kernel source codes according to the version information. The data processing module 720 creates a catalog in the operating system, stores the kernel source code into the catalog, the data processing module 720 adds the firmware burning flow 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 flow is finished. The kernel image generation module 730 configures and compiles the kernel according to the kernel source code to obtain a kernel image. The start recovery module 740 guides the system of the terminal equipment 110 to be maintained to start through the kernel mirror image, and completes recovery of the failed hard disk of the terminal equipment 110 to be maintained.
It should be noted that, the recovery system of the failed hard disk provided by the foregoing embodiment and the recovery method of the failed hard disk provided by the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute the operation has been described in detail in the method embodiment, which is not repeated herein. In practical application, the system for generating a communication network interface provided in the above embodiment may distribute the functions to be completed by different functional modules according to needs, that is, the internal structure of the system is divided into different functional 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 obtained kernel source code through the obtained kernel source code, and the Linux kernel is configured and compiled on the terminal device on which the ubuntu operating system is installed, so as to customize the kernel image. The method comprises the steps of replacing a kernel file of the mobile storage device 120 with a customized kernel mirror image, inserting the mobile storage device into terminal equipment to be maintained, and setting the mobile storage device to start the terminal equipment to be maintained, so that the firmware of an EMMC hard disk chip of the terminal equipment to be maintained is burnt and upgraded, recovery of a failure hard disk is completed, the hard disk chip is in an available state, and normal reading and writing of the EMMC hard disk chip can be performed. In this embodiment, the EMMC hard disk chip is detached from the motherboard without disassembling the whole machine. 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 flowcharts 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. Where 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 involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. It is therefore intended that all equivalent modifications and changes made by those skilled in the art without departing from the spirit and technical spirit of the present invention shall be covered by the appended claims.
Claims (9)
1. A recovery method of a failed hard disk is characterized by at least comprising the following steps:
acquiring version information of an operating system kernel, and downloading kernel source codes according to the version information;
creating a catalog in the operating system, and storing the kernel source code into the catalog;
providing a hard disk chip, adding a firmware burning flow 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 flow is finished;
configuring and compiling the kernel according to the kernel source code to obtain a kernel image; and
the system of the terminal equipment to be maintained is guided to be started through the kernel mirror image, and recovery of the hard disk failure of the terminal equipment to be maintained is completed;
the recovery step of the hard disk failure of the terminal equipment to be maintained comprises the following steps: starting the terminal equipment to be maintained by a mobile storage device, realizing firmware burning and upgrading of a hard disk chip of the terminal equipment to be maintained, and completing recovery of a failure hard disk of the terminal equipment to be maintained;
the firmware burning and upgrading of the hard disk chip further comprises the following steps: and outputting the log file through a display command, checking whether the firmware version number is updated to a new version firmware, if not, searching an error reason, and if so, finishing firmware burning and upgrading of the hard disk chip.
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 into the log file of the kernel in the kernel source code when the firmware burning process is finished comprises:
acquiring a firmware burning flow of the hard disk chip, and adding the firmware burning flow into the kernel source code;
and when the firmware burning flow 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 recovery method of a failed hard disk according to claim 1, wherein the log file is located in a kernel information buffer, and the kernel information is processed through the kernel information buffer.
4. The method of claim 1, wherein configuring and compiling the kernel according to the kernel source code and the log file, and obtaining the kernel image comprises:
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 image, and recording the execution process of configuration and compiling through the log file.
5. The method for recovering a failed hard disk according to claim 1, wherein the kernel source code includes a driver file, and the firmware burning process of the hard disk chip is added into an initialization function of the driver file.
6. The method for recovering a failed hard disk according to claim 5, wherein the drive file includes a read function, and the firmware version number of the hard disk chip is obtained by the read function.
7. The method for recovering a failed hard disk according to claim 1, wherein the step of booting the system of the terminal device to be repaired through the kernel image to complete recovery of the failed hard disk of the terminal device to be repaired comprises:
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 device into the terminal equipment to be maintained, starting the terminal equipment to be maintained by the mobile storage device, and completing recovery of the failure hard disk of the terminal equipment to be maintained.
8. The method for recovering a failed hard disk according to claim 7, wherein the step of inserting the mobile storage device into a terminal device to be repaired, starting the terminal device to be repaired by the mobile storage device, and completing recovery of the failed hard disk of the terminal device to be repaired comprises;
inserting the mobile storage device into terminal equipment to be maintained, and starting the terminal equipment to be maintained to enter a basic input/output system;
searching a starting label in the basic input and output system, and setting the mobile storage equipment under the starting label to start the terminal equipment to be maintained;
and the firmware of the hard disk chip is burnt and upgraded to finish the recovery of the hard disk failure of the terminal equipment to be maintained.
9. A recovery system for a failed hard disk, comprising at least:
the data acquisition module acquires 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 catalog in the operating system and storing the kernel source code into the catalog; providing a hard disk chip, adding a firmware burning flow 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 flow is finished;
the kernel mirror image generation module configures and compiles the kernel according to the kernel source code to obtain a 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, and completing recovery of the hard disk failure of the terminal equipment to be maintained;
the recovery step of the hard disk failure of the terminal equipment to be maintained comprises the following steps: starting the terminal equipment to be maintained by a mobile storage device, realizing firmware burning and upgrading of a hard disk chip of the terminal equipment to be maintained, and completing recovery of a failure hard disk of the terminal equipment to be maintained;
the firmware burning and upgrading of the hard disk chip further comprises the following steps: and outputting the log file through a display command, checking whether the firmware version number is updated to a new version firmware, if not, searching an error reason, and if so, finishing firmware burning and upgrading of the hard disk chip.
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 CN115904820A (en) | 2023-04-04 |
CN115904820B true 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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105590072A (en) * | 2015-12-18 | 2016-05-18 | 上海华测导航技术股份有限公司 | Method for achieving automatic burning of embedded system |
CN113094059A (en) * | 2021-04-13 | 2021-07-09 | 深圳市研强物联技术有限公司 | Firmware system data transmission method and burning device thereof |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7055148B2 (en) * | 2000-12-07 | 2006-05-30 | Hewlett-Packard Development Company, L.P. | System and method for updating firmware |
CN1297907C (en) * | 2003-03-31 | 2007-01-31 | 联想(北京)有限公司 | 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 |
CN102033770B (en) * | 2010-12-17 | 2015-01-28 | 中兴通讯股份有限公司 | Touch screen firmware upgrading method and device for mobile terminal |
US8732527B2 (en) * | 2011-08-16 | 2014-05-20 | Google Inc. | Secure recovery apparatus and method |
US11243782B2 (en) * | 2016-12-14 | 2022-02-08 | Microsoft Technology Licensing, Llc | Kernel soft reset using non-volatile RAM |
TWI712045B (en) * | 2020-01-16 | 2020-12-01 | 慧榮科技股份有限公司 | Hard disk 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 |
-
2023
- 2023-02-21 CN CN202310140057.0A patent/CN115904820B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105590072A (en) * | 2015-12-18 | 2016-05-18 | 上海华测导航技术股份有限公司 | Method for achieving automatic burning of embedded system |
CN113094059A (en) * | 2021-04-13 | 2021-07-09 | 深圳市研强物联技术有限公司 | Firmware system data transmission method and burning device thereof |
Also Published As
Publication number | Publication date |
---|---|
CN115904820A (en) | 2023-04-04 |
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 | |
CN110413230B (en) | Embedded system construction method and storage medium | |
JP2009048649A (en) | Method and system for supplying custom software image to computer system | |
CN111562934B (en) | Software system upgrading method based on hot patch, terminal and storage medium | |
US20080098381A1 (en) | Systems and methods for firmware update in a data processing device | |
US20080270685A1 (en) | Information processing apparatus and firmware updating method | |
CN101021797A (en) | Repairing and staging method for software of embedded system | |
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) | |
CN102053848A (en) | Automatic installation method for Linux operating system | |
CN114756290A (en) | Operating system installation method, device and readable storage medium | |
CN113377586B (en) | Automatic detection method and device for server and storage medium | |
CN100361075C (en) | Method and device for quickly developing embedded system using automatic compilation frame | |
CN115904820B (en) | Recovery method and system for failed hard disk | |
CN116954674A (en) | eMMC firmware upgrading method, firmware upgrading equipment and storage device | |
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 | |
CN111258617B (en) | Electronic equipment | |
CN114510375A (en) | Flash chip data area dynamic sharing system and method | |
CN112667444A (en) | System upgrading method, storage medium and terminal equipment | |
CN113448639B (en) | Access method, device, equipment and storage medium for user configuration variable area | |
KR101113342B1 (en) | Boot-loader version managing method for mobile communication terminal | |
CN111176735B (en) | Method for accelerating startup of electrocardiograph |
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 |