更多: zhilu jiaocheng
将 PV 添加到 VG
- 使用 fdisk 将分区类型设置为 Linux LVM, 0x8e 。
# fdisk /dev/sdc
输入 t 选择分区:
Command (m for help): t Partition number (1-4): 1
对于 Linux LVM,将分区类型设置为 8e。
Hex code (type L to list codes): 8e ## So the output of the partition type 8e is Device Boot Start End Blocks Id System /dev/sdc1 1675 2054 3052087 8e Linux
最后使用 write/quit 命令 (w) 保存并退出 fdisk。
注意:执行此命令后,更改将是永久性的。
Command (m for help): w
- 确保通过重新启动机器或者运行 partprobe 更改分区表后重新加载分区表。
# partprobe
- 需要使用pvcreate将分区/磁盘添加为物理卷。
# pvcreate /dev/sdc1
- 需要使用 vgextend 将物理卷添加到卷组中。
# vgextend vg_data /dev/sdc1
当需要增加逻辑卷的大小或者数量时,我们可能希望向现有卷组添加新的物理卷,但卷组上没有更多空间来容纳这种扩展。
物理卷可以是一个分区,也可以是整个磁盘。
在这篇文章中,我们将考虑将整个磁盘添加到现有卷组中。
日期:2020-09-17 00:12:24 来源:oir作者:oir