查看新磁盘
sudo fdisk -l
磁盘分区
sudo fdisk /dev/sdb
n->p->1->enter->enter->w
n 添加一个分区
p 主分区
1 分区号
两个回车是开始和结束的磁盘大小
w 写入磁盘
[vagrant@docker2 ~]$ sudo 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 0x2473e16c.
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
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
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