Lvm Managerment

Logical Volume Manager

扩展 LVM

  • 分区
fdisk /dev/vdg
# 按下文新建分区
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/vdg: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x50d4ca2f

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-209715199, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-209715199, default 209715199):

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
  • 分区写入内核
partprobe
  • 扩容 LVM
# 创建 PV
pvcreate /dev/vdg1
# 扩容 VG
vgextend nexus_data /dev/vdg1
# 扩容 LVM
lvresize -l +100%FREE /dev/nexus_data/proxy
# 写入文件系统
xfs_growfs /dev/nexus_data/proxy
Infee Fang
Infee Fang
互联网二手搬砖工