创建lvm

1.查看磁盘

root@ps-VMware-Virtual-Platform:~# lsblk

2.创建磁盘分区并设置磁盘分区代码为8e(逻辑卷代码)

root@ps-VMware-Virtual-Platform:~# fdisk /dev/sdb

3.创建pv

root@ps-VMware-Virtual-Platform:~# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.

4.查看pv

root@ps-VMware-Virtual-Platform:~# pvs
  PV         VG Fmt  Attr PSize PFree
  /dev/sdb1     lvm2 ---  5.00g 5.00g

5.创建vg

root@ps-VMware-Virtual-Platform:~# vgcreate vmtest /dev/sdb1
  Volume group "vmtest" successfully created

6.查看vg

root@ps-VMware-Virtual-Platform:~# vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  vmtest   1   0   0 wz--n- <5.00g <5.00g

7.创建lv

root@ps-VMware-Virtual-Platform:~# lvcreate -n vmtest1 -L 5G vmtest
  Volume group "vmtest" has insufficient free space (1279 extents): 1280 required.

这里磁盘容量给满会报错

root@ps-VMware-Virtual-Platform:~# lvcreate -n vmtest1 -L 5G vmtest
  Volume group "vmtest" has insufficient free space (1279 extents): 1280 required.

8.查看lv

root@ps-VMware-Virtual-Platform:~# lvcreate -n vmtest1 -L 4.9G vmtest
  Rounding up size to full physical extent 4.90 GiB
  Logical volume "vmtest1" created.

9.逻辑卷创建完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值