From 5949b9031c9e75bc377f3cdb04f514f29bdcf69f Mon Sep 17 00:00:00 2001 From: John Ogness Date: Thu, 6 Sep 2018 11:06:11 +0200 Subject: dd-multi: workaround mount/umount issue It seems that calling umount directly after mount can lead to a busy error. With strace on umount the problem goes away. It must be a very small window. Someone should debug the umount syscall on this. It is reproducable with: ./dd-multi.sh lx-trainer.img /dev/sdx (i.e. regular training image and no layers) Implement a workaround for this for now. From the comments... If there were no layer files added, umount might return a busy error since we just mounted. (Possibly a kernel bug.) By accessing the filesytem before unmounting it, the mount/umount problem seems to go away. Use "ls" to access the filesystem. Signed-off-by: John Ogness --- lx-trainer-vm/dd-multi.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lx-trainer-vm/dd-multi.sh') diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh index 2a0f9f9..f74171d 100755 --- a/lx-trainer-vm/dd-multi.sh +++ b/lx-trainer-vm/dd-multi.sh @@ -160,6 +160,12 @@ for tarball in $LAYERS; do done for dest in $DESTS; do + # If there were no layer files added, umount might return a busy + # error since we just mounted. (Possibly a kernel bug.) By + # accessing the filesytem before unmounting it, the mount/umount + # problem seems to go away. Use "ls" to access the filesystem. + ls ${TMP_ROOT}${dest}${ROOTPT}/home/ > /dev/null + # unmount partitions umount ${TMP_ROOT}${dest}${ROOTPT}/home umount ${TMP_ROOT}${dest}${ROOTPT} -- cgit v1.2.3