EzDevInfo.com

bad-sectors interview questions

Top bad-sectors frequently asked interview questions

Full physical hd check

I would like to run a full, sector-by-sector, physical check on some external hard drives. As far as I know,chkdsk does not supply this option.

Is there a workaround under chkdsk, or a good replacement? I'm using Windows 7 on this machine, but Linux solutions applicable from a live CD are also welcome.

Thanks,

Adam Matan


Source: (StackOverflow)

External Hard Drive bad sectors recover/mark utility in linux

I've just installed the new version of Ubuntu, Karmic Koala, in my laptop. Everything is fine, except for the fact the system identified about 300 bad sectors in my 1TB external hard drive. I'd like to recover or just mark then. Is there any free utility, that I can run on Linux, to accomplish this?

Update:

The partition is formatted in NTFS.

Thanks in advance


Source: (StackOverflow)

Advertisements

How do I determine what file occupies a given sector in Linux?

In Linux, I'd like to know how to find the file(s) if any which as using a particular sector on the hard drive (ext2/3). There is a similar question here regarding Windows, however I need a Linux command line solution (this is a headless system).


Source: (StackOverflow)

How do I determine what file occupies a given sector?

I have a hard drive with 3 bad sectors. I know the sector numbers and the computer can still boot into Windows. I want to run sector repair from an HDD diagnostics tool from the manufacturer, but before I do that, I'd like to know what files are affected. Is there a way to figure out what file or files are occupying those sectors?


Source: (StackOverflow)

How to force a remap of sectors reported in S.M.A.R.T C5 (Current Pending Sector Count)?

The S.M.A.R.T C5 value of my Samsung HM640JJ Hard Drive (in an HP Pavilion dv6 laptop) is "yellow status = caution"

C5 was 10 yesterday, and it's 21 today.

C4 (Reallocation Event Count) = 0 and 05 (Reallocated Sectors Count) = 0

How can I force the firmware to reallocate them?

  • I removed the partitions, recreated them again and formatted the entire drive.
  • I ran chkdsk /r /f
  • I ran the BIOS disk check utility and other diagnose/repair tools

Source: (StackOverflow)

Fix bad blocks on Mac hard disk

I have a hard disk that I scanned with TechTool and it reports one bad block. As far as I can tell, TechTool only scans and reports a failure. It doesn't fix anything.

Back in the day, Norton Disk Doctor did the job of scanning and flagging (remapping) bad blocks on the Mac. Today we have various tools for fixing up HFS+ directory errors (Disk Utility, fsck, DiskWarrior, TechTool), but I don't know of any tool that will do a surface scan and fix the bad blocks too.

What software is available for this?

If I know the address of the bad block, is there a low-level terminal utility for marking it?


Source: (StackOverflow)

How to erase a hard drive with unwritable sectors?

So I have a hard drive that is failing. I want to erase the data on it before sending it for replacement. I'm trying to use dd if=/dev/zero of=/dev/sdXX, but it stops at the first write error. How can I overwrite the drive with zeros, ignoring write errors? conv=noerror seems to only affect the input file.


Source: (StackOverflow)

Unable to Write Zeros to Bad Sectors/Hard Disk Not Counting Reallocated Sectors

I have a drive that is reporting that the current pending sectors is "45". I have used badblocks to identify the sectors and I have been trying to write zeros to them with dd.

From what I understand, when I attempt writing data directly to the bad sectors, it should trigger a reallocation, reducing current pending sectors by one and increasing the reallocated sector count.

However, on this disk both Reallocated_Sector_Ct and Reallocated_Event_Count raw values are 0, and dd fails with I/O errors when I attempt to write zeros to the bad sectors. dd works fine, however, when I write to a good sector.

# dd if=/dev/zero of=/dev/sdb bs=512 count=1 seek=217152
dd: error writing ‘/dev/sdb’: Input/output error

Does this mean that my drive, in some way, has no spare sectors to be used for reallocation? Is my drive just in general a terrible person? (The drive isn't actually mine, I'm helping a friend out. They might have just gotten a cheap drive or something.)

In case it is relevant, here is the output of smartctl -i :

Model Family:     Western Digital Caviar Green (AF)
Device Model:     WDC WD15EARS-00Z5B1
Serial Number:    WD-WMAVU3027748
LU WWN Device Id: 5 0014ee 25998d213
Firmware Version: 80.00A80
User Capacity:    1,500,301,910,016 bytes [1.50 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Fri Oct 18 17:47:29 2013 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

UPDATE:
I have run shred on the disk, which has caused Current_Pending_Sector to go to zero. However, Reallocated_Sector_Ct and Reallocated_Event_Count are still zero, and dd is now able to write data to the sectors it was previously unable to. This leads me with several other questions:

  • Why aren't the reallocations being recored by the disk? I'm assuming the reallocation took place as I can now write data directly to the sector and couldn't before.

  • Why did shred cause reallocation and not dd? Does the fact that shred writes random data instead of just zeros make a difference?


Source: (StackOverflow)

Does cloning a hard drive also copy over errors like bad sectors?

For example, I have Windows 7 on a hard drive where SMART reports "many bad sectors". If I buy a new hard drive, and attempt to clone over Windows to the new hard drive, will that fix the problem so I have Windows on a clean hard drive, or will that also copy over the bad sectors and so therefore SMART will find errors on the new hard drive?

My guess is that bad sectors aren't propagated during a clone process, but I could be wrong, so I wanted your opinion. THanks!

EDIT: Actually, I copied windows to a new hard drive, and the new hard drive has the bad sectors. So my question is a bit backwards, but you get the idea. :)

