CN105808161A - Reading method of bad sector data of hard disk - Google Patents

Reading method of bad sector data of hard disk Download PDF

Info

Publication number
CN105808161A
CN105808161A CN201610107485.3A CN201610107485A CN105808161A CN 105808161 A CN105808161 A CN 105808161A CN 201610107485 A CN201610107485 A CN 201610107485A CN 105808161 A CN105808161 A CN 105808161A
Authority
CN
China
Prior art keywords
hard disk
data
read
lba
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610107485.3A
Other languages
Chinese (zh)
Inventor
梁效宁
董超
张佳强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SICHUAN XLY INFORMATION SAFETY TECHNOLOGY Co Ltd
Original Assignee
SICHUAN XLY INFORMATION SAFETY 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 SICHUAN XLY INFORMATION SAFETY TECHNOLOGY Co Ltd filed Critical SICHUAN XLY INFORMATION SAFETY TECHNOLOGY Co Ltd
Priority to CN201610107485.3A priority Critical patent/CN105808161A/en
Publication of CN105808161A publication Critical patent/CN105808161A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a reading method of bad sector data of a hard disk, and belongs to the field of data recovery. The method comprises following steps of S1, loading the hard disk; S2, initializing; loading hard disk state information; S3, sending a data reading request to the hard disk; S4, requesting to access the position of an LBA (Logical Block Address) value; S5, reading a hard disk state bitmap file; and S6, returning data or reading data according to whether the LBA position requested to access is a recorded bad sector or not. The method has the advantages that an upper layer interface sends the data request to the physical hard disk, a firmware program will receive the LBA value of the upper layer request, the firmware program will actively judge whether the position can be requested to access or not according to the LBA value; the access is requested in a DMA mode or a PIO mode; when the access cannot be carried out or the access results in the hang phenomenon of the hard disk, the firmware program will actively control the hard disk to restart attempted reading; and the condition that the data of the logic bad sector of the mechanical hard disk cannot be read can be solved successfully based on the method provided by the invention.

Description

A kind of read method of bad track of hard disk data
Technical field
The present invention relates to data and recover field, particularly to the read method of a kind of bad track of hard disk data.
Background technology
Along with the arrival in " big data " epoch, " data " this abstract thing, become more and more concrete in our life.Big from the energy, economy, communication, little of individual privacy, Company File, many important data messages, all can be stored in storage medium.Hard disk, as the data storage medium of PC, is widely used in each field, and mechanical hard disk is due to its capacity and cost advantage, has irreplaceable market share.
Bad track of hard disk is divided into logistic bad track and physical bad track, the logistic bad track Producing reason of hard disk is generally mostly due to use or the misoperation of software, and the reason such as abnormal shutdown, dust, vibration, electrostatic and high temperature, in the routine use process of hard disk, owing to a variety of causes occurs that bad track may result in data and cannot normally read.
Disk state message bit pattern: 1bit records a sectors status, and 0 represents and cannot read, and 1 represents and can read;
LBA (LogicalBlockAddress), Chinese: logical block addresses.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, it is provided that the read method of a kind of bad track of hard disk data, this method mainly solves the situation that the data of mechanical hard disk logistic bad track cannot read.
For solving problem above, the technical solution used in the present invention is as follows: the read method of a kind of bad track of hard disk data, comprises the following steps:
S1 loads hard disk;S2 initializes, and loads disk state information;S3 sends data read request to hard disk;S4 request accesses the position of LBA value;S5 reads disk state bitmap file;Whether the LBA position that S6 accesses according to request is that the bad track recorded carries out data return or data read operation.
As preferably, if new hard disk, then needing to initialize hard disk;If the hard disk loaded before, being then loaded directly into disk state information, namely load the status file of hard disk, status file comprises message bit pattern.
As preferably, S6 is specific as follows:
S61: if the LBA position that request accesses is the bad track recorded, then directly return 0x44 and forward S62 to;If not recording the LBA position that request accesses, or the LBA position that request accesses is normal, then forward S63 to;
S62: if Unrecorded LBA position, then send according to request and once read instruction;If request LBA position is normal, directly transmit read requests;
S63: read unsuccessfully if Unrecorded, then need to update mode bit map file, uses the state of sector corresponding to bit position one LBA value of record, and wherein 0 represents and cannot read, and 1 expression is read successfully;
S64: update after completion status bitmap file, if can read successful data directly return data pool, the direct return 0x44 that reads of failing is to data pool.
Beneficial effects of the present invention is as follows: upper interface sends request of data to physical hard disk, firmware program can receive the LBA value of upper layer request, according to LBA value, firmware program can actively judge whether this position, place can ask to access, dma mode and PIO mode ask to access, can not accessing or this access causes the seemingly-dead phenomenon of hard disk, firmware program can actively control hard disk and restart trial reading, and the method based on the present invention can successfully solve the situation that the data of mechanical hard disk logistic bad track cannot read.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the present invention.
Detailed description of the invention
For making the purpose of the present invention, technical scheme and advantage clearly understand, develop simultaneously embodiment referring to accompanying drawing, the present invention is described in further details.
A kind of read method of bad track of hard disk data, when upper interface sends request of data to physical hard disk, firmware program can receive the LBA value of upper layer request, according to LBA value, firmware program can actively judge whether this position, place can ask to access, dma mode and PIO mode ask to access, it is impossible to access or this access causes the seemingly-dead phenomenon of hard disk (most of bad track hard disks there will be this situation), and firmware program can actively control hard disk and restart trial reading.
Specific as follows: S1 loads hard disk;S2 initializes, and loads disk state information;S3 sends data read request to hard disk;S4 request accesses the position of LBA value;S5 reads disk state bitmap file;Whether the LBA position that S6 accesses according to request is that the bad track recorded carries out data return or data read operation.
S2: if new hard disk, then need to initialize hard disk;If the hard disk loaded before, being then loaded directly into disk state information, namely load the status file of hard disk, status file comprises message bit pattern.
S6 is specific as follows:
S61: if the LBA position that request accesses is the bad track recorded, then directly return 0x44 and forward S62 to;If not recording the LBA position that request accesses, or the LBA position that request accesses is normal, then forward S63 to;
S62: if Unrecorded LBA position, then send according to request and once read instruction;If request LBA position is normal, directly transmit read requests;
S63: read unsuccessfully if Unrecorded, then need to update mode bit map file, uses the state of sector corresponding to bit position one LBA value of record, and wherein 0 represents and cannot read, and 1 expression is read successfully;
S64: update after completion status bitmap file, if can read successful data directly return data pool, the direct return 0x44 that reads of failing is to data pool.

