Closed codewithmichael closed 9 years ago
I have addressed this in PR #12 (Replace LVM with BTRFS).
Since there were no other calls in initramfs-script
using the stat
command (as is used in getFileSize
), I removed the copy_exec
for stat
in initramfs-hooks
and replaced it with a copy_exec
for du
(which is used by getDiskUsage
.
Addressed by PR #12.
Loading a Wren instance with a standard, nearly empty save file causes the active data capacity to start at 2 GB instead of the expected 1 GB (default).
As noted in PR #12, the problem occurs because
initramfs-script
is using thegetFileSize
function (fromplatform-env
) to determine the size of the save image. Since getFileSize doesn't take sparse image size into consideration, it's simply calling it 1 GB (the standard initial save file size).Because the active data capacity is increased (by 1 GB default) if the save size gets within the default tolerance range of 512 MB, it is immediately expading from 1 GB to 2 GB.
The (non-technical) solution is to read the sparse file size instead of the reserved file size when determining save size in
initramfs-script
. There is already a function for this inplatform-env
calledgetDiskUsage
.