Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1333263

April 25th, 2013 14:00

marking bad sectors so the OS won't use them

Hello.

In the old days, you could "mark" bad disk sectors so that they wouldn't be used.

Nowadays, the disk is managed by a microcontroller on the drive itself, and that microcontroller keeps track of bad sectors and "swaps in" good sectors from a reserve pool.   It works great as long as there are sectors left in the reserve pool.

But when that "reserve pool" is depleted, the OS churns along and merrily tries to write to bad sectors.

So my question is:  are there any tools out there for Windows which can be used to scan the disk and "allocate" any bad sectors into a hidden file so that the OS doesn't try to write to (or read from) them?

Please, hold the suggestions about getting a new disk etc etc.  This is for cost-free reviving of serviceable old laptop computers to be used for non-critical tasks.

1 Message

August 8th, 2013 02:00

Hello,

I recently used a small tool called RepartitionBadDrive to do exactly what you need: create separate partitions of bad sectors (just a mouse click away). There were not hidden but you can delete the drive letters from windows disk management so the partitions will disappear from my computer. Email me if you need any help! <ADMIN NOTE: Email id removed per privacy policy> or visit http://www.dposoft.net/rbd.html

6.4K Posts

April 25th, 2013 15:00

I believe the feature you are searching for is in chkdsk for a Microsoft operating system, just as in the old days.  Go to the properties page for the drive and use the tools found there to check the hard drive for errors.

EDIT:  By the way; if the drive is so far gone that the spare sectors have been exhausted, the drive may not be too long for this world anyway.  I would think that the life it had left was rather limited.

6 Professor

 • 

8.8K Posts

April 26th, 2013 10:00

As Jack has stated, the drive is no longer reliable if its reserve sector pool is exhausted. If you value the data, you're well advised to be imaging it to a new drive.

40 Posts

April 26th, 2013 11:00



As Jack has stated, the drive is no longer reliable if its reserve sector pool is exhausted. If you value the data, you're well advised to be imaging it to a new drive.


As I stated in the original post:

Please, hold the suggestions about getting a new disk etc etc.  This is for cost-free reviving of serviceable old laptop computers to be used for non-critical tasks.

40 Posts

April 26th, 2013 15:00

checkdisk /f looks for errors in the file system.  with that option it's not a bad-sector tool.