Claims (3)

1. the read method of bad track of hard disk data, it is characterised in that comprise the steps:
S1 loads hard disk;S2 initializes, and loads disk state information;S3 sends data read request to hard disk;S4 request accesses the position of LBA value;S5 reads disk state bitmap file;Whether the LBA position that S6 accesses according to request is that the bad track recorded carries out data return or data read operation.
2. the read method of a kind of bad track of hard disk data according to claim 2, it is characterised in that S2 is specific as follows: if new hard disk, then need to initialize hard disk;If the hard disk loaded before, being then loaded directly into disk state information, namely load the status file of hard disk, status file comprises message bit pattern.
3. the read method of a kind of bad track of hard disk data according to claim 3, it is characterised in that S6 is specific as follows:
S61: if the LBA position that request accesses is the bad track recorded, then directly return 0x44 and forward S62 to;If not recording the LBA position that request accesses, or the LBA position that request accesses is normal, then forward S63 to;
S62: if Unrecorded LBA position, then send according to request and once read instruction;If request LBA position is normal, directly transmit read requests;
S63: read unsuccessfully if Unrecorded, then need to update mode bit map file, uses the state of sector corresponding to bit position one LBA value of record, and wherein 0 represents and cannot read, and 1 expression is read successfully;
S64: update after completion status bitmap file, if can read successful data directly return data pool, the direct return 0x44 that reads of failing is to data pool.
CN201610107485.3A 2016-02-26 2016-02-26 Reading method of bad sector data of hard disk Pending CN105808161A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610107485.3A CN105808161A (en) 2016-02-26 2016-02-26 Reading method of bad sector data of hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610107485.3A CN105808161A (en) 2016-02-26 2016-02-26 Reading method of bad sector data of hard disk

Publications (1)

Publication Number Publication Date
CN105808161A true CN105808161A (en) 2016-07-27

Family

ID=56465833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610107485.3A Pending CN105808161A (en) 2016-02-26 2016-02-26 Reading method of bad sector data of hard disk

Country Status (1)

