pvcreate
pvcreate
is used to create physical volume,it initializes a PV so that it is recognized as belonging to LVM, and allows the PV to be used in a VG. A PV can be a disk partition, whole disk, meta device, or loopback file.
pvcreate Example
Use the whole disk to create a physical volumen.
[root@lau_centos7 ~]# fdisk -l|grep dev Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors Disk /dev/mapper/centos_centos7-root: 18.2 GB, 18249416704 bytes, 35643392 sectors Disk /dev/mapper/centos_centos7-swap: 2147 MB, 2147483648 bytes, 4194304 sectors [root@lau_centos7 ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created.