4

I have a Dell laptop that came with Windows from the factory. Since then, I have installed Linux and replaced the hard drive with an SSD. The NTFS partition is inconsistent (a result of bad sectors on the HDD) and needs to be fixed, but I cannot boot into Windows to run chkdsk.

How do I fix this problem? Until I do, I cannot move my NTFS partition to expand space on my root filesystem, which is critically low.

EDIT:

All of my partitions were cloned from my dying HDD to my SSD via Clonezilla. There are no bad sectors on the SSD, but the NTFS partition is still in an inconsistent state.

4
  • I think my answer over here could explain it: superuser.com/questions/665214/…
    – Rudolph
    Commented Oct 31, 2013 at 16:31
  • 1
    Is deleting and recreating the NTFS partition with mkfs.ntfs an option? -- Alsom Rudolph has a good point about reliability. A HDD which shows bad sectors is a very bad sign. Make sure that you have backups.
    – Hennes
    Commented Oct 31, 2013 at 16:32
  • 1
    I read the question as saying that the hard disk with bad sectors is no longer in use, but damage from the bad sectors persists on the NTFS volume that's been copied to the SSD. If this reading is incorrect, then I definitely agree with Hennes. A disk with bad sectors is like a slice of bread with mold; the problem will only get worse with time.
    – Rod Smith
    Commented Nov 1, 2013 at 16:53
  • Update: I managed to boot into Windows and run chkdsk. My partition now works.
    – Demi
    Commented Nov 4, 2013 at 17:20

2 Answers 2

3

If the computer has nothing but Linux, you should not be using NTFS. There are no good Linux tools for repairing NTFS damage. (The Linux ntfsfix tool just does some very basic checks and then flags the filesystem as needing more attention from Windows.) Thus, in the long term your goal should be to switch from NTFS to a Linux-native filesystem. In the short term, you should use a Windows emergency disk to repair the filesystem. (Such emergency disks are widely available, but I don't happen to have any URLs handy. Maybe you can find one by searching Microsoft's site.) It's conceivable that you could use ntfsclone to make a backup, too; see the --rescue option in its man page. I've never tried this, though.

Overall, I'd say you should do the following:

  1. Use a Windows emergency disc, ntfsclone, or any other tool necessary to gain access to the partition.
  2. Copy the files from that partition to another disk. You can do this in either Linux or Windows, depending on what's convenient and how you got access to the disk.
  3. Create a Linux-native filesystem (ext2/3/4fs, ReiserFS, XFS, JFS, or maybe even Btrfs) on the partition.
  4. Copy the files back to the original (but freshly-prepared) partition.
8
  • 2.5. Overwrite the whole partition with bad blocks with something (e.g. dd if=/dev/zero of=... bs=1M or at last dd bs=4K). That will fix the bad blocks if the HDD still has internal physical reserve blocks available. If not, do not use that drive to store any data you want to keep. The smartctl -x may allow checking the remapped sector count. Commented Aug 31, 2015 at 5:19
  • I missed the reference to bad blocks in the original post. The original disk should be thrown away; any disk with bad blocks is unreliable. Such problems tend to get worse with time. Thus, step 2.5 should be "Buy a new disk." The suggestion of using dd to zero it out will be a temporary band-aid, at best; it will cause the disk to map out the current set of bad blocks, but such problems tend to get worse, so the problem is almost certain to recur.
    – Rod Smith
    Commented Aug 31, 2015 at 13:09
  • It's possible that a disk contains one or two bad blocks because of manufacturing errors. In that case the disk is okay and remapping is the correct fix. This is no different from an LCD display with a dead pixel. However, I do agree that if new bad blocks appear after using the disk, it should be thrown away. Commented Sep 1, 2015 at 8:17
  • All modern disks automatically map out bad blocks, up to some predetermined limit (the number of sectors set aside for this purpose). Thus, "one or two" bad blocks won't even show up. If you're seeing bad blocks, you've exceeded the design limits of the disk and have many more bad blocks than that. Such a disk should be thrown away. The only times I've seen bad blocks appear on disks, the entire disk has become completely useless in somewhere between hours and a few months.
    – Rod Smith
    Commented Sep 1, 2015 at 13:01
  • 1
    I understand what you're saying, Mikko; but in my experience, I've had bad blocks show up from time to time on disks I've used, and be remapped. EVERY TIME I've noticed such problems, the disk has been COMPLETELY DEAD in 6 months or less. IN MY EXPERIENCE, trying to recover a disk once you notice bad blocks is a hopeless and dangerous endeavor.
    – Rod Smith
    Commented Sep 3, 2015 at 12:30
0

ntfsresize has a specific option --bad-sectors for this situation, see man ntfsresize

1
  • Tried that. no luck.
    – Demi
    Commented Oct 31, 2013 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .