⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 hard disk tool for recovery
💻
字号:
hdrecover---------Attempts to recover a hard disk that has bad blocks on it.WARNING: A hard disk with bad blocks on it is likely to fail! If youvalue your data you should get a new hard disk instead of using thisprogram!However, if you can't afford a new hard disk, or just like beingreckless with your data then this tool might just help you out!Requirements:* A 2.6 kernel* A dead hard drive (well one with bad blocks - not completely dead)* smartmontools is handy although not strictly needed* root accessWhen to use:First of all, if you haven't already got it - go downloadsmartmontools! (http://smartmontools.sf.net). Then run:    smartctl -A /dev/hdaWhere hda is whichever drive you're interested in. The output shouldinclude three attributes that are interesting:* Reallocated_Event_Count  This is how many sectors have already been reallocated on the  drive. We're hoping to get the hard disk to increase this number!* Current_Pending_Sector  The number of sectors that the drive thinks are dodgy. Bear in mind  sometimes drives change their mind about whether a sector is bad or  not - so this number can go down without a reallocation occuring.* Offline_Uncorrectable  This is the number of sectors that the drive has attempted to  correct itself, but failed. Running the command:      smartctl -t offline /dev/hda  should cause the drive to test the sectors and attempt to fix  them. Not all drives support this though.So the attribute you're interested in at the moment isCurrent_Pending_Sector. If this is not 0 then there's something upwith your disk. If Offline_Uncorrectable is less thanCurrent_Pending_Sectors then you may want to run an offline test whichmay fix it, or you can dive straight in and use hdrecover which willtest (and attempt to fix) it itself.So run (as root):    hdrecover /dev/hdaand sit back and wait (or probably you're best off going and doingsomething else while you wait). If the program comes across a badsector it will make several attempts at reading the sector. Betweeneach attempt it will randomly seek so as to reposition the head,hopefully getting the data off the disk. If it succeeds then the driveshould automatically reallocate the sector. If after several attemptsthe data still can't be read then the program will give you the optionof overwriting the data in the sector. This will force the drive toreallocate the block.WARNING: Overwriting the sector WILL cause data loss (it's fairlyobvious really!). Hopefully, since it is only one sector (or a handfulif there are more bad sectors on the drive), it won't be tooimportant. But bear in mind that you should at the very least run fsckto check the integrity of the filesystem.Once the program has finished (it takes a long time I'm afraid), asummary will be printed showing how many blocks had errors. If yourepeat the smartctl command:    smartctl -A /dev/hdayou should see that Current_Pending_Sector is now 0 andReallocated_Event_Count will have risen by the number of sectors thedrive decided to reallocate. Offline_Uncorrectable usually doesn'timmediately update - you have to either wait for the drive to updateit itself or run an offline test which should force the drive toupdate it.Have fun!DISCLAIMER: Hard disks with bad sectors could fail at anytime -although hdrecover appears to fix the drive you shouldn't trust it!And just to re-inforce the GPL licence: if it in any way breaks yourcomputer then you get to keep both pieces! I accept no responsibilityfor any damage it causes!-------------------------------------------------------------------------------Sample run:SMART attribute table before:SMART Attributes Data Structure revision number: 11Vendor Specific SMART Attributes with Thresholds:ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  1 Raw_Read_Error_Rate     0x0029   100   100   020    Pre-fail  Offline      -       0  3 Spin_Up_Time            0x0027   064   063   020    Pre-fail  Always       -       4623  4 Start_Stop_Count        0x0032   096   096   008    Old_age   Always       -       2882  5 Reallocated_Sector_Ct   0x0033   099   099   020    Pre-fail  Always       -       5  7 Seek_Error_Rate         0x000b   100   093   023    Pre-fail  Always       -       0  9 Power_On_Hours          0x0012   080   080   001    Old_age   Always       -       13227 10 Spin_Retry_Count        0x0026   100   100   000    Old_age   Always       -       0 11 Calibration_Retry_Count 0x0013   100   090   020    Pre-fail  Always       -       0 12 Power_Cycle_Count       0x0032   097   097   008    Old_age   Always       -       1993 13 Read_Soft_Error_Rate    0x000b   100   093   023    Pre-fail  Always       -       0194 Temperature_Celsius     0x0022   078   073   042    Old_age   Always       -       57195 Hardware_ECC_Recovered  0x001a   100   100   000    Old_age   Always       -       295108196 Reallocated_Event_Count 0x0010   099   099   020    Old_age   Offline      -       1197 Current_Pending_Sector  0x0032   100   099   020    Old_age   Always       -       1198 Offline_Uncorrectable   0x0010   100   092   000    Old_age   Offline      -       0199 UDMA_CRC_Error_Count    0x001a   156   156   000    Old_age   Always       -       44Notice there is 1 Current_Pending_Sector. Running hdrecover /dev/hdb(it happens to be the second IDE drive):# hdrecover /dev/hdbhdrecover version 0.2By Steven PriceDisk is 156355584 sectors bigSector 28000 (00%) ETR: 1 hours 33 minutes 3 secondsSector 75920 (00%) ETR: 1 hours 8 minutes 36 secondsSector 121520 (00%) ETR: 1 hours 4 minutes 16 secondsSector 169400 (00%) ETR: 1 hours 1 minutes 27 secondsSector 217120 (00%) ETR: 59 minutes 55 secondsFailed to read block at sector 257500, investigating futher...Error at sector 257505Attempting to pounce on it...Attempt 1 from sector    117727958: FAILEDAttempt 2 from sector    149263364: FAILEDAttempt 3 from sector     84429675: FAILEDAttempt 4 from sector     81160097: FAILEDAttempt 5 from sector    156272094: FAILEDAttempt 6 from sector     75028634: FAILEDAttempt 7 from sector     63238892: FAILEDAttempt 8 from sector    116585171: FAILEDAttempt 9 from sector    102184049: FAILEDAttempt 10 from sector      5777672: FAILEDAttempt 11 from sector     81154822: FAILEDAttempt 12 from sector     69534256: FAILEDAttempt 13 from sector     90633165: FAILEDAttempt 14 from sector    150946922: FAILEDAttempt 15 from sector     18909543: FAILEDAttempt 16 from sector     29845152: FAILEDAttempt 17 from sector     24976866: FAILEDAttempt 18 from sector     52496797: FAILEDAttempt 19 from sector    104093022: FAILEDAttempt 20 from sector    127778471: FAILEDCouldn't recover sectorThe data for this sector could not be recovered. However, destroying thecontents of this sector (ie writing zeros to it) should cause the hard diskto reallocate it making the drive useable againDo you want to destroy the sector? [y/n]:/---------\| WARNING |\---------/Up until this point you haven't lost any data because of this programHowever, if you say yes below YOU WILL LOSE DATA!Proceed at your own risk!Type 'destroy data' to continuedestroy dataWiping sector...Checking sector is now readable...Sector is now readable. But you have lost data!Sector 257520 (00%) ETR: 30 hours 58 minutes 53 secondsSector 290700 (00%) ETR: 27 hours 35 minutes 18 seconds... (loads more status info) ...Sector 156197020 (99%) ETR: 3 secondsSector 156242080 (99%) ETR: 2 secondsSector 156287080 (99%) ETR: 1 secondsSector 156332200 (99%) ETR: 0 secondsSummary:  1 bad sectors found  of those 0 were recovered  and 1 could not be recovered and were destroyed causing data loss****************************************** You have wiped a sector on this disk! *******************************************  If you care about the filesystem on  **  this disk you should run fsck on it  **  before mounting it to correct any    **  potential metadata errors            ******************************************#So the sector had to be wiped to recover it. fsck was then run tocheck the metadata wasn't damaged (it wasn't) and smartctl now returnsthe following attribute table:SMART Attributes Data Structure revision number: 11Vendor Specific SMART Attributes with Thresholds:ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  1 Raw_Read_Error_Rate     0x0029   100   100   020    Pre-fail  Offline      -       0  3 Spin_Up_Time            0x0027   064   063   020    Pre-fail  Always       -       4623  4 Start_Stop_Count        0x0032   096   096   008    Old_age   Always       -       2882  5 Reallocated_Sector_Ct   0x0033   099   099   020    Pre-fail  Always       -       5  7 Seek_Error_Rate         0x000b   100   093   023    Pre-fail  Always       -       0  9 Power_On_Hours          0x0012   080   080   001    Old_age   Always       -       13227 10 Spin_Retry_Count        0x0026   100   100   000    Old_age   Always       -       0 11 Calibration_Retry_Count 0x0013   100   090   020    Pre-fail  Always       -       0 12 Power_Cycle_Count       0x0032   097   097   008    Old_age   Always       -       1993 13 Read_Soft_Error_Rate    0x000b   100   093   023    Pre-fail  Always       -       0194 Temperature_Celsius     0x0022   078   073   042    Old_age   Always       -       57195 Hardware_ECC_Recovered  0x001a   100   100   000    Old_age   Always       -       295108196 Reallocated_Event_Count 0x0010   099   099   020    Old_age   Offline      -       1197 Current_Pending_Sector  0x0032   100   099   020    Old_age   Always       -       0198 Offline_Uncorrectable   0x0010   100   092   000    Old_age   Offline      -       0199 UDMA_CRC_Error_Count    0x001a   156   156   000    Old_age   Always       -       44Current_Pending_Sector is now 0 so the drive is 'fixed' (fornow). Also note that Reallocated_Event_Count hasn't gone up (it was 1before). This means that the drive now has confidence in the sectorthat has been overwritten and has not used a spare sector. Whether youstill have confidence in the drive is another matter!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -