Centos LVM(卷管理) --两颗磁盘合成一块并挂载

          Basic concept:

PVPhysical Volume, 物理卷

VGVolume Group,卷组

LVLogical Volume,逻辑卷

 

(If commands shows not found, please install it.  #sudo yum install lvm2 -y  )

 

 

  1. Create PV

[root@shunshun001 /]# pvcreate /dev/nvme0n1

[root@shunshun001 /]# pvcreate /dev/nvme1n1

 

 

  1. Create VG and extend VG

[root@shunshun001 /]# vgcreate vg_data /dev/nvme0n1

[root@shunshun001 /]# vgextend vg_data /dev/nvme1n1

 

  1. Create LV

# lvcreate -l[自定义分区大小] -n[自定义分区名称] [vg名称]

[root@shunshun001 /]# lvcreate -l 100%VG -n lvm_data vg_data

 

  1. Create file system

[root@shunshun001 /]# mkfs -t ext4 /dev/vg_data/lvm_data

 

  1. Mount

[root@shunshun001 /]# mount /dev/vg_data/lvm_data /data

 

  1. Automount and check.

Edit /etc/fstab,  use mount and umount command to check.

Add Feedback