Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

badblocks hangs

91 views
Skip to first unread message

Bob Tennent

unread,
Jun 14, 2008, 8:38:43 PM6/14/08
to
I have a laptop drive that causes badblocks to hang, whether called
directly or via mke2fs -c. Is there anything I can do to make the drive
usable?

Bob T.

Henrik Carlqvist

unread,
Jun 15, 2008, 7:25:28 AM6/15/08
to
Bob Tennent <Bo...@cs.queensu.ca> wrote:
> I have a laptop drive that causes badblocks to hang, whether called
> directly or via mke2fs -c.

Do you see any error messages from dmesg?

> Is there anything I can do to make the drive usable?

Maybe it woudl be possible to place partitions on the drive that doesn't
use the broken part. However, a HD with some bad sectors ususally soon
gets more bad sectors.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost

Bob Tennent

unread,
Jun 15, 2008, 8:51:45 AM6/15/08
to
On Sun, 15 Jun 2008 13:25:28 +0200, Henrik Carlqvist wrote:
> Bob Tennent <Bo...@cs.queensu.ca> wrote:
>> I have a laptop drive that causes badblocks to hang, whether called
>> directly or via mke2fs -c.
>
> Do you see any error messages from dmesg?

No error messages.

>> Is there anything I can do to make the drive usable?
>
> Maybe it woudl be possible to place partitions on the drive that doesn't
> use the broken part.

That seems to have worked. Thanks.

> However, a HD with some bad sectors ususally soon
> gets more bad sectors.

It's a relatively new drive. Perhaps some extraordinary physical
event?

Bob T.

Joe Pfeiffer

unread,
Jun 15, 2008, 10:18:29 AM6/15/08
to
Bob Tennent <Bo...@cs.queensu.ca> writes:

Drives are cheap, data is expensive. When a drive starts to fail, it
has a very short life expectancy -- don't bother trying to make it
useable, buy a new drive.

Henrik Carlqvist

unread,
Jun 15, 2008, 11:47:13 AM6/15/08
to
Bob Tennent <Bo...@cs.queensu.ca> wrote:
> > However, a HD with some bad sectors ususally soon gets more bad
> > sectors.
>
> It's a relatively new drive. Perhaps some extraordinary physical event?

If the drive is rather new you might be able to get a warrynty
replacement? If I have understood modern drives right they have a number
of spare sectors which the drive internally remaps to replace any broken
sectors that it finds. With this solution the user never suffers from any
bad sectors, the replacement is done trasnparently before the error is so
severe that it causes any errors. Once the spare sectors have run out the
drive no longer has any way to hide new broken sectors.

Stefan Patric

unread,
Jun 15, 2008, 8:32:02 PM6/15/08
to

Are you checking an individual partition or the whole, unpartitioned
drive?

Is the drive or partition mounted? It shouldn't be.

Are you using the -v option for verbose output?

Are you doing the non-destructive read-only test or the destructive read/
write (-w) one?

How big is the drive or partition you're checking.

The read/write test can take a LONG time even on smaller drives. I did a
badblocks -w -v on an older 40G hard drive (5400 RPM) installed as a
Slave with a single 40G partition, and it took about 30 hours. System
was a 1GHz Duron with 512MB RAM running only a shell, no X-server or GUI.

So, are you sure badblocks is hanging?


Stef

Bob Tennent

unread,
Jun 15, 2008, 10:32:23 PM6/15/08
to
On Mon, 16 Jun 2008 00:32:02 GMT, Stefan Patric wrote:
> On Sun, 15 Jun 2008 00:38:43 +0000, Bob Tennent wrote:
>
>> I have a laptop drive that causes badblocks to hang, whether called
>> directly or via mke2fs -c. Is there anything I can do to make the drive
>> usable?
>
> Are you checking an individual partition or the whole, unpartitioned
> drive?

Individual partition.

> Is the drive or partition mounted? It shouldn't be.

No.

> Are you using the -v option for verbose output?

No difference.

> Are you doing the non-destructive read-only test or the destructive read/
> write (-w) one?

I think you mean the non-destructive read/write test; of course the
read-only test is non-destructive. In any case, both hung up.

