来自加密卷的关闭消息,严重吗?

来自加密卷的关闭消息,严重吗?

我已经在电脑上使用 Ubuntu 20.04 几个月了。使用默认安装程序安装它并启用了全盘加密。现在,当我关闭电脑时,systemd-shutdown 会生成以下两条消息:

systemd-shutdown[1]: Could not detach DM /dev/dm-0: Device or resource busy
systemd-shutdown[1]: Failed to finalize DM devices ignoring

它们确实会持续出现,即使在全新安装后也是如此。我在 Ubuntu 和 Pop_OS! 上都遇到过这种情况。如果没有加密,则关机期间不会显示任何消息。在我的 systemd 关机日志中,我看到以下消息弹出:

mrt 26 19:24:52 user systemd-cryptsetup[13215]: Device nvme0n1p3_crypt is still in use.
mrt 26 19:24:52 user systemd-cryptsetup[13215]: Failed to deactivate: Device or resource busy
[......]
mrt 26 19:24:52 user systemd[1]: systemd-cryptsetup@nvme0n1p3_crypt.service: Control process exited, code=exited, status=1/FAILURE
mrt 26 19:24:52 user systemd[1]: systemd-cryptsetup@nvme0n1p3_crypt.service: Failed with result 'exit-code'.
mrt 26 19:24:52 user systemd[1]: Stopped Cryptography Setup for nvme0n1p3_crypt.

我搜索了一段时间,发现使用不同 Linux 发行版的人都收到了这些消息。我看到的唯一真正的“解决方案”是隐藏这些消息。我的问题是,这是正常行为吗?加密驱动器在初始警告后最终会卸载,还是表示卸载根本没有完成?我主要担心卸载不当可能导致数据损坏。这些消息本身并不困扰我。

上次关机的 Journalctl 日志(我替换了我的用户名和 UUID,还缺少 snappackages 卸载):

