[PATCH] Don't resize NTFS partitions to smaller than the filesystem on them (#885912).

Chris Lumens clumens at redhat.com
Tue Dec 18 21:07:07 UTC 2012


Note this is a big hacky fix, while the permanent fix involves telling other
parts of the code when we change sizes via alignments.
---
 pyanaconda/storage/formats/fs.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py
index 505e76e..738ef6d 100644
--- a/pyanaconda/storage/formats/fs.py
+++ b/pyanaconda/storage/formats/fs.py
@@ -1418,7 +1418,12 @@ class NTFS(FS):
     def resizeArgs(self):
         # You must supply at least two '-f' options to ntfsresize or
         # the proceed question will be presented to you.
-        targetSize = (mib / mb) * self.targetSize # convert MiB to MB
+
+        # FIXME: This -1 is because our partition alignment calculations plus
+        # converting back and forth between MiB and MB means the filesystem is
+        # getting resized to be slightly larger than the partition holding it.
+        # This hack just makes the filesystem fit.
+        targetSize = (mib / mb) * (self.targetSize-1) # convert MiB to MB
         argv = ["-ff", "-s", "%dM" % (targetSize,), self.device]
         return argv
 
-- 
1.7.11.2



More information about the anaconda-patches mailing list