我所在的服务器显示重复的 VG 名称。我该如何重命名其中一个 VolGroup 以消除此冲突?
[root@dev-server dev]# lvs
WARNING: Duplicate VG name VolGroup00: zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 30.00G
LogVol01 VolGroup00 -wi-ao 127.91G
backup VolGroup00 -wi-ao 300.00G
rman VolGroup00 -wi-ao 300.00G
[root@dev-server dev]# pvs
WARNING: Duplicate VG name VolGroup00: zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p2 VolGroup00 lvm2 a-- 1.64T 918.62G
/dev/cciss/c0d1p1 VolGroup00 lvm2 a-- 3.27T 3.27T
/dev/mpath/mpath0p2 VolGroup00 lvm2 a-- 405.88G 0
vgdisplay
WARNING: Duplicate VG name VolGroup00: zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
--- 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 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 405.88 GB
PE Size 32.00 MB
Total PE 12988
Alloc PE / Size 12988 / 405.88 GB
Free PE / Size 0 / 0
VG UUID ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 2
Act PV 2
VG Size 4.91 TB
PE Size 32.00 MB
Total PE 160955
Alloc PE / Size 24253 / 757.91 GB
Free PE / Size 136702 / 4.17 TB
VG UUID zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87
我快速尝试重新命名 VolGroup(可能做错了......):
[root@dev-server dev]# vgrename /dev/cciss/c0d1 /dev/VolGroup02
WARNING: Duplicate VG name VolGroup00: zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
WARNING: Duplicate VG name VolGroup00: Existing zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 (created here) takes precedence over ifDUDd-ePmZ-Er7H-xwst-70dY-hB3M-6YDNZc
Volume group name cciss/c0d1 has invalid characters
[root@dev-server dev]#
输出df -h
:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00
30G 17G 12G 59% / /dev/cciss/c0d0p1 99M 30M 65M 32% /boot tmpfs 63G 0 63G 0% /dev/shm /dev/mapper/VolGroup00-rman
296G 8.9G 272G 4% /rman/11g /dev/mapper/VolGroup00-backup
296G 34G 248G 12% /backup
答案1
来自手册页:-
"vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp"
changes the name of the Volume Group with UUID Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to "VolGroup00_tmp".
...所以对于你的情况:-
vgrename zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 newvolgroupname
...将使用 ID 重命名卷组zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87到新卷组名称。
答案2
姓名
vgrename — 重命名卷组概要
vgrename [-A|--autobackup {y|n}] [-d|--debug] [-h|-?|--help] [-t|--test] [-v|--verbose] OldVolumeGroup{路径|名称|UUID} NewVolumeGroup{路径|名称} 描述
vgrename 将现有(参见 vgcreate(8))卷组从 OldVolumeGroup{Name|Path|UUID} 重命名为 NewVolumeGroup{Name|Path}。系统可见的所有卷组都需要具有不同的名称。否则许多 LVM2 命令将拒绝运行或给出警告消息。
当磁盘在机器之间移动时,可能会出现这种情况。如果连接了磁盘,并且它包含的卷组与包含根文件系统的卷组同名,则机器甚至可能无法正确启动。但是,这两个卷组应该具有不同的 UUID(除非磁盘被克隆),因此您可以使用 vgrename 重命名其中一个冲突的卷组。
选项
请参阅 lvm(8) 以了解常用选项。示例
将现有卷组 vg02 重命名为 my_volume_group:vgrename /dev/vg02 /dev/my_volume_group
或者
名称
vg02 我的卷组
将 UUID 为 Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 的卷组名称更改为 VolGroup00_tmp:
vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4
卷组00_tmp
关联:http://linux.die.net/man/8/vgrename
...至于
Volume group name cciss/c0d1 has invalid characters
/dev/cciss/c0d1
不是 VG,因此您无法重命名它。这是一个 PV,VG 可能基于该 PV。