how to scan hard drive for bad sectors

Booting, installing, newbie
Post Reply
Message
Author
eXistenZ
Posts: 14
Joined: Mon 14 Sep 2009, 18:01
Location: Egypt

how to scan hard drive for bad sectors

#1 Post by eXistenZ »

I wanna know if there is a good and simple utility that runs with puppy linux and allow me to detect hard drive bad sectors and fix them.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#2 Post by Béèm »

I remember this has been discussed here already, but don't know where and when exactly.
Maybe you can find the posts with the puppysearch link in my sig.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

Do some research on the command

Code: Select all

e2fsck -c /dev/sdxy
Note that the target partition must be unmounted when you run e2fsck, so you will need to boot with the "puppy pfix=ram" option.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#4 Post by Béèm »

:oops: How could I forget that obvious one.
rcrsn51 is right. The referenced command can take care of this.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

Re: how to scan hard drive for bad sectors

#5 Post by PANZERKOPF »

eXistenZ wrote:I wanna know if there is a good and simple utility that runs with puppy linux and allow me to detect hard drive bad sectors and fix them.
You need a low-level diagnostic program for correct testing HDD's surface.
The bad sectors are different: some of them may be recovered but some - never.
I never heard of linux programs for such purposes but I know about programs for
DOS.
Which model of HDD You have?
SUUM CUIQUE.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#6 Post by nooby »

I never heard of linux programs for such purposes but I know about programs for
DOS.
I thought Linux folks cared about their HDDs. Is such things top secret held by the makers of hdds then? or why else doesn't such exists.

I want to be totally free of Ms things.

Maybe there exist FreeDOS programs on some rescue CD?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
linuxsansdisquedur
Posts: 248
Joined: Tue 13 Jan 2009, 21:17
Location: South of France

#7 Post by linuxsansdisquedur »

when fdisk do not repair hd problem :shock: you can try low level test :shock:
last time my hdd needed low level diagnostic program from my hd maker :? ... I came to puppy because total disk failure ...and i began a new live hard disk free :wink:
le max avec le min

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#8 Post by Colonel Panic »

The best way I know of to "treat" an old hard drive is (or was) Gibson Research's "Spinrite", but that's not free or cheap (if it's still available - it's been years since I last saw it).

Failing that, Norton Utilities used to do a program called "Calibrate" in their Utilities suite which did a similar job. I used it once or twice in the past.
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

Re: how to scan hard drive for bad sectors

#9 Post by WhoDo »

PANZERKOPF wrote:You need a low-level diagnostic program for correct testing HDD's surface.
PANZERKOPF is correct. Some of the programs offered by the hardware vendor do, in fact, run under Linux but ALL are proprietary versions because they address the drive logic circuits directly.

If you have a Seagate drive, there is a Seagate utility (free) for testing, diagnostics and low level formatting.

If you have a Fujitsu drive, same thing.

If you have a Western Digital drive, same thing.

If you have ... yeah, same thing!

Check the web and download the image to build a CD for testing your particular hard drive. The biggest issue will be that most will assume you do that using a Windows PC and provide a suitable image. After building the CD from the image file you won't need Windows. If you're lucky your hdd manufacturer will supply an ISO image and you can use burniso2cd to make your CD.

FWIW, e2fsck is a file system checker and not a drive sector diagnostic. It's action is to look for inconsistencies in the file system tables in an ext2 file system (the 'e2' part of the name), not to check hard disk sectors for bad reads and writes. It may indicate problems in a given table, which may be due to problems with the drive, but it will never locate the specific sector or attempt to recover it at the hardware level. Still, it is a very useful utility for what it does.

Hope that helps.
[i]Actions speak louder than words ... and they usually work when words don't![/i]
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#10 Post by rjbrewer »

Detecting bad hard drive sectors is one thing;
"Repairing"......another.

http://forums.techarena.in/hardware-per ... 092536.htm

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#11 Post by PANZERKOPF »

nooby wrote: I thought Linux folks cared about their HDDs. Is such things top secret held by the makers of hdds then? or why else doesn't such exists.
I want to be totally free of Ms things.
Maybe there exist FreeDOS programs on some rescue CD?
About secrets:
Standard ATA commands are no secret but each HDD also has it's own specific commands which are manufacturer's secret. Standard testing programs use
only standard ATA commands and such testing is enough for usual user.
But if You want to test a HDD in advanced "technological mode", You need to
know these commands and also a structure of HDD.
For example: Linux has a "hdparm" utility which sends and receives ATA commands to/from HDD.
One of the best program for testing HDD in standard mode is "victoria" (Have attached here). Runs under FreeDOS.
P.S.
This program is freeware.
Attachments
vcr333re.zip
(108.49 KiB) Downloaded 625 times
Last edited by PANZERKOPF on Sat 29 May 2010, 22:25, edited 1 time in total.
SUUM CUIQUE.

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#12 Post by PANZERKOPF »

rjbrewer wrote:Detecting bad hard drive sectors is one thing;
"Repairing"......another.
You are right, "Repairing" is not a correct word but "replacing"
is more correct. :) Each HDD has few reserved sectors which can be used instead
of damaged sectors. All sectors are ordered in special tables.
SUUM CUIQUE.

Skipper_the_eye_child
Posts: 33
Joined: Wed 03 Feb 2010, 10:34

#13 Post by Skipper_the_eye_child »

Smartmontools won't fix bad sectors, but will pick them up. This guide tells you how to manually reallocate bad blocks:
http://smartmontools.sourceforge.net/badblockhowto.html

And rather more straight forward, here's a HOWTO on using smartctl to run tests on SMART enabled hard drives:
http://blog.shadypixel.com/monitoring-h ... tmontools/

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#14 Post by Sylvander »

I've been using the following with success:
"To erase a HDD, and at the same time remap any bad blocks to have them taken out of use:
e.g.
"
badblocks -svw /dev/sdc
badblocks -svw /dev/sda

Where sda or sdc is the HDD identifier."
Got at http://www.murga-linux.com/puppy/viewtopic.php?t=38632

The OP didn't say whether the process was to be non-destructive.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#15 Post by rcrsn51 »

From the e2fsck man page:
-c
This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a file or directory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

#16 Post by WhoDo »

rcrsn51 wrote:From the e2fsck man page:
-c
This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a file or directory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.
Yes, "allocated" meaning at the software level. If the problem is at the hardware level the only way to recover is via a low-level format which locks out the bad sectors via the device firmware i.e. the OS never gets to "see" the excluded blocks much less allocate them.

BTW, AFAIK a "non-destructive read-write test" is not possible on occupied/allocated data blocks. Writing test data to a sector to read it back for accuracy MUST overwrite whatever data was already in that sector. It could be useful for checking an empty drive after reformatting though; IOW where the partition table data is not affected (hence non-destructive) ipso facto that specific area (boot/partition area) of the drive would also not be checked by the read-write test.

Maybe we're talking about different things, though, so I'm happy to A2D on the subject.
[i]Actions speak louder than words ... and they usually work when words don't![/i]
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com

Post Reply