From 5a309568167623677c6310e7de99c62c273d3de7 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 28 Mar 2012 09:44:54 -0400 Subject: shutdown: improve handling of dm devices - use the 'remove' action for cryptsetup rather than luksClose - handle dm devices with dmsetup, not lvm - disable dmraid devices by name, instead of all at once Signed-off-by: Dave Reisner --- shutdown | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shutdown b/shutdown index f664d6e..2e6f504 100755 --- a/shutdown +++ b/shutdown @@ -14,9 +14,13 @@ stop_device() { case $devtype in crypt) read devname <"$1/dm/name" - cryptsetup luksClose "$devname" + cryptsetup remove "$devname" ;; - dm|lvm) + dm) + read devname <"$1/dm/name" + dmsetup remove "$devname" + ;; + lvm) # disassemble the parent VG read devname <"$1/dm/name" lvm lvdisplay -c "/dev/mapper/$devname" | { @@ -28,8 +32,8 @@ stop_device() { mdadm --stop "/dev/$1" ;; dmraid) - # XXX: i have no idea how dmraid works - dmraid -an + read devname <"$1/dm/name" + dmraid -an "$devname" ;; # silently ignore unstacked devices esac -- cgit v1.2.3-24-g4f1b