DaemonForums  

Go Back   DaemonForums > Miscellaneous > General Hardware

General Hardware General hardware related questions.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th December 2010
guitarscn guitarscn is offline
Package Pilot
 
Join Date: Oct 2008
Posts: 166
Default How do I check an entire HDD?

I want to run something like fsck or chkdsk or whatever on a blank hard drive (just had it written with 0s several times) to check if anything is wrong. Do I have to format it with something first? If so does it matter if I format it on ext3, NTFS, etc.?
Reply With Quote
  #2   (View Single Post)  
Old 24th December 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

What are you rambling about? if you believe your disk is failing you will know.. errors will appear in the dmesg when you're reading/writing to or from it.

You can use dd(1) to do arbitrary I/O like that, no filesystem needs to exist on the drive.

Assuming the disk is sd2, use the raw character device (..unbuffered) to avoid kernel caches.. rsd2c spans the entire disk, ignore the read error when it reaches the end of the disk.

$ sudo dd if=/dev/rsd2c of=/dev/null bs=64k

If it succeeds you should not see any kernel messages (..white text on blue), this isn't an absolute guarantee though.

Note; that most drives cache reads & writes in hardware... and internally remap bad sectors, this can cause "soft errors" which are detected in the kernel.

Other factors include bad IDE/SATA cables, overloaded power supplies, physical turbulence (..shaking a laptop roughly), solar flares, and C-x M-c M-butterfly..
Reply With Quote
  #3   (View Single Post)  
Old 25th December 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Downside of dd is that it won't display the speed of the sectors being scanned. If you have for example 100 sectors with an access time of 1 sec then you may want to replace the drive anyway.

For this reason I always use MHDD, which displays access times. It can also check SMART status.
Search the forums for it, I believe I once some instructions for it.

Quote:
C-x M-c M-butterfly..
This is not something of a hoax, it's true that an older version had a bug in it (A moth would be triggered, not a butterfly) which may cause the hard drive to break, but this has been fixed a long time ago. It is now considered to be quite safe.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 25th December 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Quote:
Originally Posted by Carpetsmoker View Post
Downside of dd is that it won't display the speed of the sectors being scanned. If you have for example 100 sectors with an access time of 1 sec then you may want to replace the drive anyway.
Most implementations will print a progress report if you send SIGINFO to them.

I configure ^T (CTRL+T) to send that signal in my .profile.

$ stty status ^T

Code:
$ sudo dd if=/dev/rsd2c of=/dev/null bs=64k
^T
load: 0.37  cmd: dd 25514 [physio] 0.00u 0.06s 0% 57k
1540+0 records in
1540+0 records out
100925440 bytes transferred in 1.822 secs (55386132 bytes/sec)
Quote:
Originally Posted by Carpetsmoker View Post
This is not something of a hoax, it's true that an older version had a bug in it (A moth would be triggered, not a butterfly) which may cause the hard drive to break, but this has been fixed a long time ago. It is now considered to be quite safe.
Yeah, they should have all the kinks worked out by now.
Reply With Quote
  #5   (View Single Post)  
Old 26th December 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

The e2fsprogs package includes the "badblocks" program, which will write and read a variety of bit patterns. This will convert any bad sectors to replacement sectors from spares. once spares are used up, the disk is done.
Reply With Quote
  #6   (View Single Post)  
Old 18th January 2011
wesley wesley is offline
Real Name: Wesley
Shell Scout
 
Join Date: Aug 2009
Location: Reunion Island
Posts: 92
Default

you have also this one :
http://hddguru.com/software/2005.10.02-MHDD/
i use it at Work to test hard disk (corrupted sector).
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning an entire drive? spiderpig OpenBSD General 12 14th August 2019 09:49 AM
please check my pf.conf gosha OpenBSD Security 10 30th January 2009 12:32 AM
check for badblocks ccc FreeBSD General 5 30th October 2008 07:00 PM
how to check package dependencies? bsdnewbie999 OpenBSD Packages and Ports 5 31st July 2008 04:05 AM
backing up an entire system mwotsch FreeBSD General 5 14th July 2008 03:00 PM


All times are GMT. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick