Topic: GParted/ntfsresize issue

I resized a NTFS partition using Gparted a few days ago and now it's causing GParted to hang.

If the partition is mounted there are no problems but if it's not then GParted runs ntfsresize on it to get some basic info. This causes the hang.

Specifically it runs the command:

ntfsresize --info --force --no-progress-bar /dev/sdax

where x is the partition number, preface with sudo.

Could anyone with any NTFS partitions let me know how long this command takes to run? With my 280GB partition it churns away for six minutes every time I run it.

Does anybody think I should just delete the partition and start again? Should I stick to Windows tools for resizing NTFS partitions?

Just for general info, this is the output from the command:

ntfsresize v2.0.0 (libntfs 10:0:0)
Device name        : /dev/sda8
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 300041724416 bytes (300042 MB)
Current device size: 300041731584 bytes (300042 MB)
Checking filesystem consistency ...
Accounting clusters ...
Space in use       : 137236 MB (45.7%)
Collecting resizing constraints ...
You might resize at 137235582976 bytes or 137236 MB (freeing 162806 MB).
Please make a test run using both the -n and -s options before real resizing!

Re: GParted/ntfsresize issue

Did you move the partition?  Or dd/clone it?  If so, the NTFS boot sector very usefully (not) includes a reference to it's own location on disk, which you need to update:

fdisk -lu /dev/<disk-name>
echo <partition starting sector> |awk '{printf("%c%c%c%c",$1%256,$1/256,$1/65536,$1/16777216)}'|dd bs=1 count=4 seek=28 of=/dev/<partition-name>

I seem to remember some things ignore this value, and some things bork if it's wrong.

Last edited by jackbang (2009-08-12 10:50:53)

Re: GParted/ntfsresize issue

Thanks jackbang. This seems a little bit beyond me but I might be wiping this disk anyway so may as well try anything.

I guess <disk-name> = sda, <partition-name> = sda8, but how do I find <partition starting sector>?

Oh I tried the ntfsresize command on a USB HDD, 320GB NTFS partition (primary taking up the whole space) > took 2.5 minutes.

Re: GParted/ntfsresize issue

Correct.  the output from fdisk -lu /dev/sda will be something like:

/dev/sda1   *          63    18426554     9213246    7  HPFS/NTFS
/dev/sda2        40564125    78140159    18788017+  83  Linux

The first number column shows the starting sector of the partition, so on mine, 63 for /dev/sda1 and 40564125 for /dev/sda2.

If you only resized to the beginning, then this may not be your problem, as the start sector won't have changed.

Re: GParted/ntfsresize issue

When I resized my (ntfs) windows install, I had to leave it on overnight. It may because it has to move how ever many GB's of files you have.

Re: GParted/ntfsresize issue

The resize didn't take so long. The issue is the length of time taken by the above command.