From 9137ba5e5f4a43c86b99b260f67a98f730185703 Mon Sep 17 00:00:00 2001 From: Phuong Vu Date: Sun, 5 Dec 2021 17:28:31 +0700 Subject: [PATCH] Added code to wait for loopback readiness --- pishrink.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pishrink.sh b/pishrink.sh index 58a0119..9fa26fd 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -292,6 +292,8 @@ else parttype="logical" fi loopback="$(losetup -f --show -o "$partstart" "$img")" +# Wait 3 seconds to ensure loopback is ready. +sleep 3 tune2fs_output="$(tune2fs -l "$loopback")" rc=$? if (( $rc )); then