![如何使用lvconvert与两个磁盘进行镜像? - 合适的可分配范围不足](https://linux22.com/image/79102/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8lvconvert%E4%B8%8E%E4%B8%A4%E4%B8%AA%E7%A3%81%E7%9B%98%E8%BF%9B%E8%A1%8C%E9%95%9C%E5%83%8F%EF%BC%9F%20-%20%E5%90%88%E9%80%82%E7%9A%84%E5%8F%AF%E5%88%86%E9%85%8D%E8%8C%83%E5%9B%B4%E4%B8%8D%E8%B6%B3.png)
在 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 空间。