linux gdisk 分区,fdisk创建分区

[root@centos8 ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.1).

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.

Created a new DOS disklabel with disk identifier 0x127ea212.

#打印当前情况

Command (m for help): p

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x127ea212

#创建新分区

Command (m for help): n

Partition type

p primary (0 primary, 0 extended, 4 free)

e extended (container for logical partitions)

#创建扩展分区

Select (default p): e

Partition number (1-4, default 1): 3

First sector (2048-41943039, default 2048):

Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +2G

Created a new partition 3 of type 'Extended' and of size 2 GiB.

#创建新分区

Command (m for help): n

Partition type

p primary (0 primary, 1 extended, 3 free)

l logical (numbered from 5)

#创建主分区

Select (default p): p

Partition number (1,2,4, default 1): 2

First sector (4196352-41943039, default 4196352):

Last sector, +sectors or +size{K,M,G,T,P} (4196352-41943039, default 41943039): +2G

Created a new partition 2 of type 'Linux' and of size 2 GiB.

#打印当前情况

Command (m for help): p

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x127ea212

Device Boot Start End Sectors Size Id Type

/dev/sdb2 4196352 8390655 4194304 2G 83 Linux

/dev/sdb3 2048 4196351 4194304 2G 5 Extended

Partition table entries are not in disk order.

#创建新分区

Command (m for help): n

Partition type

p primary (1 primary, 1 extended, 2 free)

l logical (numbered from 5)

#创建主分区

Select (default p): p

Partition number (1,4, default 1): 4

First sector (8390656-41943039, default 8390656):

Last sector, +sectors or +size{K,M,G,T,P} (8390656-41943039, default 41943039): +2G

Created a new partition 4 of type 'Linux' and of size 2 GiB.

#创建新分区

Command (m for help): n

Partition type

p primary (2 primary, 1 extended, 1 free)

l logical (numbered from 5)

#创建逻辑分区

Select (default p): l

Adding logical partition 5

First sector (4096-4196351, default 4096):

Last sector, +sectors or +size{K,M,G,T,P} (4096-4196351, default 4196351): +100M

Created a new partition 5 of type 'Linux' and of size 100 MiB.

#创建新分区

Command (m for help): n

Partition type

p primary (2 primary, 1 extended, 1 free)

l logical (numbered from 5)

#创建逻辑分区

Select (default p): l

Adding logical partition 6

First sector (210944-4196351, default 210944):

Last sector, +sectors or +size{K,M,G,T,P} (210944-4196351, default 4196351): +200M

Created a new partition 6 of type 'Linux' and of size 200 MiB.

#打印当前情况

Command (m for help): p

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x127ea212

Device Boot Start End Sectors Size Id Type

/dev/sdb2 4196352 8390655 4194304 2G 83 Linux

/dev/sdb3 2048 4196351 4194304 2G 5 Extended

/dev/sdb4 8390656 12584959 4194304 2G 83 Linux

/dev/sdb5 4096 208895 204800 100M 83 Linux

/dev/sdb6 210944 620543 409600 200M 83 Linux

Partition table entries are not in disk order.

#创建新分区

Command (m for help): n

Partition type

p primary (2 primary, 1 extended, 1 free)

l logical (numbered from 5)

#创建主分区

Select (default p): p

Selected partition 1

First sector (12584960-41943039, default 12584960):

Last sector, +sectors or +size{K,M,G,T,P} (12584960-41943039, default 41943039): +2G

Created a new partition 1 of type 'Linux' and of size 2 GiB.

#打印当前情况

Command (m for help): p

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x127ea212

Device Boot Start End Sectors Size Id Type

/dev/sdb1 12584960 16779263 4194304 2G 83 Linux #4

/dev/sdb2 4196352 8390655 4194304 2G 83 Linux #2

/dev/sdb3 2048 4196351 4194304 2G 5 Extended #1

/dev/sdb4 8390656 12584959 4194304 2G 83 Linux #3

/dev/sdb5 4096 208895 204800 100M 83 Linux #1-1

/dev/sdb6 210944 620543 409600 200M 83 Linux #1-2

Partition table entries are not in disk order.

#保存退出

Command (m for help):w

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值