summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-30 06:33:37 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-02 00:29:55 +0200
commitfc7097a016472a084bd8428c027e60d5dfd3aa40 (patch)
tree392cf4b8cff22a887fd01af3ebf8d39e2cb1ee49
parent5a7040d717646d31833880dae2e61daec4ad2e6c (diff)
downloadmkinitcpio-fc7097a016472a084bd8428c027e60d5dfd3aa40.tar.gz
mkinitcpio-fc7097a016472a084bd8428c027e60d5dfd3aa40.tar.xz
shutdown: detach all loop devices before umounting
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xshutdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/shutdown b/shutdown
index 20510b2..ce7de23 100755
--- a/shutdown
+++ b/shutdown
@@ -55,6 +55,12 @@ disassemble() {
done
}
+printf '%s\n' 'Detaching loop devices.'
+
+for loop in loop*/loop; do
+ [ -e "$loop" ] && losetup -d "${loop%/loop}"
+done
+
printf '%s\n' "Unmounting all devices."
# unmount everything in /oldroot