diff --git a/init/resize-rootfs-if-needed.sh b/init/resize-rootfs-if-needed.sh index c94513c..77207cf 100755 --- a/init/resize-rootfs-if-needed.sh +++ b/init/resize-rootfs-if-needed.sh @@ -14,7 +14,9 @@ fi sysfs_xvda="/sys/class/block/xvda" # if root filesystem use already (almost) the whole dis -size_margin=$(( 250 * 1024 * 2 )) +# 203M for BIOS and /boot data, 222 for ext4 filesystem overhead +# See QubesOS/qubes-core-agent-linux#146 for more details +size_margin=$(((222 + 203) * 2 * 1024)) rootfs_size=$(df --block-size=512 --output=size / | tail -n 1 | tr -d ' ') if [ $(cat $sysfs_xvda/size) -lt \ $(( size_margin + rootfs_size )) ]; then