Jim Meyering
2008-Dec-02 17:10 UTC
[Ovirt-devel] [PATCH node-image] edit-livecd: Retry upon failed umount.
This is useful when you manually edit an image and forget to "cd" out of the working directory. Without this, the script can't clean up, and it's a pain to do manually. --- edit-livecd | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/edit-livecd b/edit-livecd index c122eee..ce9e65b 100755 --- a/edit-livecd +++ b/edit-livecd @@ -141,8 +141,20 @@ else echo "***" read fi -echo ">>> Unmounting ext3fs" -umount $WDIR/ex + +# Try to unmount. But this is likely to fail, so let the user retry, +# e.g., if he forgot to "cd" out of $WDIR/ex. +while :; do + echo ">>> Unmounting ext3fs" + umount $WDIR/ex && break + echo ">>> Unmounting ext3fs failed" + echo "***" + echo "*** Did you forget to 'cd' out of $WDIR/ex?" + echo "***" + echo "*** Press any key to repeat the attempt." + echo "***" + read +done echo ">>> Compressing filesystem" mksquashfs $WDIR/sq-w/ $WDIR/cd-w/LiveOS/squashfs.img -noappend -- 1.6.1.rc1.279.g45d11
Dan Kenigsberg
2008-Dec-03 13:52 UTC
[Ovirt-devel] [PATCH node-image] edit-livecd: Retry upon failed umount.
On Tue, Dec 02, 2008 at 06:10:11PM +0100, Jim Meyering wrote:> > This is useful when you manually edit an image and forget to "cd" > out of the working directory. Without this, the script can't > clean up, and it's a pain to do manually. >I'm not sure its related, but would you tell what's the painful manual way to clean these /dev/loop1: [fd00]:6194759 (/tmp/node-image-tmp/imgcreate-XjH6K-/tmp-L816gf/ext3fs.img) I'm left with after an interrupted make .iso ? Dan