summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-02-23 17:03:19 -0500
committerAndrew Cady <d@cryptonomic.net>2021-02-23 17:03:19 -0500
commit4ae45ba0bdc988499e8fd71984b4a0ba65080d81 (patch)
tree0d1fec79cf5bd1a73e03ce9d0bd24ece22e222c0
parente14922bb715597b15fc069fbd31057aaf6bfb24c (diff)
btrfs-shrink will produce file w/ multiple of 4096 bytes
-rwxr-xr-xbtrfs-shrink5
1 files changed, 5 insertions, 0 deletions
diff --git a/btrfs-shrink b/btrfs-shrink
index a9bbee7..12f0e8e 100755
--- a/btrfs-shrink
+++ b/btrfs-shrink
@@ -76,6 +76,11 @@ main()
76 rmdir "$mountpoint" 76 rmdir "$mountpoint"
77 if [ "$truncate" ] 77 if [ "$truncate" ]
78 then 78 then
79 r=$((truncate % 4096))
80 if [ $r -ne 0 ]
81 then
82 truncate=$((truncate + 4096 - r))
83 fi
79 truncate -s "$truncate" "$1" 84 truncate -s "$truncate" "$1"
80 fi 85 fi
81 return $result 86 return $result