故障描述:原系统故障(不能进入系统了),需要重装系统,但系统盘上有数据,新换一个硬盘按原系统版本安装。安装后出现2个lvm2一模一样的centos分区
解决方法:
- [root@localhost ~]# pvs
- PV VG Fmt Attr PSize PFree
- /dev/sda2 centos lvm2 a-- <1.82t 4.00m
- /dev/sde2 centos lvm2 a-- 118.75g 0
复制代码
2个一模一样的LVM2分区
重命名格式为:
此时会提示:
- [root@localhost ~]# vgrename centos centos1
- Found more than one VG called centos . Please supply VG uuid.
复制代码
原因是存在两个 centos,修改的方法他已经提示了要指定 VG uuid即可。
查看VG uuid的命令为:
- [root@localhost ~]# 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 0 NOyCJv-AvOR-9P0G-kX98-iqsX-1DbQ-LsiyKy
复制代码
查到VG uuid以后,再次执行改名:
- [root@localhost ~]# vgrename NOyCJv-AvOR-9P0G-kX98-iqsX-1DbQ-LsiyKy centos1
- Volume group "centos" still has active LVs
复制代码
修改成功以后,再执行:lvscan
- [root@localhost ~]# lvscan
- ACTIVE '/dev/centos/swap' [7.81 GiB] inherit
- ACTIVE '/dev/centos/home' [1.76 TiB] inherit
- ACTIVE '/dev/centos/root' [50.00 GiB] inherit
- inactive '/dev/centos1/root' [50.00 GiB] inherit
- inactive '/dev/centos1/home' [<60.87 GiB] inherit
- inactive '/dev/centos1/swap' [7.88 GiB] inherit
复制代码
可以看到新修改的centos1是inactive状态。
- 再使用vgchange 加载 centos1
- [root@localhost ~]# vgchange -ay /dev/centos1
- 2 logical volume(s) in volume group "centos1" now active
复制代码
再执行 :lvscan
- [root@localhost ~]# lvscan
- ACTIVE '/dev/centos/swap' [7.81 GiB] inherit
- ACTIVE '/dev/centos/home' [1.76 TiB] inherit
- ACTIVE '/dev/centos/root' [50.00 GiB] inherit
- ACTIVE '/dev/centos1/root' [50.00 GiB] inherit
- ACTIVE '/dev/centos1/home' [<60.87 GiB] inherit
- ACTIVE '/dev/centos1/swap' [7.88 GiB] inherit
复制代码
可以发现centos1已经是ACTIVE状态了。
最后 mount 就可以
- [root@localhost ~]# mount /dev/centos1/home /mnt
复制代码 |
|
|
|
|