使用parted工具:
#yum install parted
#parted /dev/sdb //选择要分的硬盘
GNUParted 2.3Using /dev/sdbWelcome to GNU Parted! Type ‘help’ to view a lis ofcommands。
#(parted) mklabel gpt //类型GPT
Warning: The existing disk label on /dev/sdb will be destroyedand all data on this disk will be lost. Do you want to continue?
Yes/No? y //确定
#(parted) mkpart prinmary 1 -1 //将硬盘分成一个分区
#(parted) print //查看
#(parted) quit //退出Information: You may need to update /etc/fstab.
#mkfs.ext4 /dev/sdb1 //格式化文件系统为ext4
GPT(全局唯一标识磁盘分区表,适合UEFI下启动的系统)与MBR(主引导记录,适合BIOS下启动的系统)不同,GPT只有主分区,没有逻辑分区
推荐: https://my.oschina.net/ailoveai5521/blog/737359?utm_medium=referral