Based on the answers: cloning from a clean drive to a bad-sector drive is fine, data-wise. From a bad-sector drive to a clean drive is also fine. And, the cloning process itself won't destroy any data. The only thing to worry about is if data was lost when the original drive acquired bad sectors.


Source: (StackOverflow)

Fixing bad sectors

My SATA HDD (Hitachi DeskStar 7K160) seems to have 1 bad sector. Is it possible to try to fix it? I checked Hitachi's drive tools and all of them are diagnostic tools, so I don't know how much help they will be.

I can buy a new drive but first I really want to try to fix it since I don't want the hassle to setup Windows 7 & Ubuntu again (both are on this disk).

hdBadSector


Source: (StackOverflow)

Hard Drive Bad Sector marking utility [closed]

I already have Windows XP, During installing Ubuntu(dual boot) the disk drive just stuck up at one place and doesn't seem to move ahead..
Is there a disk bad sector mark utility that just marks these sectors so that the disk doesn't seek them later.
I tried running Seagate Seatools on the drive but both the short test and long test fail even before they start even chkdsk /f/r doesn't seem to work as the system locks up at stage four.


Source: (StackOverflow)

How can I generate a list of files from a list of sectors?

I've had a hard disk failure and managed to rescue some data from the disk (1TB) with GNU's ddrescue. The last 800GB of the disk were perfect, no single error, but in the first 200GB there were almost 14000 errors (badblocks) spread across the area. ddrescue creates a logfile that describes where the badblocks are.

ddrescues command line params:

ddrescue /dev/sdb /dev/sdd /mnt/sdc1/sdb.log -r -1 -f -d -v

The logfile looks like this:

#      pos        size  status
0x00000000  0x1C08CE00  +
0x1C08CE00  0x00000200  -
0x1C08D000  0x011E6800  +
0x1D273800  0x00000200  -
0x1D273A00  0x005EC000  +
0x1D85FA00  0x00000200  -
...         ...         ...

The plus (+) means contiguous good space, the minus (-) unreadable space; position and size are in hexadecimal. Striping the lines ending in '+' I have a list whith badblock positions, but I need a way to correlate this badblocks to files on the File System, which is, by the way, NTFS.

I know that I can use something like DiskExplorer to do this manually, but it would be the hell with 14000 sectors. So, there is a more or less automatic and elegant way of doing this ?


Source: (StackOverflow)

How to *quickly* get a list of files that have bad sectors/blocks/clusters/whatever?

My wife's Windows 7 (64-bit) box has suddenly developed a SMART "disk is bad" status. I'm attempting to copy everything off (no admonishments about lacking a backup regimen, please, I know already :( ) by creating a System Image across the network to a different machine, but it gets to a certain point and starts taking forever. Doing a chkdsk reveals that certain files cause this by having many bad blocks (like dozens of thousands in a row, if the event log is any indication) and causing the system to do its standard try-to-recover-and-relocate-upon-access thing.

But this is taking so long, I'm afraid the disk will fail completely before I can get the damned thing copied. However, several of the files so far have been ones that she has copies of elsewhere, so I am able to just delete them prior to retrying the backup to speed things up considerably.

So: is there some tool or procedure that will try reading each file, and upon hitting a bad block, just tell me about it and skip to the next file? So I can see which ones I can just dump and which I need to let it try to recover?


Source: (StackOverflow)

Finding the file that is on a bad block on a HFS+ volume (debugfs for HFS+)

I have a drive in our iMac that has bad blocks, as booting from an Ubuntu 11.10 live CD and using ddrescue -f /dev/sda /dev/null finds them. I'd like to get the drive to remap them by writing to the blocks, say using hdparm --write-sector, but I don't want to do this without knowing what's in those blocks and finding the file that owns them, so I can restore the file from another source.

I found fileXray but don't feel like spending $79 to map a block to a file and hfsdebug has been taken offline. Are there suggestions on a tool or technique to use?

I looked at all the Ubuntu HFS+ packages to see if they could provide this info but nothing jumped out at me.

BTW, I used Disk Utility to erase the empty space, but it didn't get any of the bad blocks to be remapped, according to smartctl -A.


Source: (StackOverflow)