> How big is the drive or partition you're checking.

40GB

> The read/write test can take a LONG time even on smaller drives. I did a
> badblocks -w -v on an older 40G hard drive (5400 RPM) installed as a
> Slave with a single 40G partition, and it took about 30 hours. System
> was a 1GHz Duron with 512MB RAM running only a shell, no X-server or GUI.
>
> So, are you sure badblocks is hanging?

badblocks -s produces block-number outputs every second. These stop
changing, always at the same block. Nothing happens from then on.
Even kill -9 doesn't work on it; one has to disconnect the drive.

After putting the section that causes the hang in a gap between
partitions, I've managed to run badblocks read/write through all the
parititions and built filesystems on them. No problems copying file
systems to them so far.

Bob T.

Stefan Patric

unread,
Jun 16, 2008, 7:45:19 PM6/16/08
to
On Mon, 16 Jun 2008 02:32:23 +0000, Bob Tennent wrote:

> On Mon, 16 Jun 2008 00:32:02 GMT, Stefan Patric wrote:
> > On Sun, 15 Jun 2008 00:38:43 +0000, Bob Tennent wrote:
> >
> >> I have a laptop drive that causes badblocks to hang, whether called
> >> directly or via mke2fs -c. Is there anything I can do to make the
> >> drive usable?
> >
> > Are you checking an individual partition or the whole, unpartitioned
> > drive?
>
> Individual partition.
>
> > Is the drive or partition mounted? It shouldn't be.
>
> No.
>
> > Are you using the -v option for verbose output?
>
> No difference.

What does it report, if anything?

> > Are you doing the non-destructive read-only test or the destructive
> > read/ write (-w) one?
>
> I think you mean the non-destructive read/write test; of course the
> read-only test is non-destructive. In any case, both hung up.

No, I didn't. So, you've tried the default read-only and the non-
destructive read-write test (-n option), and both hang. Have you tried
the destructive read-write test?

> > How big is the drive or partition you're checking.
>
> 40GB
>
> > The read/write test can take a LONG time even on smaller drives. I
> > did a badblocks -w -v on an older 40G hard drive (5400 RPM) installed
> > as a Slave with a single 40G partition, and it took about 30 hours.
> > System was a 1GHz Duron with 512MB RAM running only a shell, no
> > X-server or GUI.
> >
> > So, are you sure badblocks is hanging?
>
> badblocks -s produces block-number outputs every second. These stop
> changing, always at the same block. Nothing happens from then on. Even
> kill -9 doesn't work on it; one has to disconnect the drive.

Strange. Ctrl-c doesn't stop badblocks, either?

> After putting the section that causes the hang in a gap between
> partitions, I've managed to run badblocks read/write through all the
> parititions and built filesystems on them. No problems copying file
> systems to them so far.

I had a very old drive that had the same problem. I did a dd /dev/null
to the drive several times (not just the partition) wiping out
everything--partition table, MBR, etc. Then using fdisk, which
automatically created a default DOS partition table, I created a single
Linux partition on the whole drive, formatted it without a bad block
check, then badblocked it and it checked through the previously bad
sections, recognized they were bad and wrote them out, so the filesystem
wouldn't use them.

Is the drive light showing activity when badblocks is at the bad areas?

Is this an old drive or new? If it's still under warranty, I'd get it
replaced.


Stef

Bob Tennent

unread,
Jun 17, 2008, 8:16:52 AM6/17/08
to
On Mon, 16 Jun 2008 23:45:19 GMT, Stefan Patric wrote:
>> > On Sun, 15 Jun 2008 00:38:43 +0000, Bob Tennent wrote:
>> >
>> >> I have a laptop drive that causes badblocks to hang, whether called
>> >> directly or via mke2fs -c. Is there anything I can do to make the
>> >> drive usable?
>> >
>> > Are you using the -v option for verbose output?
>>
>> No difference.
>
> What does it report, if anything?

Nothing.

>> > Are you doing the non-destructive read-only test or the destructive
>> > read/ write (-w) one?
>>
>> I think you mean the non-destructive read/write test; of course the
>> read-only test is non-destructive. In any case, both hung up.
>
> No, I didn't. So, you've tried the default read-only and the non-
> destructive read-write test (-n option), and both hang. Have you tried
> the destructive read-write test?

