def __resize_to_minimal(self):
msger.info("Resizing filesystem to minimal ...")
self.__fsck()
-
- #
- # Use a binary search to find the minimal size
- # we can resize the image to
- #
- bot = 0
- top = self.__get_size_from_filesystem()
- while top != (bot + 1):
- t = bot + ((top - bot) / 2)
-
- if not resize2fs(self.disk.lofile, t):
- top = t
- else:
- bot = t
- return top
+ resize2fs(self.disk.lofile, 0)
+ return self.__get_size_from_filesystem()
def resparse(self, size = None):
self.cleanup()