每次系统重新启动时,我都需要使用命令“vgchange -ay”。LVM 是用主机上的本地驱动器制作的,我在两个不同的驱动器上有两个分区作为 PV。LV 是一个 raid 1。我将它作为我的虚拟机 vdisks 的存储库安装,并且这项工作但是当我重新启动时,这是分离的,当我使用 lvdisplay commnad 时,我收到此 LV 的 NOT AVAILABLE 消息。
提前致谢。
我可以确认,更糟糕的是,如果我的 LV 在 /etc/fstab 中有一个挂载点,Xen Server 7 将无法启动......由于同样的原因,LV 不可用,停止 systemd 启动并关闭我的服务器。好像是个bug...
我的解决方法是在 /etc/lvm.conf 中将 metadata_read_only 设置为 0,然后像这样将 'vgchange -a y' 添加到 /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
exec 2> /tmp/rc.local.log # send stderr from rc.local to a log file
exec 1>&2 # send stdout to the same log file
echo "rc.local started" # show start of execution
set -x # tell sh to display commands before execution
touch /var/lock/subsys/local
vgchange -a y
mount /dev/VG_XenStorage-0ddceea1-3812-d470-7b8a-85b7834adb19/ISO /mnt/iso
echo "rc.local completed"