9

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
  • 69,547
Haedrian
  • 263

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
  • 498,455
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
  • 674
  • 3
  • 11
  • 33
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