scan Hard Disk for bad sectors

Another possible option... drive manufacturers often have bootable iso images, which include utilities to check their drives.
 
  • Thanks
Reactions: ccc
These utilities don't do anything different than what dd is doing.

I have found many manufacturers utilities for 'low level format to recover the disk' do actually do the DOS (ah... Windows ;)) equivalent of

# dd if=/dev/zero of=/dev/adX bs=128k
 
When the disk is unformatted, I like to use an Ubuntu LiveCD and Palimpsest (Disk Utility). It is easy to use and informative. Unfortunately it's not in ports.

In FreeBSD, using ZFS and a
# zpool scrub
# zpool status
should uncover anything that would have resulted in a bad sector.
 
  • Thanks
Reactions: ccc
wblock said:
It's 128k, not 128.
% man dd | less +/sizes

Reading multiple blocks at a time greatly reduces overhead, making it much faster.
Yes, but what I meant is why are you not using bigger block sizes, such as 1m or so.
 
  • Thanks
Reactions: ccc
Beastie said:
Yes, but what I meant is why are you not using bigger block sizes, such as 1m or so.

Because it probably won't make a difference:

Code:
% time dd if=/dev/ada0 of=/dev/null bs=64k count=64k
65536+0 records in
65536+0 records out
4294967296 bytes transferred in 37.826251 secs (113544620 bytes/sec)
0.020u 0.873s 0:37.82 2.3%	29+1242k 65536+0io 0pf+0w

% time dd if=/dev/ada0 of=/dev/null bs=128k count=32k
32768+0 records in
32768+0 records out
4294967296 bytes transferred in 37.830190 secs (113532797 bytes/sec)
0.000u 0.684s 0:37.83 1.7%	27+1166k 32768+0io 0pf+0w

% time dd if=/dev/ada0 of=/dev/null bs=1m count=4k
4096+0 records in
4096+0 records out
4294967296 bytes transferred in 37.838443 secs (113508034 bytes/sec)
0.000u 0.637s 0:37.83 1.6%	23+977k 32768+0io 0pf+0w

Same amount of data, same time. Once the overhead is reduced enough to be insignificant, increasing the buffer size doesn't make it go any faster.
 
wblock said:
Brute force:
# dd if=/dev/ad4 of=/dev/null bs=128k

Watch for errors. See also sysutils/smartmontools, although SMART has been known to report no problems on drives with known problems.

Thx, but howto use dd for just reading bad sectors without damaging any data on the hard disk?
 
Back
Top