|
查看分区信息:
[root@master ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00003b2a
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 63342591 31465472 8e Linux LVM
创建分区/dev/sda2/ 并将分区类型设置为 8e Linux LVM
[root@master ~]# fdisk /dev/sda
Command (m for help): t
Partition number (1-3, default 3): 3
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): p
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00003b2a
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 63342591 31465472 8e Linux LVM
/dev/sda3 63342592 168200191 52428800 8e Linux LVM
让内核重启读取分区信息
[root@master ~]# partprobe /dev/sda
查看物理卷
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
创建物理卷
[root@master ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created.
检查结果
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
/dev/sda3 lvm2 --- 50.00g 50.00g
创建卷组
[root@master ~]# vgcreate test /dev/sda3
Volume group "test" successfully created
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
/dev/sda3 test lvm2 a-- |
|
|