From 17db096d1bbbaabd30add632fc91e4e48afc990f Mon Sep 17 00:00:00 2001 From: Zhijiang Hu Date: Wed, 19 Apr 2017 03:38:48 -0400 Subject: Solve "Buffer I/O error on dev loop0p1" error message This add "losetup" before "kpartx -l" command, otherwise, we encountered many "Buffer I/O error on dev loop0p1, logical block 104854018, async page read" in dmesg. But they are seems no harm. No need to do "losetup -d" after "losetup", because "kpartx -dv" will do that for us. Change-Id: I326ef35a241d8b09f0f3f3fc90ef749df3f4768f Signed-off-by: Zhijiang Hu --- tools/daisy-img-modify.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh index 90910a14..aad29949 100755 --- a/tools/daisy-img-modify.sh +++ b/tools/daisy-img-modify.sh @@ -157,6 +157,7 @@ resize() { # resize the image qemu-img resize $raw_imgfile ${img_size}G qemu-img info $raw_imgfile + losetup --find --show $raw_imgfile loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ') kpartx -av $raw_imgfile sleep 2 @@ -170,9 +171,8 @@ resize() { # mount image setup() { mkdir -p $mountdir - + losetup --find --show $raw_imgfile loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ') - kpartx -av $raw_imgfile sleep 2 dmsetup ls -- cgit 1.2.3-korg