Mark bad blocks as unusable on NTFS using linux
one of my laptops are using windows and after a certain impact it doesn't boots up anymore, I figured the disk might've been damaged. So I've launced live Kali linux and scanned it with badblocks (like in this article) and found ten thousand of them (bad blocks). Now, how can I mark those blocks as unusable, because it seems that fsck doesn't work on NTFS.
badblocks /dev/sda > ~/bad_blocks
Solution 1:
I'm afraid that won't help you get it to boot anyway. Most likely there are critical system files in those damaged blocks, and you cannot access those.
Your HD cannot be used anymore. The best you can do is to use ddrescue
or similar tool to make a complete copy of the hard disk or what can be accessed from it to a file on another hard disk, and then use data recovery software on that hard disk image file.
Solution 2:
I'm not aware of any publicly available Linux tool that supports this. It's in the plans for ntfsck
from ntfsprogs, the most advanced publicly available package for NTFS (see ntfsprogs\ntfsck.c
in its source), but that's about it. (You might be able to contract the developers to implement this for you. This isn't so hard technically, just time and effort.)
So, your best bet for now is to boot from a Windows live media (MS DaRT is the official one for repair tasks) and run chkdsk /r
.
I also succeeded in booting from a Linux Live CD, sharing the block device with Samba, then mounting and checking it over the network from a Windows machine with ImDisk.
Alternatively, How to unmark an NTFS cluster as bad? outlines how to do this by hand. Basically, it's editing NTFS metadata in a hex editor.