Skip to main content
Topic: Shutdown Issue — Artix with LUKS2 → LVM2 → ext4 (Read 689 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Shutdown Issue — Artix with LUKS2 → LVM2 → ext4

Hi!
During system shutdown, I consistently see the following message:
Code: [Select]
[STOPPID] getty@tty1  
[STOPPID] hwclock 
Sending TERM/KILL to all processes... 
Executing shutdown hook... 
Disabling swap 
Unmounting filesystems 
Remounting root read-only 
Syncing disks 
Locking crypt devices 
Disabling LVM 
  Logical volume artix/root contains a filesystem in use. 
  Can't deactivate volume group "artix" with 1 open logical volume(s)

My system is set up as follows:
LUKS2 full disk encryption
 => Inside it: LVM2 volume group (artix)
 ==> Logical volumes: root, home
 ===> Filesystem: ext4 on top of the logical volumes

From what I understand, this message means the root filesystem is still mounted or in use during shutdown, so LVM can't deactivate the volume group. That seems expected, given that / remains active until the very end.

Despite this message, the system reboots successfully without any issues.

Still, I'm curious:
Is this behavior considered normal for Artix with this setup?
Is there a way to cleanly deactivate LVM during shutdown?
Can the root filesystem be unmounted or made read-only earlier to avoid the warning?

Any insights or suggestions would be appreciated. Thanks!

Re: Shutdown Issue — Artix with LUKS2 → LVM2 → ext4

Reply #1
Just a quick follow-up regarding the shutdown hook script from:
https://gitea.artixlinux.org/artix/dinit-rc/src/branch/master/misc/shutdown-hook

This script will not work correctly if your system is running inside an LVM2 container. In such a setup, the LVM2 volume group cannot be properly deactivated during shutdown because the root filesystem is still mounted and in use.

While the script attempts to remount the root filesystem as read-only, this does not guarantee safe deactivation of LVM2. The logical volumes remain active, and the volume group cannot be cleanly closed. As a result, the LUKS2 container may be closed while LVM2 is still active, which can potentially lead to metadata corruption or inconsistencies on the next boot — even if the ext4 filesystem itself is read-only.

This is a serious oversight that should be addressed by the maintainers. The current shutdown hook does not account for LVM2-based configurations and may lead to data loss. A proper fix or alternative hook should be provided to ensure safe shutdown in LVM2 environments.