LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-26-2013, 05:55 PM   #1
ccc
Member
 
Registered: Oct 2002
Posts: 100

Rep: Reputation: 0
check a hard disk for bad blocks


hi

Howto check the hard disk for bad blocks after formating?
 
Old 08-26-2013, 05:59 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I usually prefer the harddisk manufacturer's diagnosis tool to check for bad blocks, but you can also use the generic badblocks tool. Keep in mind that some options of the badblocks tool will destroy the data on the disk, so handle it with care and read the manpage before using it.
 
1 members found this post helpful.
Old 08-27-2013, 02:09 AM   #3
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
If you did full format (zeroing all sectors), then (I think) SMART should show you if there are any bad (reallocated) blocks/sectors. You can use 'Disk Utility', 'smartctl' or similar.

If their number doesn't increase, I wouldn't worry much. It might be a good idea to isolate them in unpartitioned space.

with modern drives, I doubt any software can do more than 'dd'. however, some say 'HDD Regenerator' is very good at 'repairing' hdd.

Last edited by qrange; 08-27-2013 at 02:12 AM.
 
Old 08-27-2013, 12:33 PM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by qrange View Post
If you did full format (zeroing all sectors), then (I think) SMART should show you if there are any bad (reallocated) blocks/sectors. You can use 'Disk Utility', 'smartctl' or similar.

If their number doesn't increase, I wouldn't worry much. It might be a good idea to isolate them in unpartitioned space.

with modern drives, I doubt any software can do more than 'dd'. however, some say 'HDD Regenerator' is very good at 'repairing' hdd.
HDD Regenerator only works under Windows.
 
Old 08-27-2013, 12:48 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I wouldn't trus any software that claims to repair hardware issues. Especially those HDD "regenerators" create a false trust for the user that his hardware is magically fixed, while in reality it is likely that the situation will get worse.
 
Old 08-27-2013, 04:30 PM   #6
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
My guess is that they simply 'zero wipe' all sectors (easily done with dd) and let hdd automatically remap bad ones (to spare area). But, I'd give 'hdd regenerator' a try if all else fails, even though its windows and all. (there was also famous 'spinrite', similar program, but also nonlinux)

Old hdds had a list of bad blocks on a label, back then you probably couldn't even find one without them, so it doesn't mean disk is useless. Still, I wouldn't keep important data on such disk, to be safe. And I'd replace it if number of bad blocks increases.


you can check if all blocks are readable with: dd if=/dev/... of=/dev/null bs=128K
I'd do it 'offline', while disk is not mounted (from livecd if needed). But be careful, dd can be destructive if not used properly.
That badblocks tool probably does something similar in read only mode.

Last edited by qrange; 08-27-2013 at 04:47 PM.
 
Old 08-27-2013, 04:50 PM   #7
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,111
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
Live Gparted>Check?
 
Old 08-27-2013, 07:05 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I'd think the best is the OEM's diag disk.
If you can't get the actual OEM diags you may wish to get ultimate boot cd. I think it has two common generic diags. You generally have to select the long test or some test that may take a few hours or even a day or so.
 
Old 08-29-2013, 04:44 PM   #9
ccc
Member
 
Registered: Oct 2002
Posts: 100

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TobiSGD View Post
I usually prefer the harddisk manufacturer's diagnosis tool to check for bad blocks, but you can also use the generic badblocks tool. Keep in mind that some options of the badblocks tool will destroy the data on the disk, so handle it with care and read the manpage before using it.
Thx, but howto check the health of a hard drive using badblocks tool?
There is no data on this hard disk.
Is it:
Code:
# badblocks -svw /dev/sda
a correct way?
 
Old 08-29-2013, 05:50 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Yes that works if you have no data on it.
Warning: To anyone, the -w option makes destructive tests, so the data on the disk will inevitably be lost after the test. If you need the data on the disk make a backup first and use the -w option or use -n option instead, which will perform nondestructive tests. In any case when using such tools, read the manpage!
 
Old 09-02-2013, 07:31 AM   #11
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
@TobiSGD

seems to me they could have easily made a lot less destructive version, by simply writing back buffer.
it would have been slower, though.
 
Old 11-07-2013, 04:40 PM   #12
ccc
Member
 
Registered: Oct 2002
Posts: 100

Original Poster
Rep: Reputation: 0
Thx, I have started on 1TB HDD:
Code:
# badblocks -vw /dev/sdb
Checking for bad blocks in read-write mode
From block 0 to 975193692
Testing with pattern 0xaa:
and it works since many hours.
BTW knows anyone, when is finish normally, if the HDD is healthy?
 
Old 11-09-2013, 07:19 AM   #13
ccc
Member
 
Registered: Oct 2002
Posts: 100

Original Poster
Rep: Reputation: 0
Now i get the following:
Code:
# badblocks -vw /dev/sdb
Checking for bad blocks in read-write mode
From block 0 to 975193692
Testing with pattern 0xaa:
done
Reading and comparing: 1921152
1921164
1921165
1921166
1921167
1928504
1932784
1932788
1932789
1932790
1932791
1935840
1935864
1935865
1935866
1935867
2007088
2007140
2007141
2007142
2007143
2012240
2012264
2012265
2012266
2012267
2031200
2031240
2031241
2031242
2031243
2039552
3739120
3739168
3739169
3739170
3739171
3740184
3741200
3741220
3741221
3741222
3741223
3746512
3746520
3746521
3746522
3746523
3750608
4264200
4264208
4264209
4264210
4264211
4269448
4269508
4269509
4269510
4269511
4293552
4293608
4293609
4293610
4293611
25889888
25889900
25889901
25895192
25895200
25895201
25895202
27106008
27114384
27114392
27114393
27114394
27114395
27116432
27116440
27116441
27116442
27116443
27118480
27118492
27118493
27118494
27118495
36697928
36699968
36704248
36704264
36704265
36704266
36704267
36710528
42944376
42944388
42944389
42944390
42944391
42949488
42949512
42949513
42949514
42949515
42955776
42955836
42955837
42955838
42955839
42962152
42962160
42962161
42962162
42962163
44257640
44257656
44257657
44257658
44257659
59603248
59603292
59603293
59603294
59603295
59604296
59604316
60152072
60152076
91317880
91317896
91317897
91317898
91317899
91337664
91337724
91337725
91337726
91337727
91351336
91351396
91351397
91351398
91351399
91384848
91384896
91384897
91384898
91384899
91401592
91408944
91412056
91412072
91412073
91412074
91412075
91416288
91416348
91416349
91416350
91416351
91418376
91418396
91418397
91418398
91418399
91420424
91431008
91431048
91431049
91431050
91431051
91433088
91433096
91433097
91433098
91433099
done
Testing with pattern 0x55:
and it still working.
 
  


Reply

Tags
badblocks, check, debian, format, write



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] check if hard disk is bad !! hack-back !! Linux - Server 9 02-20-2013 11:02 AM
[SOLVED] How to re-partition a hard disk with bad blocks? kcynice Linux - Desktop 7 12-24-2010 12:55 AM
Check hda (disk with centos) for bad blocks (LVM) c087 Linux - Hardware 3 09-11-2008 06:37 PM
How to do a bad blocks check yelo Linux - General 2 04-02-2004 10:14 PM
Bad BLocks on Hard disk... hpnadig Linux - Hardware 0 03-10-2004 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration