问题:系统重启后挂在逻辑卷的盘会掉(必现)
环境:SUSE Linux 11 SP4
原因:boot.lvm是关闭的
解决:boot.lvm设置开启
参考资料:
linux下lvm状态Not avaliable问题排查及处理(常见Suse操作系统) https://www.modb.pro/db/411106
linux centos重启后LV Status NOT available https://www.cnblogs.com/namedgx/p/18022670
详细排查如下,
环境信息:
# cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 4
创建好逻辑卷,data路径挂载完,并写入如下行到/etc/fstab
/dev/mapper/vgData-lvData /opt/data xfs defaults 0 0
testServer:~ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 1.2T 2.1G 1.2T 1% /
udev 127G 448K 127G 1% /dev
tmpfs 127G 728K 127G 1% /dev/shm
/dev/sda1 1009M 64M 895M 7% /boot
/dev/mapper/vgData-lvData 2.8T 6G 2.8T 1% /opt/data
shutdown -r now 重启后,data盘掉了,且手动无法挂载
testServer:~ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 1.2T 2.1G 1.2T 1% /
udev 127G 448K 127G 1% /dev
tmpfs 127G 728K 127G 1% /dev/shm
/dev/sda1 1009M 64M 895M 7% /boot
vgdisplay查看VG(没有问题)
lvdisplay查看LV,状态如下
LV Status NOT available
testServer:~ # lvdisplay
--- Logical volume ---
LV Name /dev/vgData/lvData
VG Name vgData
LV UUID xxx...
LV Write Access read/write
LV Creation host, time testServer, 2024-08-08 18:30:51 +0800
LV Status NOT available
LV Size 2.73 TiB
Current LE 715400
Segments 2
Allocation inherit
Read ahead sectors auto
恢复方法:激活VG
testServer:~ # vgchange -a y vgData
1 logical volume(s) in volume group "vgData" now active
testServer:~ # mount -a
testServer:~ # df -h
Filesystem Size Used Avail Use% Mounted on
……
/dev/mapper/vgData-lvData 2.8T 6G 2.8T 1% /home
但是,这个问题重启必现,网络查看资料,检查boot.lvm,发现其状态是关闭的,而其它正常挂载的服务器,boot.lvm为on
chkconfig -A | grep boot.lvm
testServer:~ # chkconfig -A | grep boot.lvm
boot.lvm off
boot.lvm_monitor on
testServer:~ #
chkconfig boot.lvm on 将其开启,再尝试重启服务器,挂在LVM的盘不会再掉了