CentOS挂载lvm2分区重名问题解决方案
故障描述:原系统故障(不能进入系统了),需要重装系统,但系统盘上有数据,新换一个硬盘按原系统版本安装。安装后出现2个lvm2一模一样的centos分区解决方法:
# pvs
PV VG FmtAttr PSize PFree
/dev/sda2centos lvm2 a-- <1.82t 4.00m
/dev/sde2centos lvm2 a--118.75g 0
2个一模一样的LVM2分区
重命名格式为:vgrename centos centos1
此时会提示:
# vgrename centos centos1
Found more than one VG called centos . Please supply VG uuid.
原因是存在两个 centos,修改的方法他已经提示了要指定 VG uuid即可。
查看VG uuid的命令为:
# vgs -v
VG Attr Ext #PV #LV #SN VSize VFree VG UUID VProfile
centos wz--n- 4.00m 1 3 0<1.82t 4.00m wchkxO-t73r-rvi8-nLzy-3d4b-mjKn-VczmKO
centos wz--n- 4.00m 1 3 0 118.75g 0NOyCJv-AvOR-9P0G-kX98-iqsX-1DbQ-LsiyKy
查到VG uuid以后,再次执行改名:
# vgrename NOyCJv-AvOR-9P0G-kX98-iqsX-1DbQ-LsiyKy centos1
Volume group "centos" still has active LVs
修改成功以后,再执行:lvscan
# lvscan
ACTIVE '/dev/centos/swap' inherit
ACTIVE '/dev/centos/home' inherit
ACTIVE '/dev/centos/root' inherit
inactive '/dev/centos1/root' inherit
inactive '/dev/centos1/home' [<60.87 GiB] inherit
inactive '/dev/centos1/swap' inherit
可以看到新修改的centos1是inactive状态。
再使用vgchange 加载 centos1
# vgchange -ay /dev/centos1
2 logical volume(s) in volume group "centos1" now active
再执行 :lvscan
# lvscan
ACTIVE '/dev/centos/swap' inherit
ACTIVE '/dev/centos/home' inherit
ACTIVE '/dev/centos/root' inherit
ACTIVE '/dev/centos1/root' inherit
ACTIVE '/dev/centos1/home' [<60.87 GiB] inherit
ACTIVE '/dev/centos1/swap' inherit
可以发现centos1已经是ACTIVE状态了。
最后 mount 就可以
# mount /dev/centos1/home /mnt
页:
[1]