[Bug 956762] Re: ntfsresize prompts ( on non tty ) and refuses to resize dirty volume
Phillip Susi
psusi at ubuntu.com
Fri Mar 16 14:49:27 UTC 2012
** Description changed:
- when i try to resize my ntfs partitions(no matter run it with
- '11.10'liveCD or a installed Ubuntu'11.10'), though it has already did
- it, it would informed that something is wrong, the opreation i called
- failed. then i read the details i got it like this:
+ 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.
- GParted 0.8.1 --enable-libparted-dmraid
+ Reproduction:
- Libparted 2.3
- Shrink /dev/sda2 from 230.09 GiB to 220.09 GiB 00:02:56 ( ERROR )
-
- calibrate /dev/sda2 00:00:00 ( SUCCESS )
-
- path: /dev/sda2
- start: 100667392
- end: 583192575
- size: 482525184 (230.09 GiB)
- check file system on /dev/sda2 for errors and (if possible) fix them 00:00:05 ( SUCCESS )
-
- ntfsresize -P -i -f -v /dev/sda2
-
+ 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/sda2
+ Device name : /dev/devserv/ntfs
NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 247052890624 bytes (247053 MB)
- Current device size: 247052894208 bytes (247053 MB)
- Checking for bad sectors ...
+ 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 : 197811 MB (80.1%)
+ Space in use : 28 MB (0.5%)
Collecting resizing constraints ...
- Estimating smallest shrunken size supported ...
- File feature Last used at By inode
- $MFT : 150973 MB 0
- Multi-Record : 233248 MB 41457
- $MFTMirr : 107091 MB 1
- Compressed : 26932 MB 46
- Sparse : 242761 MB 2345
- Ordinary : 247037 MB 39621
- You might resize at 197810511872 bytes or 197811 MB (freeing 49242 MB).
- Please make a test run using both the -n and -s options before real resizing!
- shrink file system 00:02:34 ( SUCCESS )
-
- run simulation 00:00:07 ( SUCCESS )
-
- ntfsresize -P --force /dev/sda2 -s 236316524543 --no-action
-
- ntfsresize v2011.4.12AR.4 (libntfs-3g)
- Device name : /dev/sda2
- NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 247052890624 bytes (247053 MB)
- Current device size: 247052894208 bytes (247053 MB)
- New volume size : 236316516864 bytes (236317 MB)
- Checking filesystem consistency ...
- Accounting clusters ...
- Space in use : 197811 MB (80.1%)
- Collecting resizing constraints ...
- Needed relocations : 994117 (4072 MB)
- Schedule chkdsk for NTFS consistency check at Windows boot time ...
- Resetting $LogFile ... (this might take a while)
- Relocating needed data ...
- Updating $BadClust file ...
- Updating $Bitmap file ...
- Updating Boot record ...
- The read-only test run ended successfully.
- real resize 00:02:27 ( SUCCESS )
-
- ntfsresize -P --force /dev/sda2 -s 236316524543
-
- ntfsresize v2011.4.12AR.4 (libntfs-3g)
- Device name : /dev/sda2
- NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 247052890624 bytes (247053 MB)
- Current device size: 247052894208 bytes (247053 MB)
- New volume size : 236316516864 bytes (236317 MB)
- Checking filesystem consistency ...
- Accounting clusters ...
- Space in use : 197811 MB (80.1%)
- Collecting resizing constraints ...
- Needed relocations : 994117 (4072 MB)
- Schedule chkdsk for NTFS consistency check at Windows boot time ...
- Resetting $LogFile ... (this might take a while)
- Relocating needed data ...
- Updating $BadClust file ...
- Updating $Bitmap file ...
- Updating Boot record ...
- Syncing device ...
- Successfully resized NTFS on device '/dev/sda2'.
- You can go on to shrink the device for example with Linux fdisk.
- IMPORTANT: When recreating the partition, make sure that you
- 1) create it at the same disk sector (use sector as the unit!)
- 2) create it with the same partition type (usually 7, HPFS/NTFS)
- 3) do not make it smaller than the new NTFS filesystem size
- 4) set the bootable flag for the partition if it existed before
- Otherwise you won't be able to access NTFS or can't boot from the disk!
- If you make a mistake and don't have a partition table backup then you
- can recover the partition table by TestDisk or Parted's rescue mode.
- shrink partition from 230.09 GiB to 220.09 GiB 00:00:01 ( SUCCESS )
-
- old start: 100667392
- old end: 583192575
- old size: 482525184 (230.09 GiB)
- new start: 100667392
- new end: 562223103
- new size: 461555712 (220.09 GiB)
- check file system on /dev/sda2 for errors and (if possible) fix them 00:00:05 ( SUCCESS )
-
- ntfsresize -P -i -f -v /dev/sda2
-
- ntfsresize v2011.4.12AR.4 (libntfs-3g)
- Device name : /dev/sda2
- NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 236316516864 bytes (236317 MB)
- Current device size: 236316524544 bytes (236317 MB)
- Checking for bad sectors ...
- Checking filesystem consistency ...
- Accounting clusters ...
- Space in use : 197811 MB (83.7%)
- Collecting resizing constraints ...
- Estimating smallest shrunken size supported ...
- File feature Last used at By inode
- $MFT : 150973 MB 0
- Multi-Record : 233248 MB 41457
- $MFTMirr : 107091 MB 1
- Compressed : 26932 MB 46
- Sparse : 201975 MB 2345
- Ordinary : 236317 MB 40823
- You might resize at 197810184192 bytes or 197811 MB (freeing 38506 MB).
- Please make a test run using both the -n and -s options before real resizing!
- grow file system to fill the partition 00:00:11 ( ERROR )
-
- run simulation 00:00:06 ( SUCCESS )
-
- ntfsresize -P --force /dev/sda2 --no-action
-
- ntfsresize v2011.4.12AR.4 (libntfs-3g)
- Device name : /dev/sda2
- NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 236316516864 bytes (236317 MB)
- Current device size: 236316524544 bytes (236317 MB)
- New volume size : 236316520960 bytes (236317 MB)
- Checking filesystem consistency ...
- Accounting clusters ...
- Space in use : 197811 MB (83.7%)
- Collecting resizing constraints ...
- Schedule chkdsk for NTFS consistency check at Windows boot time ...
- Resetting $LogFile ... (this might take a while)
- Updating $BadClust file ...
- Updating $Bitmap file ...
- Updating Boot record ...
- The read-only test run ended successfully.
- real resize 00:00:05 ( ERROR )
-
- ntfsresize -P --force /dev/sda2
-
- ntfsresize v2011.4.12AR.4 (libntfs-3g)
- Device name : /dev/sda2
- NTFS volume version: 3.1
- Cluster size : 4096 bytes
- Current volume size: 236316516864 bytes (236317 MB)
- Current device size: 236316524544 bytes (236317 MB)
- New volume size : 236316520960 bytes (236317 MB)
- Checking filesystem consistency ...
- Accounting clusters ...
- Space in use : 197811 MB (83.7%)
- 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.
-
- ========================================
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gparted in Ubuntu.
https://bugs.launchpad.net/bugs/956762
Title:
ntfsresize prompts ( on non tty ) and refuses to resize dirty volume
Status in “gparted” package in Ubuntu:
New
Status in “ntfs-3g” package in Ubuntu:
New
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/956762/+subscriptions
More information about the foundations-bugs
mailing list