我最近不得不把系统磁盘更换到远程服务器上,并且DC将旧磁盘连接到USB端口。 问题在于CentOS安装时都使用了所有的默认设置,所以现在lvscan的输出是:
[root@IS-55825 /]# lvscan inactive '/dev/vg_is55825/lv_root' [50.00 GiB] inherit inactive '/dev/vg_is55825/lv_home' [53.46 GiB] inherit inactive '/dev/vg_is55825/lv_swap' [7.67 GiB] inherit ACTIVE '/dev/vg_is55825/lv_root' [50.00 GiB] inherit ACTIVE '/dev/vg_is55825/lv_home' [53.24 GiB] inherit ACTIVE '/dev/vg_is55825/lv_swap' [7.89 GiB] inherit
pvs可以告诉它们的区别,但是我不知道如何将它们分开,我可以挂载其中一个旧的分区来获取一些configuration信息:
[root@IS-55825 /]# pvs -v Using physical volume(s) on command line. Wiping cache of LVM-capable devices Wiping internal VG cache Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO PV VG Fmt Attr PSize PFree DevSize PV UUID /dev/sda2 vg_is55825 lvm2 a--u 111.13g 0 111.13g QC5BPW-VdKx-dNnw-vSNm-cH6H-fZwB-HHXwFb /dev/sdd2 vg_is55825 lvm2 a--u 111.13g 0 111.13g LNSYx6-8DCv-u9CG-S1zv-vI20-fNIq-7BA8Le
它是/dev/sdd2我以后,但它不会直接挂载:
[root@IS-55825 /]# mount /dev/sdd2 /oldsys mount: unknown filesystem type 'LVM2_member'
我尝试了lvdisplay --select vg_uuid=LNSYx6-8DCv-u9CG-S1zv-vI20-fNIq-7BA8Le但它没有输出,这就像我得到…有没有办法获得它?
好的 – 我可以使用vgrename修复这个vgrename 。 首先,运行lvscan -v :
[root@IS-55825 ~]# lvscan -v Using logical volume(s) on command line. Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO Cache: Duplicate VG name vg_is55825: Existing gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO (created here) takes precedence over KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 inactive '/dev/vg_is55825/lv_root' [50.00 GiB] inherit inactive '/dev/vg_is55825/lv_home' [53.46 GiB] inherit inactive '/dev/vg_is55825/lv_swap' [7.67 GiB] inherit Cache: Duplicate VG name vg_is55825: Existing KbuKYZ-yPtq-VI65-DlqY-e0j3-5Van-9UTe06 (created here) takes precedence over gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO ACTIVE '/dev/vg_is55825/lv_root' [50.00 GiB] inherit ACTIVE '/dev/vg_is55825/lv_home' [53.24 GiB] inherit ACTIVE '/dev/vg_is55825/lv_swap' [7.89 GiB] inherit
所以我猜想UUID gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO是旧的磁盘。 所以我跑了vgrename :
[root@IS-55825 ~]# vgrename gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO vg_oldsys Processing VG vg_is55825 because of matching UUID gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO Volume group "gVj6yw-hbls-RgTh-MKe3-saoW-KH3B-ggf2LO" successfully renamed to "vg_oldsys"
然后我可以挂载/dev/vg_oldsys/lv-root 。 唷。