[arch-projects] [mkinitcpio][PATCH] shutdown: disassemble devices on shutdown v2

Thomas Bächler thomas at archlinux.org
Wed Mar 28 05:48:48 EDT 2012

Okay, I am late to this party.

Am 25.03.2012 21:11, schrieb Dave Reisner:

> +    # this can sometimes fail on stopped md devices, when the
> +    # sysfs node doesn't go away as quickly as i'd like it to.
> +    devtype=$(lsblk -drno TYPE "/dev/$1" 2>/dev/null) || return 1
> +    case $devtype in
> +        crypt)
> +            read devname <"$1/dm/name"
> +            cryptsetup luksClose "$devname"
> +            ;;

This should be "cryptsetup remove". Although the two are identical
operations, the "luksClose" keyword seems to indicate that something
LUKS-specific is happening here, which it isn't.

> +        dmraid)
> +            # XXX: i have no idea how dmraid works
> +            dmraid -an
> +            ;;

According to the manpage, you can use the name of the dmraid set to only
deactivate this specific dmraid set only. Determining this name from the
device name seems to be harder than with LVM, but I don't have any
dmraid-capable hardware to give you specifics.

Is there any way to make something similar work with loop devices? You
would need to disable the loop device before umounting the underlying
file system. If we could solve this as well, then archiso probably
wouldn't need its special shutdown hook anymore.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20120328/1b6a5962/attachment.asc>

More information about the arch-projects mailing list