在新鲜的Ubuntu 18.04(64 位)服务器安装后,blk-availability.service
关机时总是因超时而终止。
我认为这项服务的依赖性很糟糕,但我不知道这个服务的良好关闭顺序是什么。
几乎相同的配置已经完成赛尼尔...
磁盘子系统是
- NVMe 固态硬盘(三星 970 EVO MZ-V7E250BW)
- 电喷分割
- 引导分割
- LVM 物理卷
- 根逻辑卷
- 交换逻辑卷
- 数据逻辑卷
- 2 块 HDD,组成 RAID1(但
md0
尚未使用)
杂志
systemd[1]: Stopped Load/Save Random Seed.
systemd[1]: Stopped Update UTMP about System Boot/Shutdown.
systemd[1]: Stopped Network Time Synchronization.
kernel: usb 1-13: USB disconnect, device number 2
systemd[1]: blk-availability.service: Stopping timed out. Terminating.
systemd[1]: blk-availability.service: Control process exited, code=killed status=15
blkdeactivate[2447]: [MD]: deactivating raid1 device md0... resync action in progress...
systemd[1]: blk-availability.service: Failed with result 'timeout'.
systemd[1]: Stopped Availability of block devices.
systemd[1]: Stopping iSCSI initiator daemon (iscsid)...
iscsid[951]: iscsid shutting down.
systemd[1]: Stopped iSCSI initiator daemon (iscsid).
systemd[1]: Stopped target Network is Online.
systemd[1]: Stopped Wait for Network to be Configured.
systemd[1]: Stopped target Network.
systemd[1]: Stopping Network Name Resolution...
systemd[1]: Stopped Network Name Resolution.
systemd[1]: Stopping Network Service...
systemd[1]: Stopped Create Volatile Files and Directories.
systemd[1]: Stopped target Local File Systems.
systemd[1]: Unmounting /boot/efi...
systemd[1]: Unmounting /run/user/1000...
systemd[1]: Unmounted /run/user/1000.
systemd[1]: Stopped target Swap.
systemd[1]: Deactivating swap /dev/disk/by-uuid/8a3d99d0-683e-xxxx-xxxx-9765162cc070...
systemd[1]: Unmounted /boot/efi.
systemd[1]: Unmounting /boot...
systemd[1]: Stopped File System Check on /dev/disk/by-uuid/AB9E-5A2C.
systemd[1]: Deactivated swap /dev/xxx_server_ssd/swap.
systemd[1]: Deactivated swap /dev/disk/by-uuid/8a3d99d0-683e-xxxx-xxxx-9765162cc070.
systemd[1]: Deactivated swap /dev/disk/by-id/dm-uuid-LVM-eatHKVdbDuw5L5RXXXXXXX2yJn7QosUWvV2IIApCOG73Bc2CbrUabBC6L3dh0N2D.
systemd[1]: Deactivated swap /dev/disk/by-id/dm-name-xxx_server_ssd-swap.
systemd[1]: Deactivated swap /dev/dm-1.
systemd[1]: Stopped Network Service.
systemd[1]: Deactivated swap /dev/mapper/xxx_server_ssd-swap.
systemd[1]: Unmounted /boot.
systemd[1]: Stopped File System Check on /dev/disk/by-uuid/d7cc70cc-0f33-xxxx-xxxx-cc21d3ed1232.
systemd[1]: Removed slice system-systemd\x2dfsck.slice.
systemd[1]: Stopped target Local File Systems (Pre).
systemd[1]: Stopped Remount Root and Kernel File Systems.
systemd[1]: Stopped Create Static Device Nodes in /dev.
systemd[1]: Stopping Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
systemd[1]: Stopped target Network (Pre).
systemd[1]: Stopped Apply Kernel Variables.
systemd[1]: Stopped Load Kernel Modules.
systemd[1]: Reached target Shutdown.
systemd[1]: Reached target Unmount All Filesystems.
systemd[1]: Reached target Final Step.
systemd[1]: Starting Power-Off...
systemctl cat blk-availability.service
# /lib/systemd/system/blk-availability.service
[Unit]
Description=Availability of block devices
After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service
DefaultDependencies=no
Conflicts=shutdown.target
[Service]
Type=oneshot
ExecStart=/bin/true
ExecStop=/sbin/blkdeactivate -u -l wholevg -m disablequeueing -r wait
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
问题
这是 Ubuntu 的错误吗?我该如何解决?
更新:我创建了一个错误报告https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/1780196
更新 2:我找到了引入此内容的提交blkdeactivate
:lvm2上游:c698ee14bbb1310cf2383c8977d14a8e29139f8c
遍历块设备树并尝试停用它们。目前,它支持基于设备映射器的设备和 LVM。有关更多信息,请参阅 man/blkdeactivate.8。
它旨在用于关机期间正确停用整个块设备堆栈 - 还提供 systemd 和 init 脚本。但是,它也可以直接在命令行上使用。
在这种情况下,我认为这些东西运行得太早了。
更新 3:我认为可以通过两种方式解决:
blkdeactivate
应该正确处理同步软件 raid 阵列- 重新订购此服务,在“标准”软件 raid deinit 之后