8

I want to extend a partition, but in between the partition and the un-allocated space, there is a large NTFS partition in which Windows is installed.

When I use GParted to try and move the NTFS partition to the end, it gives me an error saying that I have bad sectors and encourages me to run chkdsk. I did this, but the bad sectors remain.

It tells me to retry the resize with some sort of --badsectors flag, but I have no idea how to do it exactly.

What/where do I use that flag and how can I move re-size the partition if there are bad sectors?

Synetech
  • 68,243
  • 36
  • 223
  • 356
Haedrian
  • 243
  • 2
  • 4
  • 11
  • 4
    I might sound like and old granny, but if you have bad sectors and it is not an ancient drive then you need to check if your backups are up to date. Modern drives remap (and hide) bad sectors. The user should only notice bad sectors when the drive runs out of spares, and often it is close to dying at that point. – Hennes Jul 21 '12 at 14:11
  • I 100% agree with Hennes: just throw the drive because this is a dangerous situation. – Bertrand SCHITS Jul 21 '12 at 14:13
  • My backups are up to date. It's not a very old drive and I'm now using it as my 'clock is ticking' machine. I never noticed bad sectors up to now though to be honest. – Haedrian Jul 21 '12 at 14:39
  • I would clone the drive to a known good one if you are interested in keeping your data. – jmreicha Jul 23 '12 at 20:52
  • *“Clock is ticking machine”*? `o.O` – Synetech Jul 24 '12 at 05:43
  • @Synetech - I know its going to die some day, so I use it for tasks which, if it dies tomorrow, I won't be too badly effected. – Haedrian Jul 24 '12 at 16:30
  • 3
    “Clock is ticking machine”? - I think this means, "I'm waiting for it to completely and irrevocably die before I buy the next one." – Everett Jul 24 '12 at 16:32
  • 1
    Ah, I thought you were using it to [just display a clock](http://superuser.com/questions/265518/fullscreen-digital-clock-for-dos-6-22). – Synetech Jul 24 '12 at 16:34
  • @Haedrian - This is more for future readers. You wouldn't notice bad sectors unless it got so bad that Windows dectected your hdd was about to fail ( this happen to me ). – Ramhound Nov 29 '12 at 12:22

3 Answers3

4

The ntfsresize man page has the answer :

-b, --bad-sectors
    Support disks having hardware errors, bad sectors with those ntfsresize would refuse to work by default. 

The command you should use is :

ntfsresize -b --size <new-size> <hard-disk>

See this article for an example : Howto: Use ntfsresize+fdisk to resize a partition with bad sectors.

Another approach is to repair the bad sectors before moving. I have first-hand experience with SpinRite doing wonders (ailing laptop repaired and worked as new for 3 more years). Similar and newer is HDD Regenerator, but I have no personal experience with it. Both give a money-back guarantee (for what it's worth).

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • 1
    I don't want to change the size, I want to shift it. The problem is I'm wary of the risk of messing up my computer even more (and lets face it, resizing partitions is risky enough) – Haedrian Jul 24 '12 at 16:30
1

The NTFS file system has persisted a record of clusters containing bad sectors, which is why GParted can come to this conclusion so quickly without scanning the disk.

One solution is to force the drive to reallocate the bad sectors, and then make NTFS reevaluate the clusters containing them.

For example, if I have a Seagate drive I would:

  1. download Seatools for DOS (free), put it on a USB drive and let it scan and repair all bad sectors.
  2. run chkdsk with the /B flag to reevaluate all marked clusters. This ensures GParted will become aware of the repairs.
  3. the GParted operations should now succeed, provided all bad sectors inside the NTFS instance could be reallocated/repaired.
Andreas
  • 633
  • 10
  • 28
1

When you said you ran chkdsk did you run it with /F or /B switches?

/F   Fixes errors on the disk.
/R   Locates bad sectors and recovers readable information (implies /F).
/B   NTFS only: Re-evaluates bad clusters on the volume (implies /R)

I agree and +1 with harrymc in that you can try SpinRite to fix the badsectors. I have used it and it works great.

Good that your backups are up to date. Ultimately though, drives are cheap, and yours is dying. It will inevitably fail. Clone the drive on to a new one like Hennes, Bertrand SCHITS, jmreicha and others are advising.

I once read a paper released by some Google engineers titled Failure Trends in a Large Disk Drive Population on research they did on hard drives in their clusters/server farms and I think the take away from that report is basically that hard drives can and will fail at any point no matter the quality or cost of the drive or the conditions it is under. Scans are not definitive to predicting drive failure and HD SMART system is less than useful despite what marketing hype says. https://www.google.com/?q=google%20paper%20on%20hard%20drives

  • I ran it with f and b switches. Didn't solve my problem. The drive is in a laptop so I'm not really planning on removing it anytime soon - since the power connector is also damaged and something will die eventually. – Haedrian Jul 30 '12 at 15:49
  • Use spinrite, to mark the sectors as bad, and that should do it. – Anthony Hatzopoulos Jul 30 '12 at 17:58