Country Link
CN (1) CN105808161A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708646A (en) * 2016-12-22 2017-05-24 郑州云海信息技术有限公司 Hard disk abnormal condition automatic resetting method and device thereof
WO2019196157A1 (en) * 2018-04-10 2019-10-17 网宿科技股份有限公司 File reading method and application entity
CN112115002A (en) * 2020-09-21 2020-12-22 武汉轻工大学 Method and device for recovering file from damaged or non-trusted mechanical hard disk
CN112463019A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Data reading method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010010085A1 (en) * 1999-03-31 2001-07-26 International Business Machines Corp. Recovering and relocating unreliable disk sectors when encountering disk drive read errors
US20040153745A1 (en) * 2002-11-20 2004-08-05 Hitachi Global Storage Technologies Netherlands B.V. Bad-sector search method, data recording device, and program
CN103400602A (en) * 2013-07-24 2013-11-20 大唐移动通信设备有限公司 Automatic hard disk bad track repairing method and equipment
CN103700387A (en) * 2013-09-18 2014-04-02 福建鼎恩协创电子科技有限公司 Device and method for monitoring and repairing damaged sector of hard disc
CN103955412A (en) * 2014-04-02 2014-07-30 江门市未来之星网络科技有限公司 Computer hard disc data recovering equipment and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010010085A1 (en) * 1999-03-31 2001-07-26 International Business Machines Corp. Recovering and relocating unreliable disk sectors when encountering disk drive read errors
US20040153745A1 (en) * 2002-11-20 2004-08-05 Hitachi Global Storage Technologies Netherlands B.V. Bad-sector search method, data recording device, and program
CN103400602A (en) * 2013-07-24 2013-11-20 大唐移动通信设备有限公司 Automatic hard disk bad track repairing method and equipment
CN103700387A (en) * 2013-09-18 2014-04-02 福建鼎恩协创电子科技有限公司 Device and method for monitoring and repairing damaged sector of hard disc
CN103955412A (en) * 2014-04-02 2014-07-30 江门市未来之星网络科技有限公司 Computer hard disc data recovering equipment and method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708646A (en) * 2016-12-22 2017-05-24 郑州云海信息技术有限公司 Hard disk abnormal condition automatic resetting method and device thereof
WO2019196157A1 (en) * 2018-04-10 2019-10-17 网宿科技股份有限公司 File reading method and application entity
CN112463019A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Data reading method and device
WO2021043246A1 (en) * 2019-09-06 2021-03-11 华为技术有限公司 Data reading method and apparatus
CN112115002A (en) * 2020-09-21 2020-12-22 武汉轻工大学 Method and device for recovering file from damaged or non-trusted mechanical hard disk
CN112115002B (en) * 2020-09-21 2024-04-02 武汉轻工大学 Method and device for recovering file from damaged or untrusted mechanical hard disk

Similar Documents

Publication Publication Date Title
CN101419842B (en) Loss equalizing method, apparatus and system for hard disc
WO2017148242A1 (en) Method for accessing shingled magnetic recording (smr) hard disk, and server
CN100514270C (en) Dynamic loading of virtual volume data in a virtual tape server
US20180024919A1 (en) Mapping tables for storage devices
US8392670B2 (en) Performance management of access to flash memory in a storage device
CN107704211B (en) Magneto-optical-electric hybrid optical disk library and management method and management system thereof
JP5891027B2 (en) Method and apparatus for sanitizing a storage device
CN105808161A (en) Reading method of bad sector data of hard disk
CN103246478B (en) A kind of based on the disc array system of software PLC support without packet type overall situation HotSpare disk
CN103049224B (en) By the methods, devices and systems of data importing physical tape
JP2014160450A (en) Data storage device and writing method
JP2008071478A (en) Disk drive with nonvolatile memory for storage of failure-related data
US8291190B2 (en) Disk drive including a host interface supporting different sizes of data sectors and method for writing data thereto
TW200828273A (en) Hard disk cache device and method
JP2005353035A5 (en)
CN101963891A (en) Method and device for data storage and processing, solid-state drive system and data processing system
CN106528001A (en) Cache system based on nonvolatile memory and software RAID
US9639287B1 (en) Write command reporting
CN102508724A (en) Disk bad block processing method based on soft RAID (redundant array of independent disks)
US20090245049A1 (en) Hybrid recording device
CN104679668A (en) Storage system and control method thereof
CN103019623A (en) Memory disc processing method and device
CN103985393A (en) Method and device for parallel management of multi-optical-disc data
CN102314321B (en) Storage system, utilization storage system carry out the method and apparatus of data access
CN111124303B (en) Data storage method, device and system

Legal Events

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

Application publication date: 20160727