Topic: Another NTFS volume size issue with possible resolution
Hi,
I, too, have encountered the problem where the ntfs partition is
the larger than the partition. And have made some small
investigations in limited time.
System.
Slackware 12.2.
Linux 2.6.31.5 kernel. Linus' main tree, with only this security
patch to fs/pipe.c
http://git.kernel.org/?p=linux/kernel/g … 0a8cc4466c
Custom kernel config.
Gparted 0.5.0 - no patches or updates.
Parted 1.9.0 - different patch sets (see below).
Running with parted 1.9.0 and only the patch you suggest making here:
http://git.debian.org/?p=parted/parted. … 0b1e7390ce
ad25892bb995f61b0ddf801ed1f74e0b1e7390ce
I got the error where the ntfs file system is bigger than the
partition. Restoring the partition to its old size (with a saved
sfdisk output file) made the ntfs data accessible again.
Experimenting now, after shrinking a disk from 100GB to around
14GB, then resizing to 100MB, I'm left with a 100GB partition but
a 14GB ntfs file system.
# ntfsresize -i -f -n /dev/sdd1
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdd1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 14608060928 bytes (14609 MB)
Current device size: 100027597824 bytes (100028 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 14606 MB (100.0%)
Collecting resizing constraints ...
You might resize at 14605754368 bytes or 14606 MB (freeing 3 MB).
Please make a test run using both the -n and -s options before real resizing!
Using a version of parted 1.9.0 with some fedora patches
applied seems to fix all these problems.
I downloaded it here (from a link in the forums):
http://kojipkgs.fedoraproject.org/packa … 12.src.rpm
Under Slackware, I extracted the patches and applied them in this
order as per the rpm spec file:
parted-1.9.0-appletv-support.patch
parted-1.9.0-extended-mbr.patch
parted-1.9.0-noheaders.patch
parted-1.9.0-pop-push-error.patch
parted-1.9.0-no-cylinder-align.patch
parted-1.9.0-remove-struct-elem.patch
parted-1.9.0-move-function-declarations.patch
parted-1.9.0-dasd-duplicate.patch
parted-1.9.0-new-duplicate.patch
parted-1.9.0-handle-dup-error.patch
parted-1.9.0-swap-flag.patch
parted-1.9.0-volkeysize.patch
parted-1.9.0-no-BLKPG.patch
parted-1.9.0-commit-without-close.patch
parted-1.9.0-dont-touch-part-nodes.patch
I haven't done a bisection to see which patch fixes the problem.
I've made many tests, and cannot get an error with the fedora
patchset version of parted-1.9.0, but get regular errors with just
the patch (commit: ad25892bb995f61b0ddf801ed1f74e0b1e7390ce) you
recommend. In order to get the errors, on the disk I have, I do
something like this:
###
Start with about 12GB of data on the disk.
:loop
Resize the partition to max.
Test if all OK with gparted and ntfsresize -i -f -n /dev/sdd1
If yes, continue, else investigate.
Mount disk with ntfs-3g and write data to the drive, perhaps using
a simple script like this:
wget http://www.kernel.org/pub/linux/kernel/ … .7.tar.bz2
wget http://www.kernel.org/pub/linux/kernel/ … 32.tar.bz2
rm -rf dir_*
while : ; do
echo "mkdir dir_$CNT"
mkdir dir_$CNT
echo "cp *.bz2 dir_$CNT/"
cp *.bz2 dir_$CNT/
if [ $? -gt 0 ]; then
break
fi
CNT=$((CNT+1))
done
Interrupt above script when about 10GBs of disk space has been
copied.
Delete all dirs bar the last dir made, so I possibly have some
fragmentation, and have written to clusters/sectors sitting
outside the smaller ntfs file system.
Resize too just +1 GB of the smallest size I can resize to.
Test if all OK with gparted and ntfsresize -i -f -n /dev/sdd1
If yes, loop, else investigate.
###
I don't really know which patch set you are applying to
parted-1.9.0. I cannot seem to find the source code to your live
CD, and assume you don't actually release it (tut tut ;). It
might be good, though, to indicate what patches you are using on
what packages, and perhaps give instructions (or scripts) on how
to recreate the CD. At the moment, it seems that there are just FAR
too many parted-1.9.0 variants around to have a good idea which
patch set you recommend.
Further, it might be useful if you kept your own patched version
of parted on your own servers so we might all try to use the same
version. Nobody seems to be using the official, unpatched one:
gzip -cd parted-1.9.0.tar.gz | sha1sum -
af1ec6ef4bcb672f83c91cdc5bbfadd6f3f7e34d -
which is the same as the unpatched parted-1.9.0.tar.xz in the
fedora parted-1.9.0-14.fc12.src.rpm package.
Thanks for the fabulously useful gparted, and for making it
available under the GPL. I hope these problems get resolved
quickly.
All the best,
===Rich