[root@localhost ~]# fdisk /dev/sdb //使用fdisk工具为磁盘建立分区
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p //显示当前磁盘下已经存在的分区(目前为空)
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units=cylindersof 16065 *512=8225280bytes
Device Boot Start End Blocks Id System
Command (m for help): n //为磁盘添加分区
Command action
e extended
p primary partition (1-4) //这里选择建立主分区便可
p
Partition number (1-4): 1 //输入分区号,这里输入1便可
First cylinder (1-130, default 1): //分区标记开始,使用默认便可
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): //分区标记结束,这里分配磁盘所有可用空间
Using default value 130
Command (m for help): t//改变分区系统识别ID
Selected partition 1
Hex code (type L to list codes): 8e //这里8e表明LVM标示,能够输入L来查看系统支持的ID标示码
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): p //再次显示分区,能够看到分区已经建立好
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units=cylindersof 16065 *512=8225280bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 130 1044193+ 8e Linux LVM
Command (m for help): w //最后输入w来报错分区操做
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1 //建立物理卷PV
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdc1" successfully created
Physical volume "/dev/sdd1" successfully created