大楼停电,以为戴尔服务器稳如老狗,没去手动关机,启动后 少了个逻辑券 /dev/VolGroup/home
结果服务器太老 centos6.5
yum install lvm2 安装不成功
相关命令 pvcreate lvdisplay都提示command not found
决定手动离线安装lvm2
对 没错 就是上次离线安装docker的服务器….
centos6.5 离线安装docker1.7.1(带离线安装包下载)
里面有包含lvm2离线包
但是安装lvm2-2.02.143-12.el6.x86_64.rpm会提示device-mapper-persistent-data need by >=0.6.2
到网站https://rpm.pbone.net/resultsb_dist_79_size_473864_name_device-mapper-persistent-data-0.6.2-0.2.rc7.el6.x86_64.rpm.html
下载
device-mapper-persistent-data-0.6.2-0.2.rc7.el6.x86_64.rpm
然后安装
rpm -ivh device-mapper-persistent-data-0.6.2-0.2.rc7.el6.x86_64.rpm
提示
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
解决方案
sudo useradd -s /sbin/nologin mockbuild
rpm -ivh device-mapper-persistent-data-0.6.2-0.2.rc7.el6.x86_64.rpm
rpm -ivh lvm2-2.02.143-12.el6.x86_64.rpm
然后安装成功LVM2
然后网上找的教程类似pvcreate,没用
pvcreate /dev/sda2 --uuid "3Nt1Ra-WKdR-NjB0-2TD9-LLdC-5Tl6-CZp1m6" --restorefile /etc/lvm/backup/VolGroup
提示
Can’t find uuid in backup file /etc/lvm/backup/VolGroup什么的
奇怪的是lvdisplay有返回
[root@localhost archive]# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID og7GfV-GX0H-Cwba-xd5Z-cxlp-fTXN-FzkdJh
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2018-10-08 19:47:12 +0800
LV Status available
# open 1
LV Size 850.00 GiB
Current LE 217600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/VolGroup/lv_swap
LV Name lv_swap
VG Name VolGroup
LV UUID ccHcNf-78UM-GKS2-Xp8s-Zrc2-A2rB-40YeSO
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2018-10-08 19:51:24 +0800
LV Status available
# open 1
LV Size 15.66 GiB
Current LE 4010
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/VolGroup/home
LV Name home
VG Name VolGroup
LV UUID 3Nt1Ra-WKdR-NjB0-2TD9-LLdC-5Tl6-CZp1m6
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-01-21 15:13:44 +0800
LV Status NOT available
# open 1
LV Size 2.44 TiB
Current LE 640000
Segments 1
Allocation inherit
Read ahead sectors auto
我都没注意看到 LV Status NOT available 这一栏
最后百度搜索 lvdisplay有 但是无法挂载
最后网上找到一个教程
https://dude6.com/article/13015.html
一个命令解决
vgchange -ay
mount -a
马德吓死我了 一天担惊受怕……2.2T的公司数据
[root@localhost mapper]# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 837G 566G 229G 72% /
devtmpfs 16G 180K 16G 1% /dev
tmpfs 16G 412K 16G 1% /dev/shm
/dev/mapper/VolGroup-lv_root
837G 566G 229G 72% /
/dev/sda1 477M 67M 385M 15% /boot
/dev/mapper/VolGroup-home
2.5T 2.2T 250G 91% /media
以后供起来,大楼说要停电 ,第一个给你关机
太可怕了
运维要有良好习惯,这是我自己不警惕作出来的…….同行共勉
近期评论