本文主要是介绍4.11-Lvm讲解(中)创建卷组,创建逻辑卷,扩容逻辑卷,缩容逻辑卷,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
创建卷组
[root@evan-01 ~]# vgcreate vg1 /dev/sdb1 /dev/sdb2Volume group "vg1" successfully created
[root@evan-01 ~]#
查看卷组
查看创建的卷组
[root@evan-01 ~]# vgdisplay--- Volume group ---VG Name vg1System ID Format lvm2Metadata Areas 2Metadata Sequence No 1VG Access read/writeVG Status resizableMAX LV 0Cur LV 0Open LV 0Max PV 0Cur PV 2Act PV 2VG Size 1.99 GiBPE Size 4.00 MiBTotal PE 510Alloc PE / Size 0 / 0 Free PE / Size 510 / 1.99 GiBVG UUID Zp3UBb-ofWe-At0C-2XPt-Mvsz-uf7Z-uWLh9S--- Volume group ---VG Name centosSystem ID Format lvm2Metadata Areas 1Metadata Sequence No 3VG Access read/writeVG Status resizableMAX LV 0Cur LV 2Open LV 2Max PV 0Cur PV 1Act PV 1VG Size <19.00 GiBPE Size 4.00 MiBTotal PE 4863Alloc PE / Size 4863 / <19.00 GiBFree PE / Size 0 / 0 VG UUID WR4onu-xheI-7NwR-5vW1-y0Ek-eilK-Yil3A2[root@evan-01 ~]#
更简单直观查看卷组
[root@evan-01 ~]# vgsVG #PV #LV #SN Attr VSize VFreecentos 1 2 0 wz--n- <19.00g 0 vg1 2 0 0 wz--n- 1.99g 1.99g
[root@evan-01 ~]#
创建逻辑卷
[root@evan-01 ~]# lvcreate -L 100M -n 1v1 vg1Logical volume "1v1" created.
[root@evan-01 ~]#
格式化
[root@evan-01 ~]# mkfs.ext4 /dev/vg1/lv1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=33685504
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done [root@evan-01 ~]#
挂载
[root@evan-01 ~]# mount /dev/vg1/lv1 /mnt/
[root@evan-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 17G 1023M 16G 6% /
devtmpfs 482M 0 482M 0% /dev
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 493M 6.8M 486M 2% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/sda1 1014M 125M 890M 13% /boot
tmpfs 9
这篇关于4.11-Lvm讲解(中)创建卷组,创建逻辑卷,扩容逻辑卷,缩容逻辑卷的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!