Skip to content

Commit

Permalink
fix: ensure passive.img is sparse after install
Browse files Browse the repository at this point in the history
Related issue: harvester/harvester#7457
Related issue: harvester/harvester#7518

Signed-off-by: Tim Serong <[email protected]>
(cherry picked from commit 05152ff)
  • Loading branch information
tserong authored and bk201 committed Feb 17, 2025
1 parent 1d9f83e commit 695ecda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package/harvester-os/files/usr/sbin/harv-install
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ do_mount()
mount ${PERSISTENT} ${TARGET}/usr/local
}

sparsify_passive_img()
{
# See https://github.com/harvester/harvester/issues/7518
echo "Ensuring passive.img is sparse..."
echo " was: $(du -h ${STATEDIR}/cOS/passive.img)"
fallocate --dig-holes ${STATEDIR}/cOS/passive.img
echo " now: $(du -h ${STATEDIR}/cOS/passive.img)"
}

preload_rke2_images()
{
Expand Down Expand Up @@ -537,6 +545,7 @@ do_data_disk_format
# Preload images
do_detect
do_mount
sparsify_passive_img
get_iso # For PXE Boot
save_configs
save_wicked_state
Expand Down

0 comments on commit 695ecda

Please sign in to comment.