[root@linuxidc ~]# lvcreate -L +50G -n lv0 vg0 ##创建LVM大小50G,名称lv0,从vg0中调容量
Logical volume "lv0" created.##创建成功
[root@linuxidc ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv0 vg0 -wi-a----- 50.00g
[root@linuxidc ~]# lvscan
ACTIVE '/dev/vg0/lv0' [50.00 GiB] inherit
[root@linuxidc ~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg0/lv0#lv全名称
LV Name lv0
VG Name vg0
LV UUID bCpncg-nTn7-V5vk-NWVq-NTT5-lmQx-Ayfcqd
LV Write Access read/write ##可读可写权限
LV Creation host, time linuxidc, 2016-06-04 15:16:40 +0800#创建时间和创建人
LV Status available
# open 0
LV Size 50.00 GiB
Current LE 12800
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
五、将创建好的lvm卷进行文件系统格式处理,然后挂载供我们使用
[root@linuxidc ~]# mkfs.ext4 /dev/vg0/lv0
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2162163712
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@linuxidc ~]# mkdir /lvmtest/
[root@linuxidc ~]# mount /dev/vg0/lv0 /lvmtest/
[root@linuxidc ~]# mount
/dev/sda5 on /testdir type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=100136k,mode=700,uid=42,gid=42)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=100136k,mode=700)
/dev/mapper/vg0-lv0 on /lvmtest type ext4 (rw,relatime,seclabel,data=ordered)
[root@linuxidc ~]# cd /lvmtest/
[root@linuxidc lvmtest]# ls
lost+found
[root@linuxidc lvmtest]# mkdir lvmtest1
[root@linuxidc lvmtest]# ls
lost+found lvmtest1
创建了/lvmtest目录,然后挂载到此目录下,去写了点东西,测试OK没有问题!