[root@localhost ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x74bda18d.
Command (m forhelp): p
Disk /dev/sdb: 161.1 GB, 161061273600 bytes, 314572800 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: 0x74bda18d
Device Boot Start End Blocks Id System
Command (m forhelp): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (2048-314572799, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-314572799, default 314572799): Using default value 314572799 Partition 1 of type Linux and of size 150 GiB is set
Command (m forhelp): t Selected partition 1 Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM'
Command (m forhelp): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
检查块信息
1 2 3 4 5 6 7 8
[root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk ├─sda1 8:1 0 200M 0 part /boot ├─sda2 8:2 0 4G 0 part [SWAP] └─sda3 8:3 0 45.8G 0 part / sdb 8:16 0 150G 0 disk └─sdb1 8:17 0 150G 0 part
创建物理卷pv
1 2
[root@localhost ~]# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created
创建卷组vg
1 2
[root@localhost ~]# vgcreate vg01 /dev/sdb1 Volume group "vg01" successfully created
[root@localhost ~]# fdisk /dev/sdc Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x74bda18d.
Command (m forhelp): p
Disk /dev/sdc: 161.1 GB, 161061273600 bytes, 314572800 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: 0x74bda18d
Device Boot Start End Blocks Id System
Command (m forhelp): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (2048-314572799, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-314572799, default 314572799): Using default value 314572799 Partition 1 of type Linux and of size 150 GiB is set
Command (m forhelp): t Selected partition 1 Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM'
Command (m forhelp): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
检查块信息
1 2 3 4 5 6 7 8 9 10 11
[root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk ├─sda1 8:1 0 200M 0 part /boot ├─sda2 8:2 0 4G 0 part [SWAP] └─sda3 8:3 0 45.8G 0 part / sdb 8:16 0 150G 0 disk └─sdb1 8:17 0 150G 0 part └─vg01-lv01_data 253:0 0 150G 0 lvm /data sdc 8:18 0 150G 0 disk └─sdc1 8:19 0 150G 0 part