From bcc6f91f73d30a557bed6162344ba9964ea9fee7 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Tue, 1 Nov 2011 15:58:09 -0400 Subject: [PATCH] imgutils: reduce default overhead to 128 blocks generally we don't need ~4MB extra space. --- src/pylorax/imgutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py index 04bc8696..e7526b09 100644 --- a/src/pylorax/imgutils.py +++ b/src/pylorax/imgutils.py @@ -140,12 +140,12 @@ def round_to_blocks(size, blocksize): size += blocksize - diff return size -def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=1024): +# TODO: move filesystem data outside this function +def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=128): getsize = lambda f: os.lstat(f).st_size if fstype == "btrfs": overhead = 64*1024 # don't worry, it's all sparse if fstype in ("vfat", "msdos"): - overhead = 128 blocksize = 2048 getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies total = overhead*blocksize