Support "fudge factor" for file system sizing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Image |
Fix Released
|
Wishlist
|
Barry Warsaw |
Bug Description
We already add several fudge factors when calculating the rootfs and bootfs sizes. We always increase the size by a factor of 1.5 after looking at the sizes of all the files in the source directory, then for the rootfs, we add an additional 8MiB to account for ext4 overhead, with this comment in calculate_
def calculate_
# Calculate the size of the root file system. Basically, I'm trying
# to reproduce du(1) close enough without having to call out to it and
# parse its output.
# On a 100MiB filesystem, ext4 takes a little over 7MiB for the
# metadata. Use 8MiB as a minimum padding here.
Ogra wants to be able to define some additional "wiggle room" using a cli option or envar. His use case is that kvm images need some extra space.
I think a better way might be to specify the additional fudge factor in the gadget.yaml. A strawman proposal is to add a 'rootfs-size' option (and possibly a bootf-size option) to the spec, which could take various forms, e.g. to handle Ogra's case:
rootfs-size: x1.5+500
This would live in the volume section. Format TBD. Is this a good idea?
Changed in ubuntu-image: | |
status: | In Progress → Fix Committed |
milestone: | none → 0.8 |
Changed in ubuntu-image: | |
status: | Fix Committed → Fix Released |
no longer affects: | ubuntu-image (Ubuntu) |
no longer affects: | ubuntu-image (Ubuntu Yakkety) |
no longer affects: | ubuntu-image (Ubuntu Zesty) |
Mailing list thread: https:/ /lists. snapcraft. io/archives/ devices/ 2016-October/ 000089. html