I have upgraded to Windows 10 and during creating an image of the hard drive to back up, Windows 10 reported that the back up had failed, the reason was bad sectors. Can someone tell me how to repair bad sector on Windows 10? The drive I am checking is the main system drive".
Does it write the info to GPT/MBR or does it just store the info in a file somewhere? All I know is that the check is not capable of writing this info directly to HDD fw so it stores it somewhere else.
The way I see it, if you surface scan the drive, bad sectors get mapped and not used anymore, but if you for example use diskpart clean and reinstall the OS then all bad sector maps are gone (apart from the ones HDD firmware has stored) and OS install may get some system files into the bad sectors again. My main goal is to figure out how to map bad sectors prior to OS installation and drive re-partitioning. I image if the bad sector map is stored in GPT/MBR, then I could just use diskpart clean, then run chkdsk /r and install Windows after that - GPT/MBR should carry the sector map throughout installation. But that is assuming the map is stored where I think it is. Does anyone have any technical knowledge about the exact process on how bad sectors are mapped?
Although, the SMART of the disk will tell you the bad sectors and it is hardware related regardless of what OS you have. I am tagging a couple of people on this. Also bad sectors cannot be repaired so it is futile to try to move them as you will lose data on those sectors.
Thank you very much for your reply - yes I have read that topic before but found no info on whether the MBR/GPT gets overwritten during WIndows installation to the point where bad sector map is gone and a new disk surface check might be needed after the installation. The main goal here is to figure out how run a clean windows installation which would NOT write system files to damaged disk areas.
Thank you. So the conclusion is that there is no way to execute an OS installation with already mapped sectors and you must rely on HDD controller to catch and map everything? And probably write zeroes to the HDD prior to installation so that all pending sectors would get reallocated?
To answer your question, Windows does not store information on the bad sectors - the hard drive does all of this and the OS (whatever type) know nothing unless it asks the hard drive such as asking about the SMART values. There are programmes that can work on the disc more directly. In Linux you can use hdparm, etc. Here is one reference to it How to fix bad sectors or bad blocks on Hard Disk hiddenc0de and you can google for others.
Bad sectors usually belongs to clusters of storage space in the hard drive partition which appear to be defective. Under Windows systems bad sectors will not respond to any read or write requests. Majorly, two categories of Bad Sectors are available:
Interrupting chkdsk is not recommended. However, canceling or interrupting chkdsk should not leave the volume any more corrupt than it was before chkdsk was run. Running chkdsk again checks and should repair any remaining corruption on the volume.
If you choose to check the drive the next time you restart the computer, chkdsk checks the drive and corrects errors automatically when you restart the computer. If the drive partition is a boot partition, chkdsk automatically restarts the computer after it checks the drive.
You can also use the chkntfs /c command to schedule the volume to be checked the next time the computer is restarted. Use the fsutil dirty set command to set the volume's dirty bit (indicating corruption), so that Windows runs chkdsk when the computer is restarted.
You should use chkdsk occasionally on FAT and NTFS file systems to check for disk errors. Chkdsk examines disk space and disk use and provides a status report specific to each file system. The status report shows errors found in the file system. If you run chkdsk without the /f parameter on an active partition, it might report spurious errors because it cannot lock the drive.
Because repairs on FAT file systems usually change a disk's file allocation table and sometimes cause a loss of data, chkdsk might display a confirmation message similar to the following:
If you press Y, Windows saves each lost chain in the root directory as a file with a name in the format File.chk. When chkdsk finishes, you can check these files to see if they contain any data you need.
If you specify the /f parameter, chkdsk displays an error message if there are open files on the disk. If you do not specify the /f parameter and open files exist, chkdsk might report lost allocation units on the disk. This could happen if open files have not yet been recorded in the file allocation table. If chkdsk reports the loss of a large number of allocation units, consider repairing the disk.
Because the Shadow Copies for Shared Folders source volume cannot be locked while Shadow Copies for Shared Folders is enabled, running chkdsk against the source volume might report false errors or cause chkdsk to unexpectedly quit. You can, however, check shadow copies for errors by running chkdsk in Read-only mode (without parameters) to check the Shadow Copies for Shared Folders storage volume.
On servers that are infrequently restarted, you may want to use the chkntfs or the fsutil dirty query commands to determine whether the volume's dirty bit is already set before running chkdsk.
If it encounters errors, chkdsk pauses and displays messages. Chkdsk finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until chkdsk finishes.
To check for bad sectors check the SMART data, probably the best accessible by launching the Disks utility (Palimpsest). Even if you don't see any bad blocks there, launch a self-test to be sure.
Important note: If the output of badblocks is going to be fed to the e2fsck or mke2fs programs, it is important that the block size is properly specified, since the block numbers which are generated are very dependent on the block size in use by the filesystem. For this reason, it is strongly recommended that users not run badblocks directly, but rather use the -c option of the e2fsck and mke2fs programs.
Sometimes a storage medium simply refuses to work at all. It still appears as a block device to the kernel and in the disk manager, but its first sector holding the partition table is not readable. This can be verified easily with:
Devices that support it, can be queried about their health through S.M.A.R.T. or instructed to perform integrity self-tests of different thoroughness. This is generally the best option, but usually only available on (non-ancient) hard disk and solid state drives. Most removable flash media don't support it.
This operation can take a lot of time, especially if the storage drive actually is damaged. If the error count rises above zero, we'll know that there's a bad block. We can safely abort the operation at any moment (even forcefully like during a power failure), if we're not interested in the exact amount (and maybe location) of bad blocks. It's possible to abort automatically on error with the option -e 1.
Note for advanced usage: if we want to reuse the output for e2fsck, we need to set the block size (-b) to that of the contained file system. We can also tweak the amount of data (-c, in blocks) tested at once to improve throughput; 16 MiB should be alright for most devices.
Don't interrupt this operation forcefully! Ctrl+C (SIGINT/SIGTERM) and waiting for graceful premature termination is ok, but killall -9 badblocks (SIGKILL) isn't. Upon forceful termination badblocks cannot restore the original content of the currently tested block range and will leave it overwritten with junk data and possibly corrupt the file system.
As above, but without restoring the previous drive content after performing the write test, therefore it's a little faster. Since data is erased anyway, forceful termination remains without (additional) negative consequence.
The drive need to be unmounted when checked, so to check the root partition you need to create a file 'forcefsck' in the root of the partition and reboot. The device will be checked upon the next boot:
Certain disk problems would manifest as reported I/O errors. This is a bit nicer than dd due to the progress indicator and because the command-line interface is a bit more standard and a bit less typo-prone. Note that pv is basically and enhanced version of cat. It may not be installed by default, but can be installed with sudo apt-get install pv.
A similar approach is to read the disk with one of the several available tools that are specifically aware of disk I/O errors -- and have the feature of "trying hard to rescue data". Search for ddrescue in the package manager.
Kernel for Windows Data Recovery software is a one-stop solution to fix data loss due to bad sectors in Windows 10 (earlier & later versions also). Try the Demo version for free & view your lost files and folders instantly.
A bad sector is that section or space on a hard disc storage unit that is damaged permanently, so the entire information stored in that section or space is lost. It may occur due to physical or mechanical damage, manufacturing flaws/faults, wearing out, physical shock, sudden power cuts, invasion of dust, etc. These are discussed more in the following parts of this blog.
CHKDSK repairs soft bad sectors and marks hard bad sectors so they will not be used again. You get a report or information about the bad sector when you run disk checking. It implies that the bad sector should be the soft bad sector; it should be the bad hard sector, which is a more complex situation.
d3342ee215