[Tips] Forcing a hard disk to reallocate bad sectors

Dedicated for Linux & related opensource software

[Tips] Forcing a hard disk to reallocate bad sectors

文章 #1  未閱讀文章PoP » 2020-06-29 17:53

  1. smartctl -t short /dev/sdX
    - wait until finished time
  2. smartctl -l selftest /dev/sdX
    - take entries of LBA_of_first_error
  3. hdparm --read-sector ${LBA_of_first_error} /dev/sdX
    - if output not show reading sector ${LBA_of_first_error} : succeeded, repeat with ${LBA_of_first_error±1}.
  4. hdparm --yes-i-know-what-i-am-doing --write-sector ${LBA_of_first_error} /dev/sdX (with all the unsucceeded values)
    - the output should show re-writing sector ${LBA_of_first_error} : succeeded
  5. hdparm --read-sector ${LBA_of_first_error} /dev/sdX (repeat values from step 3)
    - to check the availability of the reallocated sectors
  6. smartctl -a /dev/sdX | grep -i reallocated
    - to check whether the disk has registered two reallocated sectors
  7. repeat step 2 if more than 1 entries
當流赤足蹋澗石,水聲激激風吹衣。
人生如此自可樂,豈必局束為人鞿?
頭像
PoP
 
文章: 13576
註冊時間: 2006-12-06 03:42

回到 Linux

誰在線上

正在瀏覽這個版面的使用者:Bing [Bot] 和 1 位訪客

cron