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 <tserong@suse.com>
  • Loading branch information
tserong committed Feb 12, 2025
1 parent 83a51bc commit 05152ff
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 @@ -154,6 +154,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 @@ -528,6 +536,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 05152ff

Please sign in to comment.