diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/btrfs-utils/btrfs-shrink | 2 |
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() | |||
20 | btrfs_truncate() | 20 | btrfs_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 |