创建卷组
[root@evan-01 ~]# vgcreate vg1 /dev/sdb1 /dev/sdb2
Volume group "vg1" successfully created
[root@evan-01 ~]#
查看卷组
查看创建的卷组
[root@evan-01 ~]# vgdisplay
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 1.99 GiB
PE Size 4.00 MiB
Total PE 510
Alloc PE / Size 0 / 0
Free PE / Size 510 / 1.99 GiB
VG UUID Zp3UBb-ofWe-At0C-2XPt-Mvsz-uf7Z-uWLh9S
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <19.00 GiB
PE Size 4.00 MiB
Total PE 4863
Alloc PE / Size 4863 / <19.00 GiB
Free PE / Size 0 / 0
VG UUID WR4onu-xheI-7NwR-5vW1-y0Ek-eilK-Yil3A2
[root@evan-01 ~]#
更简单直观查看卷组
[root@evan-01 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 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 vg1
Logical 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, 73729
Allocating 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