在 RHEL 5 上,我必须从多路径磁盘创建 LVM 镜像。有足够的可用盘区,但是 - 在两个磁盘上,因为 VG 由 4 个磁盘组成。
[root@SERVER ~]# pvs -v --segments | head -1
Scanning for physical volume names
PV VG Fmt Attr PSize PFree Start SSize LV Start Type PE Ranges
[root@SERVER ~]# pvs -v --segments | grep archivvg6
Scanning for physical volume names
/dev/mpath/orau11db6_32gcc1 archivvg6 lvm2 a-- 32.00G 32.00G 0 8191 0 free
/dev/mpath/orau11db6_32gcc2 archivvg6 lvm2 a-- 32.00G 0 0 8191 orau011archlv 0 linear /dev/mpath/orau11db6_32gcc2:0-8190
/dev/mpath/orau11db6_8gcc1 archivvg6 lvm2 a-- 8.00G 8.00G 0 2047 0 free
/dev/mpath/orau11db6_8gcc2 archivvg6 lvm2 a-- 8.00G 0 0 2047 orau011archlv 8191 linear /dev/mpath/orau11db6_8gcc2:0-2046
[root@SERVER ~]# lvs | grep archivvg6
orau011archlv archivvg6 -wi-ao 39.99G
[root@SERVER ~]# lvconvert --mirrorlog mirrored -m 1 archivvg6/orau011archlv /dev/mpath/orau11db6_32gcc1 /dev/mpath/orau11db6_8gcc1
Insufficient suitable allocatable extents for logical volume : 10238 more required
Unable to allocate extents for mirror(s).
[root@SERVER ~]#
[root@SERVER ~]# lvconvert --mirrorlog mirrored -m 1 archivvg6/orau011archlv /dev/mpath/orau11db6_32gcc1
Insufficient free space: 10238 extents needed, but only 8191 available
Unable to allocate extents for mirror(s).
[root@SERVER ~]#
问题: 如何使用“lvconvert”命令来使用这两个磁盘?
更新:“--allocanywhere”有帮助吗?更新: 没有..:
[root@SERVER ~]# lvconvert -i 5 --alloc anywhere --mirrorlog mirrored -m 1 archivvg6/orau011archlv /dev/mpath/orau11db6_32gcc1 /dev/mpath/orau11db6_8gcc1
Insufficient suitable allocatable extents for logical volume : 2 more required
Unable to allocate extents for mirror(s).
[root@SERVER ~]#
答案1
1)有一个语法错误,这是好的:
lvconvert -v -m 1 --mirrorlog mirrored /dev/archivvg6/orau011archlv /dev/mpath/orau11db6_32gcc1 /dev/mpath/orau11db6_32gcc2 /dev/mpath/orau11db6_8gcc1 /dev/mpath/orau11db6_8gcc2
CC1 CC2 CC1 CC2
但手册页并没有真正谈到这一点..:)
2)每个PV需要1个免费PE!因此,减小 FS,然后减小 LV 大小以释放 4 MB 空间。