Search
Search titles only
By:
Search titles only
By:
Forums
New posts
Search forums
What's new
New posts
Latest activity
Feedback
View Statistics
Members
Current visitors
Buy Sell Trade
WTB
Log in
Register
Search
Search titles only
By:
Search titles only
By:
New posts
Search forums
Menu
Install the app
Install
Reply to thread
Forums
Technology
Home Automation & Networking
Network Drive error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="b.life" data-source="post: 2409176" data-attributes="member: 77431"><p>Good Morning,</p><p> Few things to note,</p><p>1. When we use the hdparm with --repair-sector it will write 0x0 to the sector and will force the hdd to fix that badblock by remapping a free sector</p><p>2. If there is no free sector(possiblility is in single digits though) it will be marked as bad and the controller will omit the sector from that time forward</p><p>3. If the second point turns out to be true you will be loosing disk capacity but the controller will still be reporting 2TB so plan accordingly</p><p>4. If these bad sectors are part of some files then those files will have recovery issues. Re-checking the files will help in redownloading the missing/corrupt sections.</p><p></p><p>Said that,</p><p>Fixing the sectors is a one sector at a time job so each sector has to be piped using a script of your choice. I have included a bash script for reference</p><p></p><p>[CODE=bash]#!/bin/bash</p><p></p><p>File_Name="badblocks-list.txt"</p><p></p><p>while read -r bad_block; do</p><p> hdparm --repair-sector $bad_block --yes-i-know-what-i-am-doing /dev/sda</p><p> sleep 2</p><p>done <$File_Name [/CODE]</p><p></p><p>I have included "sleep 2" to give the hdparm time to finish the write command, you can increase the time(in seconds) as you see fit.</p><p></p><p>Man page for hdparm: <a href="https://www.man7.org/linux/man-pages/man8/hdparm.8.html" target="_blank">https://www.man7.org/linux/man-pages/man8/hdparm.8.html</a></p><p></p><p>Hope this helps</p><p></p><p>Edit 1: Changed /dev/sdb to /dev/sda</p></blockquote><p></p>
[QUOTE="b.life, post: 2409176, member: 77431"] Good Morning, Few things to note, 1. When we use the hdparm with --repair-sector it will write 0x0 to the sector and will force the hdd to fix that badblock by remapping a free sector 2. If there is no free sector(possiblility is in single digits though) it will be marked as bad and the controller will omit the sector from that time forward 3. If the second point turns out to be true you will be loosing disk capacity but the controller will still be reporting 2TB so plan accordingly 4. If these bad sectors are part of some files then those files will have recovery issues. Re-checking the files will help in redownloading the missing/corrupt sections. Said that, Fixing the sectors is a one sector at a time job so each sector has to be piped using a script of your choice. I have included a bash script for reference [CODE=bash]#!/bin/bash File_Name="badblocks-list.txt" while read -r bad_block; do hdparm --repair-sector $bad_block --yes-i-know-what-i-am-doing /dev/sda sleep 2 done <$File_Name [/CODE] I have included "sleep 2" to give the hdparm time to finish the write command, you can increase the time(in seconds) as you see fit. Man page for hdparm: [URL]https://www.man7.org/linux/man-pages/man8/hdparm.8.html[/URL] Hope this helps Edit 1: Changed /dev/sdb to /dev/sda [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Technology
Home Automation & Networking
Network Drive error
Top
Bottom