Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just started gparted while one of my external hard drives is connected to my computer. Scanning for partitions as usual gparted starts hanging at /dev/sdg and I can hear that there is a lot of disk activity on my external hard disk.

This has been going on for a while now and I checked the process list, gparted started ntfsresize on my partition!

~> ps ax | grep ntfsresize
  701 pts/2    S+     0:00 grep ntfsresize
32758 pts/0    S+     0:00 sh -c ntfsresize --info --force --no-progress-bar /dev/sdg1
32759 pts/0    D+     0:04 ntfsresize --info --force --no-progress-bar /dev/sdg1

Why is it doing that without asking me first? Isn't that a potentially very harmful operation? How long is it going to take? It is a big partition and just wanted to check something, it already is taking quite some time and I don't see a way to interrupt the operation without causing a data loss.

EDIT: I found an older thread with a possible solution, but it seems to not apply in this case: http://crunchbanglinux.org/forums/topic/4059/gpartedntfsresize-issue/

My hard disk partition table:

/m/o/opt> sudo fdisk -lu /dev/sdg
Disk /dev/sdg: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd3a6d496

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1              63  1953520064   976760001    7  HPFS/NTFS/exFAT

And comparing what the thread suggest should be written to my hard disk with what already is there:

/m/o/opt>
echo 63 | awk '{printf("%c%c%c%c", $1%256,$1/256,$1/65536,$1/16777216)}' | hexdump -C
00000000  3f 00 00 00                                       |?...|
00000004

/m/o/opt> sudo dd bs=1 count=4 skip=28 if=/dev/sdg1 of=ntfs-reference
4+0 records in
4+0 records out
4 bytes (4 B) copied, 0.000196143 s, 20.4 kB/s
/m/o/opt> hexdump -C ntfs-reference 
00000000  3f 00 00 00                                       |?...|
00000004

So everything is already as suggested in the forum thread I found.

share|improve this question
    
It finished after a while and everything was fine. But it seems that gparted is running ntfsresize everytime it detects my partitions. Which means everytime I change something I have to wait for ~10 minutes for ntfsresize to finish (only when I have my external hard disks connected of course, if I disconnect them first I have no problem). –  rakete Aug 6 '12 at 10:35
add comment

1 Answer

I'd say it is just checking the filesystem out to see the limit of it's ability to shrink.

  • from the ntfsresize manual

    -i, --info By using this option ntfsresize will determine the theoretically smallest shrunken filesystem size supported. Most of the time the result is the space already used on the filesystem. Ntfsresize will refuse shrinking to a smaller size than what you got by this option and depending on several factors it might be unable to shrink very close to this theoretical size. Although the integrity of your data should be never in risk, it's still strongly recommended to make a test run by using the --no-action option before real resizing. Practically the smallest shrunken size generally is at around "used space" + (20-200 MB). Please also take into account that Windows might need about 50-100 MB free space left to boot safely.

    This option never causes any changes to the filesystem, the partition is opened read-only.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.