Enable fstrim for chroots |
||
Issue descriptionAs space in the chroot is used, chroot.img grows, but the used space isn't released back to the OS when files are deleted inside the chroot. This makes the sparse image progressively less sparse over time. We should run fstrim on the chroot mountpoint to garbage collect the unused space. cros_sdk could do this automatically, but it can take a few seconds, so we should only do this when it would help.
,
Nov 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/chromite/+/e3d5bd1ef1a99d5be8fc452f6c617efc33806058 commit e3d5bd1ef1a99d5be8fc452f6c617efc33806058 Author: Benjamin Gordon <bmgordon@chromium.org> Date: Sat Nov 18 04:18:50 2017 cros_sdk: Run fstrim to keep chroot.img sparse chroot.img is a sparse image, but it gradually becomes allocated as space is used inside the chroot. The filesystem doesn't garbage collect the freed space as files are deleted, so chroot.img eventually uses much more space than the chroot contents need. Call fstrim in cros_sdk after mounting the chroot to recover the unused space. fstrim takes some time to run, so only call it if it's likely to free enough space to be worthwhile (arbitrarily defined as 20GB). BUG= chromium:776417 TEST=Deleted large files inside chroot and verified that space was recovered after running cros_sdk. Change-Id: Id84b2dfac7ef03a5eab96f59726ea5b2b17b227e Reviewed-on: https://chromium-review.googlesource.com/776003 Commit-Ready: Benjamin Gordon <bmgordon@chromium.org> Tested-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/e3d5bd1ef1a99d5be8fc452f6c617efc33806058/scripts/cros_sdk.py
,
Nov 20 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by bmgordon@chromium.org
, Oct 23 2017