标签:psi 5.0 local ESS mkfs 扩展 硬盘 logical created
1.在虚拟机设置里添加3快新硬盘2.创建分区
[root@localhost ~]# fdisk /dev/sdb
设备 Boot Start End Blocks Id System
/dev/sdb1 2048 10485759 5241856 83 Linux
[root@localhost ~]# fdisk /dev/sdc
设备 Boot Start End Blocks Id System
/dev/sdc1 2048 10485759 5241856 83 Linux
[root@localhost ~]# fdisk /dev/sdd
设备 Boot Start End Blocks Id System
/dev/sdd1 2048 10485759 5241856 83 Linux
3.将磁盘加入物理卷
[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[root@localhost ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created.
[root@localhost ~]# pvcreate /dev/sdd1
Physical volume "/dev/sdd1" successfully created.
[root@localhost ~]# pvs 查看
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- <19.00g 0
/dev/sdb1 lvm2 --- <5.00g <5.00g
/dev/sdc1 lvm2 --- <5.00g <5.00g
/dev/sdd1 lvm2 --- <5.00g <5.00g
4.创建卷组 “ jz1 jz2 jz3 ”
[root@localhost ~]# vgcreate jz1 /dev/sdb1
Volume group "jz1" successfully created
[root@localhost ~]# vgcreate jz2 /dev/sdc1
Volume group "jz2" successfully created
[root@localhost ~]# vgcreate jz3 /dev/sdd1
Volume group "jz3" successfully created
查看
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- <19.00g 0
jz1 1 0 0 wz--n- <5.00g <5.00g
jz2 1 0 0 wz--n- <5.00g <5.00g
jz3 1 0 0 wz--n- <5.00g <5.00g
5.创建逻辑卷 “ lj1 lj2 lj3 ”大小以及分配逻辑卷名称和卷组
[root@localhost ~]# lvcreate -L 1G -n lj1 jz1
Logical volume "lj1" created.
[root@localhost ~]# lvcreate -L 1G -n lj1 jz2
Logical volume "lj1" created.
[root@localhost ~]# lvcreate -L 1G -n lj1 jz3
Logical volume "lj1" created.
查看
[root@localhost ~]# lvscan
ACTIVE ‘/dev/jz3/lj1‘ [1.00 GiB] inherit
ACTIVE ‘/dev/jz2/lj1‘ [1.00 GiB] inherit
ACTIVE ‘/dev/jz1/lj1‘ [1.00 GiB] inherit
ACTIVE ‘/dev/centos/swap‘ [2.00 GiB] inherit
ACTIVE ‘/dev/centos/root‘ [<17.00 GiB] inherit
格式化文件系统为ext4
[root@localhost ~]# mkfs.ext4 /dev/jz1/lj1
[root@localhost ~]# mkfs.ext4 /dev/jz2/lj1
[root@localhost ~]# mkfs.ext4 /dev/jz3/lj1
挂载到yp1 yp2 yp3
mkdir /yp1
mkdir /yp2
mkdir /yp3
mount /dev/jz1/lj1 /yp1/
mount /dev/jz2/lj1 /yp2/
mount /dev/jz3/lj1 /yp3/
做扩展
[root@localhost ~]# lvextend -L +1G /dev/jz3/lj1
Size of logical volume jz3/lj1 changed from 1.00 GiB (256 extents) to 2.00 GiB (512 extents).
Logical volume jz3/lj1 successfully resized.
最后lsblk查看
标签:psi 5.0 local ESS mkfs 扩展 硬盘 logical created
原文地址:http://blog.51cto.com/13859004/2144616