fdisk -l # 列出所有磁盘的分区表信息
fdisk -l /dev/sdxx # 列出指定磁盘的分区表信息
[root@centos01 ~]# fdisk /dev/sdb ## 对指定磁盘进行分区操作
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition ## 删除一个分区
l list known partition types ## 列出已经分区类型
m print this menu ## 打印这个菜单
n add a new partition ## 新建一个分区
o create a new empty DOS partition table
p print the partition table ## 打印分区表信息
q quit without saving changes ##不保存退出
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk andexit## 保存分区结果并退出
x extra functionality (experts only)
Command (m for help): n ## 创建新分区
Command action
l logical (5orover)
p primary partition (1-4)
p ## 选择分主分区
Partition number (1-4): 3## 分区号选择3
First cylinder (917-1305, default 917): ## enter 使用默认开始位置
Using default value 917
Last cylinder, +cylinders or +size{K,M,G} (917-1305, default 1305): +1G ## 增加1G
Command (m for help): d ## 删除一个分区
Partition number (1-5): 3## 选择要删除的分区号
Command (m for help): w ## 保存并退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.