summaryrefslogtreecommitdiff
path: root/src/btrfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/btrfs-utils')
-rwxr-xr-xsrc/btrfs-utils/btrfs-shrink2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btrfs-utils/btrfs-shrink b/src/btrfs-utils/btrfs-shrink
index f3dbbb0..229b478 100755
--- a/src/btrfs-utils/btrfs-shrink
+++ b/src/btrfs-utils/btrfs-shrink
@@ -20,8 +20,8 @@ shrink()
20btrfs_truncate() 20btrfs_truncate()
21{ 21{
22 local img="$1" bytes 22 local img="$1" bytes
23 bytes=$(file "$img" | sed -ne 's?.*/\([0-9]*\)/[0-9]* bytes used.*?\1?p')
24# 548044800/1176715264 bytes used 23# 548044800/1176715264 bytes used
24 bytes=$(file "$img" | sed -ne 's?.*/\([0-9]*\) bytes used.*?\1?p')
25 if [ "$bytes" ]; then 25 if [ "$bytes" ]; then
26 truncate -s "$bytes" "$img" 26 truncate -s "$bytes" "$img"
27 fi 27 fi