[root@MyServer ~]# fdisk /dev/xvdb
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.
The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
#new 新建分区
Command (m for help): new
#新建主分区
Command action
e extended
p primary partition (1-4)
p
#新建分区的数量,这里直接新建一个就行了。
Partition number (1-4): 1
#起始位置,默认即可
First cylinder (1-3916, default 1):
Using default value 1
#结束位置,默认即可
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
Using default value 3916
#设置格式
Command (m for help): t
#将格式设置为8e(Linux LVM)
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
#写入分区表
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.