System waits forever in shut down when having LUKS devices configured

Solution Verified - Updated -

Issue

  • When shutting down a system having LUKS devices mounted, the system takes an extremely long time to shut down or reboot and shows the following message on the console

    [...]
    [  OK  ] Stopped System Logging Service.
    [  OK  ] Stopped Restore /run/initramfs on shutdown.
             Starting Tell Plymouth To Jump To initramfs...
    [  OK  ] Started Tell Plymouth To Jump To initramfs.
    [   ***] A stop job is running for /dev/mapper/SOME-LUKS-DEVICENAME (49s / no limit)
    
  • When journal is configured persistently, on next boot, we can see errors happened during the shut down related to LUKS devices

    # journalctl -b -1 | tail -100 | cut -d' ' -f5-
    [...]
    systemd-cryptsetup[XXX]: Device SOME-LUKS-DEVICENAME is still in use.
    systemd-cryptsetup[XXX]: Failed to deactivate: Device or resource busy
    systemd[1]: systemd-cryptsetup@SOME-LUKS-DEVICENAME.service: Job systemd-cryptsetup@SOME-LUKS-DEVICENAME.service/stop finished, result=done
    

Environment

  • Red Hat Enterprise Linux 8
    • LUKS

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content