From 4ae45ba0bdc988499e8fd71984b4a0ba65080d81 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 23 Feb 2021 17:03:19 -0500 Subject: btrfs-shrink will produce file w/ multiple of 4096 bytes --- btrfs-shrink | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/btrfs-shrink b/btrfs-shrink index a9bbee7..12f0e8e 100755 --- a/btrfs-shrink +++ b/btrfs-shrink @@ -76,6 +76,11 @@ main() rmdir "$mountpoint" if [ "$truncate" ] then + r=$((truncate % 4096)) + if [ $r -ne 0 ] + then + truncate=$((truncate + 4096 - r)) + fi truncate -s "$truncate" "$1" fi return $result -- cgit v1.2.3