checkdisk /r looks for bad sectors, but tries to recover data from them (which I *don't* want; it takes too long).  also, it's not clear what chkdsk /r *does* with sectors it thinks are bad (I can't find this documented anywhere).  also, I'm looking for a tool which scans an entire partition, sector-by-sector (or cluster-by-cluster), looking for bad sectors, with *no retries* (I want this to be as fast as possible and I'd rather mark a good sector bad than mark a questionable one as good), and either simply reports the bad sectors (so I can manually partition around them) or uses the filesystem to allocate them so the OS will not use them.   it's not clear if chkdsk /r does this, because its behavior is not document (at least not anywhere I've found)

In the past, I've used scanning tools to locate bad sectors, then I've manually partitioned around them.  This has worked well, but it takes forever since the tools I've used so far try to recover data, and they take forever trying to recover data when I don't care about the data.  I just want to know where the bad sectors are, as fast as possible (e.g. I don't want to run the tool for 7 days on a 200GB drive).

Is there such a tool, for Windows?

6.4K Posts

April 26th, 2013 15:00

I haven't used chkdsk in that way for quite some time, but I seem to recall that you can tell it you don't want the recovered data to be gathered into files.  Unless the recovered data is text, I don't believe it is of much use anyway.  It might work out better if you execute the application from a command prompt.  That would also allow you to use the /? parameter to get a list of what you can do.

Once the application finds the bad sectors and attempts to retrieve the data, it marks them as "Used" so that the operating system no longer uses them.

40 Posts

April 26th, 2013 16:00

.

use the /? parameter to get a list of what you can do.

I already did "help chkdsk".  All it does is list the allowed parameters with very limited explanation:

Microsoft Windows XP [Version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

C:\>help chkdsk

Checks a disk and displays a status report.

CHKDSK [volume[[path]filename]]] [/L[:size]]

 volume          Specifies the drive letter (followed by a colon),

                 mount point, or volume name.

 filename        FAT/FAT32 only: Specifies the files to check for fragmentation

 /F              Fixes errors on the disk.

 /V              On FAT/FAT32: Displays the full path and name of every file

                 on the disk.

                 On NTFS: Displays cleanup messages if any.

 /R              Locates bad sectors and recovers readable information

                 (implies /F).

 /L:size         NTFS only:  Changes the log file size to the specified number

                 of kilobytes.  If size is not specified, displays current

                 size.

 /X              Forces the volume to dismount first if necessary.

                 All opened handles to the volume would then be invalid

                 (implies /F).

 /I              NTFS only: Performs a less vigorous check of index entries.

 /C              NTFS only: Skips checking of cycles within the folder

                 structure.

The /I or /C switch reduces the amount of time required to run Chkdsk by

skipping certain checks of the volume.

I also looked up "chkdsk" in my 1,245-page copy of "Microsoft Windows XP Inside/Out" by Ed Bott and Carl Siechert published by Microsoft Press. It has a bit more detail but still does not document what chkdsk is actually doing (e.g. does it scan the disk sequentially?  or follow the filesystem? does it do a readonly test?  or read/write? etc etc etc).

Once the application finds the bad sectors and attempts to retrieve the data

I don't want it to attempt to retrieve the data.  On a disk with bad blocks this takes far too long.  

it marks them as "Used" so that the operating system no longer uses them.

how do you know this?  I could not find this documented anywhere.  You'll notice it says nothing about this when you type chkdsk /?  There's no mention of this in Bott & Siechart.



6 Professor

 • 

8.8K Posts

April 26th, 2013 17:00

As I stated in the original post:

Please, hold the suggestions about getting a new disk etc etc.  This is for cost-free reviving of serviceable old laptop computers to be used for non-critical tasks.

There's no such thing.

40 Posts

April 26th, 2013 18:00

There's no such thing.

Nonsense.

40 Posts

April 26th, 2013 18:00

.

OK, I found a Linux utility that does what I want (I think):  http://linux.die.net/man/8/badblocks

I just finished running it in readonly mode, and it took less than 45 minutes to scan a 100GB disk.

I am presently running it in non-destructive read/write mode.  It looks like it will take about twice as long.

Next step: run it on another machine with a disk with known errors and no reserve sectors, to see if I can find a nice contiguous section of the disk that is error-free.

.

6 Professor

 • 

8.8K Posts

April 26th, 2013 20:00

[quote user="rdunnill"]

There's no such thing.

Nonsense.

[/quote]

Large numbers of bad sectors indicate imminent failure. Use of a tool like 'chkdsk /r' to mask the symptoms won't fix the underlying problem, though.

chkdsk /R will find and note bad sectors to the operating system. I used it to prep a 1.5tb drive so that Acronis TrueImage would clone it; the operation took several hours (not days, hours), but the bad sectors were marked off-limits and a subsequent TrueImage clone operation succeeded. 200gb will go much faster, for obvious reasons.

Earlier this month, I spent two weeks fighting with a drive with multiple bad sectors. Every time a bad sector was accessed, the drive would shut down, and it had to have its power cycled to start up again. Ordinary tools like TrueImage, Window Backup and OSX 'dd' were useless; fortunately, there is a Linux-based tool called 'ddrescue' that can be stopped when the drive shuts down and restarted after the drive is brought back up, and it imaged the drive with only eight sectors lost. 'It was a lot of work, though, considering that a replacement 7200 RPM 750gb drive was only $75 with tax.  

40 Posts

April 26th, 2013 21:00

.

I suspect you have a fixed vision in your mind which does not correspond with my intended preparation and use of such a machine.

When I said "non-critical" I meant what I said.

Data loss is not an issue.  I said multiple times that I do not plan or want to try to recover data in lost sectors.

In my previous post I indicated I do not plan on using chkdsk /r because it doesn't do what I want.

I've successfully rescued old laptops before by judicious partitioning to select an area of the disk which is free of defects.  Those rescued machines are still in service.  If one craps out or starts misbehavin', it's no harm no foul.  Toss it and haul out another one.  I'm not gonna waste $75 on these machines.

I was simply looking for a more expeditious method of locating the areas where the bad sectors are.  I think the Linux tool "badblocks" is the answer.  I'm running it right now on an old laptop with known disk issues (no reserve sectors left according to S.M.A.R.T).  If I can find a nice 20GB section in the middle of an area free of bad sectors, that's what I'll use.

6 Professor

 • 

8.8K Posts

April 26th, 2013 21:00

Data loss is not an issue.  I said multiple times that I do not plan or want to try to recover data in lost sectors.

By data loss, I meant data can't be reliably written, i.e. as sectors go bad, they will take the files they are part of with them. For your purposes, it appears acceptable.

chkdsk /r will alert the operating system to bad sectors so they are bypassed by the OS and filesystem integrity is restored. Maybe it will try to recover data from bad sectors, but in the process it will mark them as bad. It's also reasonably timely: for example, yesterday, I used it on a corrupted 350gb partition and it was done within an hour. (Admittedly this was on a new 7200 750gb drive that had just been imaged to.)

 

 

40 Posts

April 27th, 2013 04:00

.

yesterday, I used it on a corrupted 350gb partition and it was done within an hour. (Admittedly this was on a new 7200 750gb drive that had just been imaged to.)

350GB in an hour?   It was obviously not doing a write/read test on all 350 GB.  Probably either just following the filesystem, or doing readonly, or both. That will not suffice for my purposes.

6 Professor

 • 

8.8K Posts

April 27th, 2013 08:00

New 7200 RPM SATA 6Gb/ps drives are fast. ddrescue will create a complete image in about four hours.

No Events found!

Top