diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh index 6f89c4007e..2c21220558 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh @@ -138,14 +138,13 @@ should_autosave_rootfs() { echo 0 return fi - local agcount - eval $(xfs_info "${root_part}" | grep -o 'agcount=[0-9]*') - # Semi-arbitrarily chosen: this is roughly ~64G currently (based on initial - # ag sizing at build time) which seems like a good rootfs size at which to - # discriminate between "throwaway/short-lived systems" and "long-running - # workload systems". It's not like XFS performance is way worse at 128. - if [ "$agcount" -lt 128 ]; then - echo "Filesystem agcount is $agcount; skipping" >&2 + # Find rootfs size in KiB + local rootsize + local reprovisionsize + rootsize=$(($(stat -f -c '%b * %s ${root_part} 1024' /))) + reprovisionsize=$((1024**3)) + if [ "$rootsize" -lt "$reprovisionsize" ]; then + echo "Filesystem size $rootsize KiB is less than threshold $reprovisionsize KiB; skipping" >&2 echo 0 return fi