+++ This bug was initially created as a clone of Bug #895006 +++ Created attachment 678138 [details] command "nftfsersize" result Description of problem: 1. When resize the ntfs filesystem, get the actually block count number is one less than expected. eg. filesystem size specified is 2147344384 bytes, which are 524254 blocks. But get 524253 blocks after resize 2."ntfsresize_opts" without option "size", it should resize to fit the container, but get the number of block count is not the origin's Version-Release number of selected component (if applicable): ><fs> version libguestfs: trace: version libguestfs: trace: version = <struct guestfs_version *> major: 1 minor: 16 release: 34 extra: rhel=6,release=2.el6 How reproducible: 100% Steps to Reproduce: 1. make ntfs filesystem and check block count ( total 524256 blocks) ><fs> mkfs ntfs /dev/vda1 libguestfs: trace: mkfs "ntfs" "/dev/vda1" libguestfs: trace: mkfs = 0 ><fs> mount /dev/vda1 / libguestfs: trace: mount "/dev/vda1" "/" libguestfs: trace: mount = 0 ><fs> statvfs / libguestfs: trace: statvfs "/" libguestfs: trace: statvfs = <struct guestfs_statvfs *> bsize: 4096 frsize: 4096 blocks: 524256 bfree: 521507 bavail: 521507 files: 2118796 ffree: 2118777 favail: 2118777 fsid: 0 flag: 4102 namemax: 255 2. resize file system (want 524254 blocks, so file system size if 4096 * 524254 = 2147344384) ><fs> umount / libguestfs: trace: umount "/" libguestfs: trace: umount = 0 ><fs> ntfsresize-opts /dev/vda1 size:2147344384 force:true libguestfs: trace: ntfsresize_opts "/dev/vda1" "size:2147344384" "force:true" libguestfs: trace: ntfsresize_opts = 0 3. check blocks again (actually, get 524253 blocks) ><fs> mount /dev/vda1 / libguestfs: trace: mount "/dev/vda1" "/" libguestfs: trace: mount = 0 ><fs> statvfs / libguestfs: trace: statvfs "/" libguestfs: trace: statvfs = <struct guestfs_statvfs *> bsize: 4096 frsize: 4096 blocks: 524253 bfree: 521504 bavail: 521504 files: 2118784 ffree: 2118765 favail: 2118765 fsid: 0 flag: 4102 namemax: 255 4. resize file system size to origin (omit "size" option) ><fs> umount / libguestfs: trace: umount "/" libguestfs: trace: umount = 0 ><fs> ntfsresize-opts /dev/vda1 force:true libguestfs: trace: ntfsresize_opts "/dev/vda1" "force:true" libguestfs: trace: ntfsresize_opts = 0 5. check blocks again (should be 524256 blocks, but get 524255 blocks) ><fs> mount /dev/vda1 / libguestfs: trace: mount "/dev/vda1" "/" libguestfs: trace: mount = 0 ><fs> statvfs / libguestfs: trace: statvfs "/" libguestfs: trace: statvfs = <struct guestfs_statvfs *> bsize: 4096 frsize: 4096 blocks: 524255 bfree: 521506 bavail: 521506 files: 2118792 ffree: 2118773 favail: 2118773 fsid: 0 flag: 4102 namemax: 255 Actual results: can't get the correct blocks which are expected Expected results: get the correct blocks which our specified Additional info: has the same issue with linux command "ntfsresize" (version from ntfsprogs-2.0.0-13.el6.x86_64.rpm) this log is attached --- Additional comment from RHEL Product and Program Management on 2013-01-14 04:54:06 EST --- Since this bug report was entered in bugzilla and this package is not scheduled to be updated in the current release, the release flag has been set to ? to ensure that it is properly evaluated for the next release.
Created attachment 684944 [details] ntfsresize reproducer script This is a self-contained test script. When run on Fedora 18: $ /tmp/ntfsresize.sh blocks: 25568 Resizing filesystem to 10000 blocks ... blocks: 9999 Resizing filesystem to original (full) size ... blocks: 25567 $ guestfish --version guestfish 1.20.1fedora=18,release=3.fc18,libvirt
I changed the script so it skips the middle resize-to-10000-blocks step: $ /tmp/ntfsresize.sh blocks: 25568 Resizing filesystem to original (full) size ... blocks: 25568 BTW if this is a bug then it is a bug in ntfs-3g.
Bug report sent upstream. We will have to retry with a more recent version of ntfs-3g.
Upstream report: http://sourceforge.net/mailarchive/message.php?msg_id=30383471 FWIW I get the same result with ntfs-3g 2013.1.13.
I got a good explanation of exactly what is going on here: http://sourceforge.net/mailarchive/message.php?msg_id=30440594 Essentially this is not a bug. The QA test will have to be adjusted to allow for the possibility of a small number of unused sectors.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.
Reopening because Virtualization Tools has not been discontinued.