一般,服务器会有多个硬盘,一块硬盘分区安装操作系统,另外多块硬盘分区做存储使用。现在测试添加多块硬盘分区,使用lvm进行实现动态磁盘分配。
1.新增硬盘查看
fdisk -l
可以看到新增的两块硬盘sdb和sdc
2.对硬盘进行分区
fdisk /dev/sdb
============
参数说明:
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 #创建新的空GPT分区表
G create an IRIX (SGI) partition table #创新新的IRIX分区表
l list known partition types #列出已知的分区类型
m print this menu #打印帮助
n add a new partition #增加新分区
o create a new empty DOS partition table #创建新的空DOS分区表
p print the partition table #打印分区表
q quit without saving changes #不保存退出
s create a new empty Sun disklabel
t change a partition's system id #更改分区系统id
u change display/entry units