逻辑卷在XenServer 7本地驱动器LVM上显示为不可用

时间:2016-09-19 00:51:36

标签: xen lvm

我需要在每次系统重启时使用命令“vgchange -ay”。 LVM是在主机上使用本地驱动器制作的,我在两个不同的驱动器上有两个分区作为PV。 LV是一个raid 1.我将它作为我的VM虚拟磁盘的存储库安装并且这项工作但是当我重新启动时这是分离,当我使用lvdisplay commnad时,我得到这个LV的NOT AVAILABLE消息。

提前致谢。

1 个答案:

答案 0 :(得分:1)

我可以确认,更糟糕的是,如果我的LV / etc / fstab中有一个挂载点,Xen Server 7将无法启动...由于同样的原因,LV不可用,停止系统启动并击落我的服务器。看起来像一个错误...

我的解决方法是在/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"