周末朋友的服务器硬盘出问题了,让IDC的人挂了个IDE硬盘把系统安装好,然后再挂上以前的SATA硬盘,想把数据倒腾出来,结果哥们发现他搞不定,给我打电话求助。我远程上去看了下,发现2块盘系统做的都是LVM分区格式8e,不是ext3的83,难怪他不会挂载,而且还有个问题就是卷组都是默认安装的同一个名字VolGroup00。
[root@locallhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/hda2 VolGroup00 lvm2 a- 74.41G 0
/dev/sda2 VolGroup00 lvm2 a- 232.78G 0
hda2是新系统盘74G多,sda2是老数据盘232G多。卷组名称一样,因为2个系统安装的时候都是默认安装的。
[root@locallhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 232.78G 0
VolGroup00 1 2 0 wz--n- 74.41G 0
我们先用vgrename改卷组名:
[root@locallhost ~]# vgrename VolGroup00 aaalvm
Found more than one VG called VolGroup00. Please supply VG uuid.
直接报有同名,需要用uuid。查uuid可以用vgdisplay或vgs -v:
[root@locallhost ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.78 GB
PE Size 32.00 MB
Total PE 7449
Alloc PE / Size 7449 / 232.78 GB
Free PE / Size 0 / 0
VG UUID bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 74.41 GB
PE Size 32.00 MB
Total PE 2381
Alloc PE / Size 2381 / 74.41 GB
Free PE / Size 0 / 0
VG UUID YHLmkq-b1xS-UzAS-Y3nv-6vaX-2Xou-GScvk0