3

I'm unable to shrink Windows partition using gparted live CD.

The partition filesystem is NTFS. Windows 7 is on it and boots fine.

Gparted information dialog gives the following:

  • Status - unmounted
  • ERROR - the disk has at least 19 bad sectors
  • Run chkdsk /f /r on Windows and reboot it TWICE! Then you can resize NTFS safely by additionally using the --bad-sectors option of ntfsresize
  • The cause might be a missing software package. The following list of software packages is required for ntfs file system support: ntfsprogs / ntfs-3g.

I've scanned for disk errors and rebooted twice as suggested above.

How do I get rid of this red exclamation mark? (The red exclamation mark looks like this).

Thanks in advance.

polarbear347
  • 99
  • 2
  • 9
  • 4
    You can try booting to windows, run ckkdsk, and try resizing with the windows tools. – Panther Mar 04 '14 at 15:57
  • Or chkdsk /f /r - or whatever the error message says. There is a guide here that might be helpful. – Wilf Mar 04 '14 at 16:11
  • 1
    I can only add a +1 to @bodhi.zazen advice. Resize the NTFS partition using Windows tools; doing differently may work but it might not... have a good, tested backup ready. (Especially with bad blocks warnings). – Rmano Mar 04 '14 at 16:11
  • Before posting my question, I did run disk error checker by GUI method as suggested by Wilf. That did not help, then I booted with Windows 7 DVD. At the command prompt typed d: and I could see my directories by "dir". I then did "chkdsk /f" and later "chkdsk /r"; Both commands said something like "No errors were found".

    Windows tools for resizing partitions is unfamiliar territory to me, but I'll look into that. Thank you all for responding to my question.

    – polarbear347 Mar 04 '14 at 17:29
  • @bodhi.zazen Your proposed solution does work. However, Windows resizing tool is limiting on how much I can shrink the partition. I could only shrink 5GB out of 17GB free space available. – polarbear347 Mar 05 '14 at 14:57
  • I've spent some time trying to recreate this problem. It turned out that the red exclamation mark on Gparted first appeared after running "chkdsk /r". Gparted showed no exclamation mark prior to running "chkdsk /r". FYI: "chkdsk /r" returned the following message upon its completion: "Adding 4 bad clusters to the Bad Clusters File. Correcting errors in the Volume Bitmap. Windows has made corrections to the file system."

    Is there a Windows command to undo what "chkdsk /r" has done above?

    – polarbear347 Mar 05 '14 at 15:04

3 Answers3

4

The advice it gives is incorrect. ntfsresize ( which gparted uses ) refuses to resize a volume that has flagged any clusters as bad. Running chkdsk /b from Windows will test the blocks marked as bad and hopefully clear them, allowing you to proceed. If not, then you may need to replace the disk. In any case, you should open the disk utility and check the SMART health of the disk.

psusi
  • 37,551
  • "chkdsk /b" finished with the following remark: "Windows has made corrections to the file system" The problem isn't solve though.

    Ubuntu's disk-utility said the disk has 7 bad sectors.

    – polarbear347 Mar 04 '14 at 17:33
0

You can try booting to windows, run ckkdsk, and try resizing with the Windows tools.

Keep in mind:

First, the Linux tools are reverse engineered and there at times with they can not manage / repair NTFS partitions. On such occasions you will need to fall back to the Windows tools.

Second, yes there are times when the Windows resize tool limits how much you can reduce the size of your NTFS volumes. I am not familiar enough to know why, but I suspect there are files scattered on the disk that for some reason are not movable by the Windows tools. In such an event, you can repair the NTFS partition, defragment as much possible, and then boot Ubuntu and re-try gparted

Third, data loss or hard drive failure can happen with these tools. I suggest you have a Windows recovery disk and a back up of your data.

Carolus
  • 587
Panther
  • 102,067
0

I've managed to get gparted to shrink the NTFS partition despite bad-sectors on disk using the trick found here.

Please make sure to do a backup of everything on your disk before attempting this!

I placed the disk as a slave drive on another PC that has Ubuntu and booted into Ubuntu.

cd /sbin
sudo mv ntfsresize ntfsresize.orig
sudo touch ntfsresize
sudo vim ntfsresize

and put the following in "ntfsresize":

#!/bin/bash  
exec ntfsresize.orig --bad-sectors "$@"

Then

sudo chmod 777 ntfsresize

I was then able to resize with gparted in Ubuntu without any problems.

polarbear347
  • 99
  • 2
  • 9