mrt 26 19:24:52 user systemd[1]: Unmounting /boot/efi...
mrt 26 19:24:52 user systemd-cryptsetup[13215]: Device nvme0n1p3_crypt is still in use.
mrt 26 19:24:52 user systemd-cryptsetup[13215]: Failed to deactivate: Device or resource busy
mrt 26 19:24:52 user systemd[1]: Unmounting Mount unit for core18, revision 1988...
mrt 26 19:24:52 user systemd[1]: Unmounting Mount unit for gnome-3-34-1804, revision 66...
mrt 26 19:24:52 user systemd[1]: Unmounting Mount unit for gtk-common-themes, revision 1514...
mrt 26 19:24:52 user systemd[1]: systemd-cryptsetup@nvme0n1p3_crypt.service: Control process exited, code=exited, status=1/FAILURE
mrt 26 19:24:52 user systemd[1]: systemd-cryptsetup@nvme0n1p3_crypt.service: Failed with result 'exit-code'.
mrt 26 19:24:52 user systemd[1]: Stopped Cryptography Setup for nvme0n1p3_crypt.
mrt 26 19:24:52 user systemd[1]: boot-efi.mount: Succeeded.
mrt 26 19:24:52 user systemd[1]: Unmounted /boot/efi.
mrt 26 19:24:52 user systemd[1]: Unmounting /boot...
mrt 26 19:24:52 user systemd[1]: systemd-fsck@dev-disk-by\x2duuid-xxxxx\xxxxxx.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped File System Check on /dev/disk/by-uuid/xxxx-xxxx.
mrt 26 19:24:52 user systemd[1]: Stopped target Swap.
mrt 26 19:24:52 user systemd[1]: Deactivating swap /dev/disk/by-id/dm-name-vgubuntu-swap_1...
mrt 26 19:24:52 user systemd[1]: boot.mount: Succeeded.
mrt 26 19:24:52 user systemd[1]: Unmounted /boot.
mrt 26 19:24:52 user systemd[1]: systemd-fsck@dev-disk-by\x2duuid-xxxxxxxxxxxxxxxxxxxxxxxx.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped File System Check on /dev/disk/by-uuid/xxxxxxxxxxxxxxxxxxxx.
mrt 26 19:24:52 user systemd[1]: Removed slice system-systemd\x2dfsck.slice.
mrt 26 19:24:52 user systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dvgubuntu\x2dswap_1.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/disk/by-id/dm-name-vgubuntu-swap_1.
mrt 26 19:24:52 user systemd[1]: dev-vgubuntu-swap_1.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/vgubuntu/swap_1.
mrt 26 19:24:52 user systemd[1]: dev-disk-by\x2duuid-xxxxxxxxxxxxxxxxxxxxxxxx.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/disk/by-uuid/xxxxxxxxxxxxxxxxxxxxxxxxxxxd.
mrt 26 19:24:52 user systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dLVM\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/disk/by-id/dm-uuid-LVM-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
mrt 26 19:24:52 user systemd[1]: dev-dm\x2d2.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/dm-2.
mrt 26 19:24:52 user systemd[1]: dev-mapper-vgubuntu\x2dswap_1.swap: Succeeded.
mrt 26 19:24:52 user systemd[1]: Deactivated swap /dev/mapper/vgubuntu-swap_1.
mrt 26 19:24:52 user systemd[1]: Stopped target Local File Systems (Pre).
mrt 26 19:24:52 user systemd[1]: Reached target Unmount All Filesystems.
mrt 26 19:24:52 user systemd[1]: Stopping Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
mrt 26 19:24:52 user systemd[1]: systemd-tmpfiles-setup-dev.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped Create Static Device Nodes in /dev.
mrt 26 19:24:52 user systemd[1]: systemd-sysusers.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped Create System Users.
mrt 26 19:24:52 user systemd[1]: systemd-remount-fs.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped Remount Root and Kernel File Systems.
mrt 26 19:24:52 user lvm[13235]:   2 logical volume(s) in volume group "vgubuntu" unmonitored
mrt 26 19:24:52 user systemd[1]: lvm2-monitor.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Stopped Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
mrt 26 19:24:52 user systemd[1]: Reached target Shutdown.
mrt 26 19:24:52 user systemd[1]: Reached target Final Step.
mrt 26 19:24:52 user systemd[1]: systemd-reboot.service: Succeeded.
mrt 26 19:24:52 user systemd[1]: Finished Reboot.
mrt 26 19:24:52 user systemd[1]: Reached target Reboot.
mrt 26 19:24:52 user systemd[1]: Shutting down.
mrt 26 19:24:52 user systemd-shutdown[1]: Syncing filesystems and block devices.
mrt 26 19:24:52 user systemd-shutdown[1]: Sending SIGTERM to remaining processes...
mrt 26 19:24:52 user systemd-journald[733]: Journal stopped

提前致谢!

答案1

systemd-shutdown将尝试关闭它能关闭的程序。它将无法分离,/因此通知是意料之中的。除了忽略和抑制此消息外,还有软件可以避免这种情况,但您需要替换已启动的 initramfs,因此它是用于引导系统的第一批软件之一。

来自加密卷的关闭消息,严重吗?

不 :)


如果您希望关机能够分离,/您需要一个与 Ubuntu 使用的不同的“initramfs”。德拉库特可以做到这一点。

更多的:

为版本为 的内核创建 initramfs。如果省略 ,则使用实际运行的内核的版本。如果省略 或为空,则使用默认位置 /boot/initramfs-.img。

dracut 创建一个初始映像,供内核预加载访问根文件系统、挂载根文件系统和启动真实系统所需的块设备模块(例如 IDE、SCSI 或 RAID)。

在启动时,内核会将该存档解压到 RAM 磁盘中,然后挂载并将其用作初始根文件系统。所有对根设备的查找都发生在这个早期用户空间中。

相关内容