Linux为新硬盘创建LVM

2021-06-22 00:16 阅读 163 次 Linux为新硬盘创建LVM已关闭评论

步骤:

[[email protected] ~]# mkfs.ext4 /dev/sdb
格式化新硬盘

[[email protected] ~]# pvcreate /dev/sdb
为新硬盘创建PV

[[email protected] ~]# lvcreate -l 100%free -n home cl_20-40-41-16
Logical volume "home" created.
新建LV:home
[[email protected] ~]# mkfs.ext4 /dev/cl_20-40-41-16/home
格式化LV:home
[[email protected] ~]# mount /dev/cl_20-40-41-16/home /home
挂载LV:home
[[email protected] ~]# vi /etc/fstab
编辑分区表

流程:

格式化新硬盘-->创建PV-->创建VG(可省略,使用现有的)-->创建LV-->格式化LV-->挂载LV-->修改分区表。

示例:

[[email protected] ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name cl_20-40-41-16
PV Size 930.51 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 238210
Free PE 223390
Allocated PE 14820
PV UUID K7EaU0-mSPH-kenS-hYMf-V7Zx-w6fC-prtyZG

"/dev/sdb" is a new physical volume of "<1.82 TiB"
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size <1.82 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID M4Abwn-WCbe-imFO-9LUg-0f5c-BKPU-pZ0eQe

注:

创建VG的命令为:
vgcreate dxldt /dev/sdb #创建一个名为dxldt的Volume Group

版权声明:本文著作权归原作者所有,欢迎分享,谢谢支持!
转载请保留注明:Linux为新硬盘创建LVM | DXL学习
分类:Centos 标签:

评论已关闭!