我在一个VG下有三个磁盘和三个PV(基于三个磁盘),然后我在VG上创建了一个LV并将LV挂载到文件夹/bigdisk。即将三个硬盘合并到一个文件夹/bigdisk。我的问题是,当我向/bigdisk写入数据时,数据是否会同时 strip 化到三个磁盘?即三个磁盘是否会同时服务于输入操作以获得更好的 I/O 性能,就像 raid0 一样?
最佳答案
默认情况下,lvcreate
创建一个不会跨越 PV 的线性 LV;它只是将 PV 连接在一起。但是,您可以在使用 --stripes
创建 LV 时配置 strip 化。和 --stripesize
选项。来自 man
lvcreate
的页面:
-i, --stripes Stripes
Gives the number of stripes. This is equal to the number of physical volumes to scatter the logical volume.
-I, --stripesize StripeSize
Gives the number of kilobytes for the granularity of the stripes. StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format. For metadata in LVM2 format, the stripe size may be a larger power of 2 but must not exceed the physical extent size.
vgcreate
创建的 VG 的默认物理范围大小是 4 MiB,因此在默认配置下, strip 大小可以设置在 4 KiB 和 4 MiB 之间。strip 化由内核的 device mapper 处理.您可以使用
dmsetup
检查低级配置.
关于io - 当我在一个 LV 下有多个磁盘时,lvm 的性能如何,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32211400/