ntfsresize prompts ( on non tty ) and refuses to resize dirty volume

Bug #956762 reported by ljs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ntfs-3g
Fix Released
Medium
gparted (Ubuntu)
Fix Released
Undecided
Unassigned
ntfs-3g (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

ntfsresize prints a warning and prompts for input whether it should proceed or not in response to the dirty volume flag. When stdin is connected to /dev/null, it refuses to proceed. Interactive prompts should not be made when stdin is not a tty. The --force flag should also cause the resize to proceed.

Reproduction:

mkfs.ntfs -f /dev/vg/ntfs
ntfsfix /dev/vg/ntfs
ntfsresize -P --force -s 1G /dev/vg/ntfs < /dev/null

ntfsresize v2011.4.12AR.4 (libntfs-3g)
Device name : /dev/devserv/ntfs
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 5368705536 bytes (5369 MB)
Current device size: 5368709120 bytes (5369 MB)
New volume size : 999993856 bytes (1000 MB)
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 28 MB (0.5%)
Collecting resizing constraints ...
Needed relocations : 6554 (27 MB)
WARNING: Every sanity check passed and only the dangerous operations left.
Make sure that important data has been backed up! Power outage or computer
crash may result major data loss!
Are you sure you want to proceed (y/[n])? OK quitting. NO CHANGES have been made to your NTFS volume.

Revision history for this message
Phillip Susi (psusi) wrote :

In the future, please attach log files instead of pasting them into the description.

Revision history for this message
Phillip Susi (psusi) wrote :

It looks like this is a bug in ntfs-3g. ntfsresize is prompting if it is ok to proceed, but since its stdin is connected to /dev/null, it refuses to proceed. ntfsresize should not be attempting an interactive prompt when it is not connected to a tty, and I'm not sure why it is prompting in the first place. It looks like it is caused by the dirty volume flag since it does not prompt the first time it is run on a clean volume, then does prompt when run again ( because the first run set the dirty flag ).

summary: - gparted-partition-manager has a bad default action
+ ntfsresize prompts ( on non tty ) and refuses to resize dirty volume
Phillip Susi (psusi)
description: updated
Revision history for this message
Jean-Pierre (jean-pierre-andre) wrote :

This was fixed in ntfs-3g-2011.4.12AR.6
On buggy versions you may avoid the bug by using option -f twice : ntfsresize -ff.

Revision history for this message
Phillip Susi (psusi) wrote :

Well then, it looks like this has been fixed in Precise.

Changed in ntfs-3g (Ubuntu):
status: New → Fix Released
Changed in gparted (Ubuntu):
status: New → Fix Released
Revision history for this message
Curtis Gedak (gedakc) wrote :

This problem was resolved in GParted 0.9.1.

The relevant upstream bug report is:

Bug 655215 - NTFS partition resize fails
https://bugzilla.gnome.org/show_bug.cgi?id=655215

Changed in ntfs-3g:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.