Linux中fdisk命令磁盘分区

使用命令fdisk 进行分区

[root@localhost ~]# fdisk /dev/sdb
Command (m for help): m//帮助menu
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 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 and exit
x extra functionality (experts only)

Command (m for help):n
Partition type:
p primary (0 primary, 0 extended, 4 free) //主分区
e extended //拓展分区
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048): //默认回车
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +200M//分区大小
Partition 1 of type Linux and of size 200 MiB is set
Command (m for help): w//分区生效
The partition table has been altered!
[root@localhost ~]# lsblk
sdb 8:16 0 10G 0 disk
└─sdb1 8:17 0 200M 0 part
添加磁盘分区成功
注:主分区和扩展分区不能超过5个,扩展分区只能有一个,逻辑分区的前提是有扩展分区,逻辑分区号从5开始。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值