summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shutdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/shutdown b/shutdown
index 2b2bcca..d43376c 100644
--- a/shutdown
+++ b/shutdown
@@ -62,6 +62,9 @@ disassemble() {
# might be in a useful state. FS#30995.
rm -rf /run/udev
+# chdir, so that we can avoid a lot of path chopping
+cd /sys/class/block
+
printf '%s\n' 'Detaching loop devices.'
for loop in loop*/loop; do
@@ -88,9 +91,6 @@ done
printf '%s\n' "Disassembling stacked devices."
-# chdir, so that we can avoid a lot of path chopping
-cd /sys/class/block
-
# iterate over devices with holders
for part in */holders/*; do
[ -e "$part" ] && disassemble "${part%%/*}"