No.

>> kill -9 doesn't work on it; one has to disconnect the drive.
>
> Strange. Ctrl-c doesn't stop badblocks, either?

No.

> I had a very old drive that had the same problem. I did a dd /dev/null
> to the drive several times (not just the partition) wiping out
> everything--partition table, MBR, etc.

I just tried this. dd fails:

# dd if=/dev/zero of=/dev/sdb
dd: writing to `/dev/sdb': Input/output error
2905569+0 records in
2905568+0 records out
1487650816 bytes (1.5 GB) copied, 840.625 s, 1.8 MB/s

I repeated and got essentially the same result.

> Is the drive light showing activity when badblocks is at the bad areas?

No.

> Is this an old drive or new?

4 years old.

Stefan Patric

unread,
Jun 18, 2008, 8:20:10 PM6/18/08
to
On Tue, 17 Jun 2008 12:16:52 +0000, Bob Tennent wrote:

> [snip]


>
> > I had a very old drive that had the same problem. I did a dd
> > /dev/null to the drive several times (not just the partition) wiping
> > out everything--partition table, MBR, etc.
>
> I just tried this. dd fails:
>
> # dd if=/dev/zero of=/dev/sdb
> dd: writing to `/dev/sdb': Input/output error 2905569+0 records in
> 2905568+0 records out
> 1487650816 bytes (1.5 GB) copied, 840.625 s, 1.8 MB/s
>
> I repeated and got essentially the same result.

Try the noerror option: dd if=/dev/null of=/dev/sdb noerror

dd stops when with a read or write error. With noerror, it won't.

My guess is now that bad areas of your drive are physically damaged and
unable to accept and store data. You only option is what you've already
done: partition around the bad sections.

Stef

Aragorn

unread,
Jun 18, 2008, 8:29:00 PM6/18/08
to
On Thursday 19 June 2008 02:20, someone who identifies as *Stefan Patric*
wrote in /comp.os.linux.hardware:/

Actually, he has another option...: He should back up all data that's on
that drive and then buy another one and toss this one.

At the prices of modern hard disks, it's not worth running the risk to
further data corruption due to a failing drive - if the sectors are
physically damaged, then it's very likely that the heads touch the platters
at some point, and then this _will_ happen again and will damage the
magnetic coating of the platters even further, not to mention that it's not
exactly beneficial to the heads themselves either.

--
*Aragorn*
(registered GNU/Linux user #223157)

Bob Tennent

unread,
Jun 18, 2008, 9:56:34 PM6/18/08
to
On Thu, 19 Jun 2008 02:29:00 +0200, Aragorn wrote:
> On Thursday 19 June 2008 02:20, someone who identifies as *Stefan Patric*
> wrote in /comp.os.linux.hardware:/
>
>> On Tue, 17 Jun 2008 12:16:52 +0000, Bob Tennent wrote:
>>
>>> [snip]
>>>
>>> > I had a very old drive that had the same problem. I did a dd
>>> > /dev/null to the drive several times (not just the partition) wiping
>>> > out everything--partition table, MBR, etc.
>>>
>>> I just tried this. dd fails:
>>>
>>> # dd if=/dev/zero of=/dev/sdb
>>> dd: writing to `/dev/sdb': Input/output error 2905569+0 records in
>>> 2905568+0 records out
>>> 1487650816 bytes (1.5 GB) copied, 840.625 s, 1.8 MB/s
>>>
>>> I repeated and got essentially the same result.
>>
>> Try the noerror option: dd if=/dev/null of=/dev/sdb noerror
>>
>> dd stops when with a read or write error. With noerror, it won't.
>>
>> My guess is now that bad areas of your drive are physically damaged and
>> unable to accept and store data. You only option is what you've already
>> done: partition around the bad sections.
>
> Actually, he has another option...: He should back up all data that's on
> that drive and then buy another one and toss this one.

I have in fact done this. It was actually a back-up drive so I didn't lose
anything.

0 new messages