1、[root@localhost ~]# fdisk -l  //查看硬盘的分区情况,查看要卸载的硬盘标志

在我电脑上显示的是: Device   Boot  Start End        Blocks   Id

/dev/sdb1 *     1    4883919828+   b    W95

System

FAT32

/dev/sdb1就是u盘的标志

2、[root@localhost ~]# umount /dev/sdb1      //把该u盘卸载

3、[root@localhost ~]# fdisk /dev/sdb1       //进入u盘删除分区表界面,它会 显示一下内容

Command (m for help):

4、 Command (m for help):d   //把分区删掉,如果有多个分区需要多次输入d

5、Command (m for help): n  //输入n创建分区,会显示一下内容

Command action

e   extended

p   primary partition (1-4) 如果输入e则是创建扩展分区,输入p是创建主分区

6、Partition number (1-4): 1  //输入1则表示创建一个主分区

7、First cylinder (1-17230, default 1):   //直接回车表示的默认是1

8、Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-17230, default 17230):   //直接回车表示的是默认的大小

9、Command (m for help): c   //设置分区格式为fat32

10、Command (m for help):w   //把写入数据并保存

11、[root@localhost ~]# mkfs.vfat /dev/sdb1   //把u盘格式化